From 8b0c858f28a57882102c50fcfb3d3e64a7f104a1 Mon Sep 17 00:00:00 2001 From: ariasuni Date: Sat, 12 Jan 2019 15:16:03 +0100 Subject: [PATCH] Make XML highlighting more fine-grained --- cmd/micro/runtime.go | 4 ++-- runtime/syntax/html.yaml | 3 +-- runtime/syntax/xml.yaml | 26 +++++++++++++++++++++----- 3 files changed, 24 insertions(+), 9 deletions(-) diff --git a/cmd/micro/runtime.go b/cmd/micro/runtime.go index 3dd32b65..12482d9b 100644 --- a/cmd/micro/runtime.go +++ b/cmd/micro/runtime.go @@ -2136,7 +2136,7 @@ func runtimeSyntaxHaskellYaml() (*asset, error) { return a, nil } -var _runtimeSyntaxHtmlYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xa4\x54\x4d\x8f\xe3\x44\x10\x3d\x93\x5f\xe1\xf5\x22\xd4\xbd\x4b\x32\x70\x19\x09\x6f\x76\x2c\xb4\xc0\x15\x0e\x5c\x50\x26\x23\xb5\xbb\xcb\x76\x93\xfe\xf0\x76\x97\xb3\x1b\x78\xfc\x77\xd4\xce\xcc\x4e\x46\x3b\x20\x24\xac\xc8\x8a\x5e\x95\xab\x5e\xbd\xfa\xe8\xad\x23\x3e\x4d\xd4\x54\x23\x7b\xb7\x5a\x19\x62\xd2\xdc\x54\xab\xaa\xaa\xaa\x62\x0c\xca\x53\x53\xd5\xb7\xb7\x9b\x91\xfd\xce\xed\xdb\x2f\xeb\xd5\x2a\xcd\x8e\x72\xb3\xf8\xac\x2b\x4a\x29\xa6\xa6\xaa\xb7\xbb\xbb\x17\xfb\xcd\xab\xf6\xa6\xbe\x37\xe4\x93\xef\xa2\xdb\xb0\x1a\x9a\xaa\x16\xad\x95\xdb\xdd\xd5\xbe\x15\x4a\x74\x5d\x82\x4e\x31\x9c\x3c\x8c\x49\x94\x33\xa6\xc9\x11\x23\x91\x42\x62\xab\x1d\x21\x5b\x43\x98\x8d\x8d\xb2\x45\x27\x54\x26\xd1\xc7\xc0\xb2\x85\x11\x16\x51\xc2\x0e\x70\x51\x1f\xde\xcf\x91\x09\x49\xb6\xd0\x4a\x84\xa3\xca\x98\xd8\xc6\x20\xa1\x29\x30\x25\x68\xcb\x04\x1d\x85\x21\x38\xb8\x21\xc5\x79\x92\x30\x42\xb1\x12\xce\xe6\x25\x1e\xc8\x81\x58\x59\x97\xd1\x07\x58\xe5\xe2\x00\x9b\xe0\xc0\x12\xe4\x45\x47\x46\xb6\xe8\x2d\x39\x93\x89\xd1\xdb\x41\x68\xb5\x24\xc1\x9c\x48\xa2\xd0\x42\x1f\x93\x87\xb0\xb2\xed\x93\xf2\x84\xe5\x5d\xbc\xc7\xdd\xb7\xeb\xeb\x3d\xc6\x04\x0b\xeb\x07\xd8\x20\xa6\x99\x91\x25\x0e\x9d\xc1\x81\x4e\x03\x05\x38\xd5\x91\x83\xa3\x81\x82\x81\xb3\x22\x1c\x64\x0b\xaf\x84\x0d\x98\x90\x0e\x12\x9e\xc2\x2c\x2c\x93\x2f\x38\xb1\x50\xa0\x24\x11\xd4\x11\x21\x8a\x73\x2e\x64\x9d\xec\xc4\x12\x51\x38\x4c\x2c\x96\x4a\xb1\x28\x31\xf3\x34\xb3\xc4\x24\x54\x52\x1e\x56\xf3\x9c\x08\xe5\x17\x87\x22\xbd\x6c\xf1\x1e\x49\x4c\x60\xcc\xdd\x49\x22\x0b\x4e\xf6\x40\xb2\x45\x56\x7e\x42\x26\xa1\x97\x62\x1d\x69\x96\xc8\x5e\x39\x87\x1c\xe7\xa4\x09\x79\x52\x01\x99\x53\x0c\x03\xf2\x2c\x3a\x4c\xf0\x5e\xa5\x93\x04\xd3\x47\x56\xa5\x9b\x6c\x3d\x81\x93\xd2\x07\xcc\xc2\xc9\x16\x47\x95\x70\xb4\x86\x22\x3e\x74\x49\x8a\x6a\xf3\x0a\x37\xf2\xd9\x99\xd9\xd0\x47\xa6\x60\xc8\x3c\x19\x9e\x2e\x9a\x13\x8c\x3d\xa2\x8c\x2b\x46\x52\x46\x50\x69\x7f\x1f\x63\xe9\x37\x5b\x76\x04\x56\x5d\x79\xdf\x3b\x63\x14\xa4\x4a\x13\xd3\xe2\x25\x97\xac\x4f\x72\x4e\xa4\xad\x72\x4d\x55\x7f\xb5\xbb\x7b\xb3\xdb\x35\x79\x52\x9a\x9a\xfd\x7e\xff\xea\xcd\x53\x5e\x4d\x55\xef\x9a\xb7\xfb\x07\xd0\x1a\x0a\x6c\x7b\x4b\x65\xfc\x85\x72\x8c\x6e\xd0\xd1\xc5\x84\x91\xec\x30\x32\xc6\x44\x3d\xac\x79\x68\x71\x0c\x83\xa1\xac\x51\x76\x0a\x31\x08\xed\xac\x3e\xa0\x8f\x7a\xce\x70\x51\x19\xf8\x38\x67\x8a\xc7\xd2\xde\x6c\xff\x78\x50\x38\x69\xb0\x4a\x03\x31\xca\xa6\xe2\xa8\xdc\x4c\xf8\x60\x0d\x8f\xf2\xed\x03\x15\x1d\x43\x66\x15\x78\x13\x66\xdf\x9d\xf9\xb4\x56\xbe\xdc\x7d\xb3\xfe\xee\xfb\xf5\x4f\xfb\x3f\xaf\xbf\xbe\xfe\xeb\xec\xfb\xb2\x5a\x57\x86\x7a\x35\x3b\x6e\xee\x81\xf2\x64\x56\x89\x9b\xaa\xbe\xa9\x2f\x40\x0a\x45\xfd\xed\x25\x74\x5e\xfd\x6a\xb7\x5f\x3d\xb7\xe5\x5b\xdc\x7c\xc6\x28\x73\xb2\x61\xd8\xcc\xa9\xc8\x27\x7a\x9e\x44\x19\xba\x91\xef\xff\x0c\x96\xa1\xc7\x14\x3d\xc9\xe6\xea\x6a\x77\x57\x7d\xb1\x7f\xfd\x18\xc3\x7b\x0a\x85\xd6\xf6\xc5\x7a\xbd\x79\xdd\xae\xd7\x9f\xe2\x4f\x89\xa6\x14\xf5\x62\xfb\xe1\xe7\x77\xbf\xfe\xf6\xcb\x8f\x9b\xd7\xa5\xa9\xcf\xe7\x3f\xd7\x7a\x59\xe9\x6d\x5d\x7f\xc2\xce\x85\x5e\x22\xf9\x60\xa7\xe5\xee\xdd\xde\x6e\x1e\xd1\x8b\xc3\xf7\xf0\x5c\x66\x3a\x0f\xd2\xbb\x51\xa5\xc7\x4f\xef\xe9\x3c\x91\xfc\x92\xc6\xf6\xbc\xba\x8f\x87\xf3\x42\xf8\xab\xe7\x6c\xce\x7a\xcb\xeb\x65\xc3\x9b\x0b\xf5\xff\x9d\xa3\x0d\xda\xcd\xa6\x5c\xf2\xdf\xd5\x51\x9d\xc3\xfe\x17\x6e\x7c\x72\xf4\x0f\xd4\x3e\x37\xfd\x4f\x66\x3a\xe7\x7a\xb5\xfa\x3b\x00\x00\xff\xff\x01\xde\xaf\x06\x92\x06\x00\x00") +var _runtimeSyntaxHtmlYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xa4\x54\x4d\x8f\x1b\x45\x10\x3d\xe3\x5f\x31\x99\x20\xd4\x9d\x60\x2f\x5c\x56\x62\xe2\xec\x08\x05\xb8\xc2\x81\x0b\xf2\x7a\xa5\x9e\xee\x9a\x99\xc6\xfd\x31\xe9\xae\x71\x62\x78\xfc\x77\xd4\xe3\xdd\xac\x57\x59\x10\x12\x96\xd5\xb2\xaa\xca\x55\xaf\x5e\xd5\xab\xde\x3a\xe2\xd3\x44\x4d\x35\xb2\x77\xab\x95\x21\x26\xcd\xcd\xaa\xaa\xaa\xaa\xf8\x82\xf2\xd4\x54\xf5\xed\xed\x66\x64\xbf\x73\xfb\xf6\xcb\x7a\xb5\x4a\xb3\xa3\x7c\x8e\x59\x57\x94\x52\x4c\x4d\x55\x6f\x77\x77\x2f\xf6\x9b\x57\xed\x4d\x7d\xef\xc8\x27\xdf\x45\xb7\x61\x35\x34\x55\x2d\x5a\x2b\xb7\xbb\xab\x7d\x2b\x94\xe8\xba\x04\x9d\x62\x38\x79\x18\x93\x28\x67\x4c\x93\x23\x46\x22\x85\xc4\x56\x3b\x42\xb6\x86\x30\x1b\x1b\x65\x8b\x4e\xa8\x4c\xa2\x8f\x81\x65\x0b\x23\x2c\xa2\x84\x1d\xe0\xa2\x3e\xbc\x9f\x23\x13\x92\x6c\xa1\x95\x08\x47\x95\x31\xb1\x8d\x41\x42\x53\x60\x4a\xd0\x96\x09\x3a\x0a\x43\x70\x70\x43\x8a\xf3\x24\x61\x84\x62\x25\x9c\xcd\x4b\x3e\x90\x03\xb1\xb2\x2e\xa3\x0f\xb0\xca\xc5\x01\x36\xc1\x81\x25\xc8\x8b\x8e\x8c\x6c\xd1\x5b\x72\x26\x13\xa3\xb7\x83\xd0\x6a\x29\x82\x39\x91\x44\x81\x85\x3e\x26\x0f\x61\x65\xdb\x27\xe5\x09\xcb\x5b\xa2\xc7\xdd\xb7\xeb\xeb\x3d\xc6\x04\x0b\xeb\x07\xd8\x20\xa6\x99\x91\x25\x0e\x9d\xc1\x81\x4e\x03\x05\x38\xd5\x91\x83\xa3\x81\x82\x81\xb3\x22\x1c\x64\x0b\xaf\x84\x0d\x98\x90\x0e\x12\x9e\xc2\x2c\x2c\x93\x2f\x76\x62\xa1\x40\x49\x22\xa8\x23\x42\x14\xe7\x5a\xc8\x3a\xd9\x89\x25\xa2\x70\x98\x58\x2c\x9d\x62\x61\x62\xe6\x69\x66\x89\x49\xa8\xa4\x3c\xac\xe6\x39\x11\xca\x37\x0e\x85\x7a\xd9\xe2\x3d\x92\x98\xc0\x98\xbb\x93\x44\x16\x9c\xec\x81\x64\x8b\xac\xfc\x84\x4c\x42\x2f\xcd\x3a\xd2\x2c\x91\xbd\x72\x0e\x39\xce\x49\x13\xf2\xa4\x02\x32\xa7\x18\x06\xe4\x59\x74\x98\xe0\xbd\x4a\x27\x09\xa6\x8f\xac\xca\x34\xd9\x7a\x02\x27\xa5\x0f\x98\x85\x93\x2d\x8e\x2a\xe1\x68\x0d\x45\x7c\xe8\x92\x14\xd5\xe6\x15\x6e\xe4\xb3\x3b\xb3\xa1\x8f\x4c\xc1\x90\x79\xb2\x3c\x5d\x34\x27\x18\x7b\x44\xd9\x56\x8c\xa4\x8c\xa0\x32\xfe\x3e\xc6\x32\x6f\xb6\xec\x08\xac\xba\xf2\xde\x07\x63\x14\xa4\xca\x10\xd3\x12\x25\x97\xaa\x4f\x6a\x4e\xa4\xad\x72\x4d\x55\x7f\xb5\xbb\x7b\xb3\xdb\x35\x79\x52\x9a\x9a\xfd\x7e\xff\xea\xcd\x53\x5c\x4d\x55\xef\x9a\xb7\xfb\x07\xa3\x35\x14\xd8\xf6\x96\xca\xfa\x0b\xe5\x18\xdd\xa0\xa3\x8b\x09\x23\xd9\x61\x64\x8c\x89\x7a\x58\xf3\x30\xe2\x18\x06\x43\x59\xa3\x68\x0a\x31\x08\xed\xac\x3e\xa0\x8f\x7a\xce\x70\x51\x19\xf8\x38\x67\x8a\xc7\x32\xde\x6c\xff\x78\x60\x38\x69\xb0\x4a\x03\x31\x8a\x50\x71\x54\x6e\x26\x7c\xb0\x86\x47\xf9\xf6\x01\x8a\x8e\x21\xb3\x0a\xbc\x09\xb3\xef\xce\x78\x5a\x2b\x5f\xee\xbe\x59\x7f\xf7\xfd\xfa\xa7\xfd\x9f\xd7\x5f\x5f\xff\x75\x8e\x7d\x59\xad\x2b\x43\xbd\x9a\xdd\xbd\xca\x5f\x96\xa7\xca\xac\x12\x37\x55\x7d\x53\x5f\x18\x29\x14\xf6\xb7\x97\xa6\xb3\xf4\xab\xdd\x7e\xf5\x9c\xca\xb7\xb8\xf9\x0c\x51\xe6\x64\xc3\xb0\x99\x53\xa1\x4f\xf4\x3c\x89\xb2\x74\x23\xdf\xff\x18\x2c\x43\x8f\x29\x7a\x92\xcd\xd5\xd5\xee\xae\xfa\x62\xff\xfa\x31\x87\xf7\x14\x0a\xac\xed\x8b\xf5\x7a\xf3\xba\x5d\xaf\x3f\xe5\x9f\x12\x4d\x29\xea\xc5\xf7\xc3\xcf\xef\x7e\xfd\xed\x97\x1f\x37\xaf\xcb\x50\x9f\xaf\x7f\xee\xf5\xb2\xd3\xdb\xba\xfe\x64\x3b\x37\x7a\x69\xc9\x07\x3b\x2d\x77\xef\xf6\x76\xf3\x68\xbd\x38\x7c\x0f\x9f\xcb\x4a\xe7\x45\x7a\x37\xaa\xf4\xf8\xd7\x7b\x38\x4f\x28\xbf\x84\xb1\x3d\x4b\xf7\xf1\x70\x5e\x10\x7f\xf5\x9c\xcf\x59\x6f\x79\xbd\x28\xbc\xb9\x60\xff\xdf\x31\xda\xa0\xdd\x6c\xca\x25\xff\x5d\x1d\xd5\x39\xed\x7f\xc1\xc6\x27\x47\xff\x00\xed\x73\xd7\xff\x44\xa6\x73\xae\x57\x7f\x07\x00\x00\xff\xff\xf2\xf2\x45\x80\x90\x06\x00\x00") func runtimeSyntaxHtmlYamlBytes() ([]byte, error) { return bindataRead( @@ -3516,7 +3516,7 @@ func runtimeSyntaxViYaml() (*asset, error) { return a, nil } -var _runtimeSyntaxXmlYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x84\xcd\x31\x4b\xc6\x30\x10\x06\xe0\x3d\xbf\xe2\x3c\x44\xf4\x83\x7c\xee\xa9\xd8\x41\x9d\x75\x70\x91\xa6\x42\x68\xae\x35\x70\x89\x25\x89\x52\x21\x3f\x5e\x62\xd5\xa1\x48\xbd\xf1\xde\xbb\xe7\x1d\x1d\x53\xfe\x98\x49\xc1\xe2\x59\x08\x4b\x99\x86\xac\x04\x00\x40\x8d\x82\xf1\xa4\x00\xb5\x3e\x9e\x2f\x9e\x4b\x9a\x3c\xb7\x25\x86\xa9\xa4\xf7\xa9\xcc\xec\x52\xbe\x38\xc5\xaf\xeb\x17\x32\x96\xa2\x02\xbc\xd2\xba\x5d\x3c\x1f\x0f\x5a\xb7\xd7\x28\x44\x7c\x63\x4a\xab\x28\x61\x78\xf5\x9e\xc2\x77\x41\x9d\x94\x4d\xcc\xf5\xeb\xe4\xf6\xfe\xe6\xf1\xe9\xe1\x0e\x7f\x23\x0a\x56\x01\x76\x97\x7d\x65\x7e\x96\xab\x06\x5d\xff\x3f\x28\xe5\xd6\x92\x72\x47\x72\x96\x42\x76\xa3\xa3\xf8\x07\xb6\x95\x76\x9c\x34\xd3\xe0\x0c\x2b\xc0\xb3\xee\xb9\xe9\x0f\x0d\x8a\xcf\x00\x00\x00\xff\xff\x4f\xfd\x19\x8d\x65\x01\x00\x00") +var _runtimeSyntaxXmlYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xb4\x90\x3d\x4f\xc3\x30\x10\x86\xf7\xfc\x8a\xc3\x42\x7c\x54\x4a\xd8\x5d\x20\x43\x61\x86\x81\x05\xd5\x45\x32\xc9\x35\xb5\xb0\x1d\xcb\x3e\x50\x2a\xe5\xc7\xa3\xd4\xb4\xd0\x7c\x20\x31\x90\xed\xee\x49\x9e\xf7\xbd\xac\x95\x46\xda\x3a\xe4\xd0\x18\x9d\x24\x25\x12\x16\xc4\x13\x00\x80\x0e\x59\x69\x90\x03\x13\x22\xbb\x68\x8c\x6e\x43\x65\x74\xde\x7a\x5b\xb5\xe1\xa3\x6a\x9d\x56\x81\x2e\x4f\xd9\xee\xed\x0d\xca\x12\x3d\x07\x76\x2d\x44\xde\x18\x9d\xcd\x84\xc8\x6f\x59\x92\xf8\x77\x8d\x21\x1a\x53\x70\x1e\x9d\xaf\x8b\x38\x76\x4f\x20\xe9\xa9\xfb\xea\xe4\xee\x61\xf1\xf4\xfc\x78\xcf\x0e\x08\x6d\xc9\x81\x2d\xaf\x56\x9d\x66\xbf\x8c\x36\x58\xae\xbe\x84\x45\x6d\x0c\x5a\x1a\x13\xa6\x69\xdf\x95\xa6\xbf\x98\x82\xc3\x42\x49\xcd\x81\x9d\x2d\x5f\xe6\xab\xd9\x9c\xed\xc1\xd6\xbc\xd6\x3a\x23\x59\x8d\xa4\x08\x91\xe7\xfd\x98\x6e\x37\x08\x3a\x8c\x51\xaa\x4a\xb4\xa4\xd6\x0a\xfd\x31\xf9\x29\x07\x36\x40\x31\xe0\x66\x08\x8e\xaf\xf9\xce\x29\x6a\x1b\x48\x5a\xca\x02\x79\x65\xab\xe9\x30\xc1\xa6\xd2\xc6\x48\x78\x53\x6e\x77\xa9\x10\xd9\x54\x99\xc1\xba\xdf\x28\xfe\xf0\xc5\x46\xfa\x71\xd5\x1f\xda\x9f\x4f\x95\x1f\x01\xff\xd6\xfd\x33\x00\x00\xff\xff\x81\x3f\xde\xab\x4c\x03\x00\x00") func runtimeSyntaxXmlYamlBytes() ([]byte, error) { return bindataRead( diff --git a/runtime/syntax/html.yaml b/runtime/syntax/html.yaml index d858096f..347201cd 100644 --- a/runtime/syntax/html.yaml +++ b/runtime/syntax/html.yaml @@ -1,6 +1,6 @@ filetype: html -detect: +detect: filename: "\\.htm[l]?$" rules: @@ -41,4 +41,3 @@ rules: limit-group: symbol.tag rules: - include: "css" - diff --git a/runtime/syntax/xml.yaml b/runtime/syntax/xml.yaml index 2d435847..9322b7fe 100644 --- a/runtime/syntax/xml.yaml +++ b/runtime/syntax/xml.yaml @@ -5,7 +5,7 @@ detect: header: "<\\?xml.*\\?>" rules: - - comment: + - preproc: start: "" rules: [] @@ -13,8 +13,24 @@ rules: start: "" rules: [] - - identifier: - start: "<" - end: ">" - rules: [] - special: "&[^;]*;" + - symbol.tag: + start: "<\\??" + end: "\\??>" + rules: + - identifier: + start: " " + end: "=" + rules: [] + - constant.string: + start: "\"" + end: "\"" + skip: "\\\\." + rules: + - constant.specialChar: "\\\\." + - constant.string: + start: "'" + end: "'" + skip: "\\\\." + rules: + - constant.specialChar: "\\\\."