From 36862137db8a0ebb91560fce5aaf5aedefe7d0ee Mon Sep 17 00:00:00 2001 From: ariasuni Date: Sat, 12 Jan 2019 17:00:20 +0100 Subject: [PATCH] Improve XML character entities highlighting and comment --- cmd/micro/runtime.go | 4 ++-- runtime/syntax/html.yaml | 2 +- runtime/syntax/xml.yaml | 11 +++-------- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/cmd/micro/runtime.go b/cmd/micro/runtime.go index 8460f531..8b4f0b71 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\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") +var _runtimeSyntaxHtmlYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xa4\x54\x4d\x6f\xdb\x46\x10\x3d\x57\xbf\x82\xa1\x8b\x62\x37\x8e\xe4\x06\x28\x02\x94\x55\x4c\x14\x69\x7b\x6d\x0f\xbd\x14\x34\x0d\x2c\x77\x87\xe4\x56\xfb\xc1\xec\x0e\x15\xab\x79\xf9\xef\x05\x25\x3b\x96\x11\xb7\x28\x50\x41\x58\x08\x6f\x46\x33\x6f\xbe\x5e\x6f\x1d\xf1\x61\xa2\xaa\x18\xd9\xbb\xd5\xca\x10\x93\xe6\x6a\x55\x14\x45\xb1\xd8\x82\xf2\x54\x15\xe5\xcd\xcd\x66\x64\xdf\xb8\xb6\xfe\xba\x5c\xad\xd2\xec\x28\x9f\x7c\xd6\x05\xa5\x14\x53\x55\x94\xdb\xe6\xf6\x45\xbb\x79\x59\x5f\x97\xf7\x86\x7c\xf0\x5d\x74\x1b\x56\x43\x55\x94\xa2\xb6\x72\xdb\x5c\xb5\xb5\x50\xa2\xeb\x12\x74\x8a\xe1\xe0\x61\x4c\xa2\x9c\x31\x4d\x8e\x18\x89\x14\x12\x5b\xed\x08\xd9\x1a\xc2\x6c\x6c\x94\x35\x3a\xa1\x32\x89\x3e\x06\x96\x35\x8c\xb0\x88\x12\x76\x80\x8b\x7a\xf7\x7e\x8e\x4c\x48\xb2\x86\x56\x22\xec\x55\xc6\xc4\x36\x06\x09\x4d\x81\x29\x41\x5b\x26\xe8\x28\x0c\xc1\xc1\x0d\x29\xce\x93\x84\x11\x8a\x95\x70\x36\x1f\xe3\x81\x1c\x88\x95\x75\x19\x7d\x80\x55\x2e\x0e\xb0\x09\x0e\x2c\x41\x5e\x74\x64\x64\x8d\xde\x92\x33\x99\x18\xbd\x1d\x84\x56\xc7\x24\x98\x13\x49\x2c\xb4\xd0\xc7\xe4\x21\xac\xac\xfb\xa4\x3c\xe1\xf8\x2e\xde\x63\xf3\x7a\xfd\xa6\xc5\x98\x60\x61\xfd\x00\x1b\xc4\x34\x33\xb2\xc4\xae\x33\xd8\xd1\x61\xa0\x00\xa7\x3a\x72\x70\x34\x50\x30\x70\x56\x84\x9d\xac\xe1\x95\xb0\x01\x13\xd2\x4e\xc2\x53\x98\x85\x65\xf2\x0b\x4e\x2c\x14\x28\x49\x04\xb5\x47\x88\xe2\x94\x0b\x59\x27\x3b\xb1\x44\x14\x0e\x13\x8b\x63\xa5\x38\x76\x62\xe6\x69\x66\x89\x49\xa8\xa4\x3c\xac\xe6\x39\x11\x96\x6f\x1c\x96\xd6\xcb\x1a\xef\x91\xc4\x04\xc6\xdc\x1d\x24\xb2\xe0\x64\x77\x24\x6b\x64\xe5\x27\x64\x12\xfa\x58\xac\x23\xcd\x12\xd9\x2b\xe7\x90\xe3\x9c\x34\x21\x4f\x2a\x20\x73\x8a\x61\x40\x9e\x45\x87\x09\xde\xab\x74\x90\x60\xba\x63\xb5\x4c\x93\xad\x27\x70\x52\x7a\x87\x59\x38\x59\x63\xaf\x12\xf6\xd6\x50\xc4\x87\x2e\x49\x51\x6c\x5e\xe2\x5a\x3e\xbb\x33\x1b\xba\x63\x0a\x86\xcc\x93\xe5\xe9\xa2\x39\xc0\xd8\x3d\x96\x6d\xc5\x48\xca\x08\x5a\xc6\xdf\xc7\xb8\xcc\x9b\x2d\x3b\x02\xab\x6e\x79\xef\x9d\x31\x0a\x52\xcb\x10\xd3\xd1\x4b\x1e\xb3\x3e\xc9\x39\x91\xb6\xca\x55\x45\xf9\x8d\xb8\x68\x9a\xca\xd8\xc1\x72\xd5\xb6\x1f\x5f\xbf\xfa\xee\x13\x2e\xee\x9a\xa6\xba\x7b\x8a\x35\xb7\x4d\x53\xe5\x49\x69\xaa\xda\xb6\xbd\x94\x3f\x3c\xa5\x5f\x15\x65\x53\xbd\x6d\x1f\x40\x6b\x28\xb0\xed\x2d\x2d\x57\x22\x94\x63\x74\x83\x8e\x2e\x26\x8c\x64\x87\x91\x31\x26\xea\x61\xcd\xc3\x26\xc4\x30\x18\xca\x1a\xcb\xe9\x21\x06\xa1\x9d\xd5\x3b\xf4\x51\xcf\x19\x2e\x2a\x03\x1f\xe7\x4c\x71\xbf\x6c\x41\xb6\x7f\x3d\x0c\x22\x69\xb0\x4a\x03\x31\x96\x7b\xc6\x5e\xb9\x99\xf0\xc1\x1a\x1e\xe5\xdb\x07\x2a\x3a\x86\xcc\x2a\xf0\x26\xcc\xbe\x3b\xf1\xa9\xad\xbc\x68\xbe\x5d\x7f\xff\xe3\xfa\x97\xf6\xe3\x9b\x57\x6f\x3e\x9d\x7c\x2f\x8a\x75\x61\xa8\x57\xb3\xbb\x17\x83\x8b\xe5\x29\x32\xab\xc4\x55\x51\x5e\x97\x67\x20\x85\x65\x48\xdb\x73\xe8\xa4\x10\x45\xd3\xae\x9e\x13\x83\x2d\xae\xbf\x60\x94\x39\xd9\x30\x6c\xe6\xb4\xb4\x4f\xf4\x3c\x89\x65\x37\x47\xbe\xff\x31\x58\x86\x1e\x53\xf4\x24\xab\xab\xab\xe6\xb6\xf8\xaa\xbd\x7c\x8c\xe1\x3d\x85\x85\xd6\xf6\xc5\x7a\xbd\xb9\xac\xd7\xeb\xcf\xf1\xa7\x44\x53\x8a\xfa\x68\xfb\xe9\xd7\x77\xbf\xff\xf1\xdb\xcf\x9b\xcb\x65\xf6\xcf\xe7\x3f\xd5\x7a\x5e\xe9\x4d\x59\x7e\xc6\x4e\x85\x9e\x23\x79\x67\xa7\xa3\x3c\xde\xdc\x6c\x1e\xd1\x33\x7d\x7c\xf8\x9c\x67\x3a\xed\xdb\xbb\x51\xa5\xc7\xbf\xde\xd3\x79\xd2\xf2\x73\x1a\xdb\xd3\x85\x3f\xea\xeb\x59\xe3\xaf\x9e\xb3\x39\xeb\x2d\xaf\x8f\x42\x50\x9d\x75\xff\xdf\x39\xda\xa0\xdd\x6c\x16\xc1\xff\x53\xed\xd5\x29\xec\x7f\xe1\xc6\x07\x47\xff\x40\xed\x4b\xd3\xff\x64\xa6\x73\x2e\x57\x7f\x07\x00\x00\xff\xff\xfc\x0e\x0e\x32\xb7\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\xb4\x91\xcb\x4e\xeb\x30\x10\x86\xf7\x79\x8a\x39\xd6\x11\x37\x29\x61\x1f\x2e\x59\x14\xd6\xb0\x60\x83\x3a\x5d\x98\x64\x9a\x5a\xd8\x8e\x65\x0f\x28\x95\xf2\xf0\x28\x35\x14\x9a\x4b\x25\x16\x64\x37\xf3\xc7\xdf\xff\x59\x5e\x2b\x4d\xbc\x75\x94\x43\x6b\x74\x92\x54\xc4\x54\x72\x9e\x00\x00\xf4\x91\x95\x86\x72\x10\x88\xd9\x59\x6b\x74\x17\x6a\xa3\x8b\xce\xdb\xba\x0b\xef\x75\xe7\xb4\x0a\x7c\xfe\x5f\xec\xfe\xde\x90\xac\xc8\xe7\x20\xae\x11\x8b\xd6\xe8\xec\x02\xb1\xb8\x15\x49\xe2\xdf\x34\x85\x48\x4c\xc1\x79\x72\xbe\x29\xe3\xd8\x7f\x81\xa5\xe7\xfe\xd4\xbf\xbb\x87\xc5\xd3\xf3\xe3\xbd\xd8\x47\x64\xab\x1c\xc4\xf2\x72\xd5\x63\xbe\x96\x91\x06\xcb\xd5\x27\xb0\x6c\x8c\x21\xcb\x53\xc0\x34\x1d\xb2\xd2\xf4\x08\x29\x38\x2a\x95\xd4\x63\xd2\xc9\x10\x73\x75\x04\xb2\x35\x2f\x8d\xce\x58\xd6\x13\x46\x88\x45\x31\x64\xf5\xbb\x91\xd4\x7e\x8c\x50\x55\x91\x65\xb5\x56\xe4\x0f\x93\x9f\x70\x10\xa3\x28\x16\xdc\x8c\x83\x43\xe9\xef\x9e\xb2\xb1\x81\xa5\xe5\x2c\xb0\x57\xb6\x9e\x2f\x43\x31\xd7\x36\x95\x84\x57\xe5\x76\x37\x45\xcc\xe6\x64\x46\xeb\xa1\x51\x7c\x9c\xc5\x46\xfa\x69\xd4\x2f\xec\x4f\xe7\xe4\x27\x82\x3f\x73\xff\x08\x00\x00\xff\xff\x33\x9b\x36\xf4\x78\x03\x00\x00") +var _runtimeSyntaxXmlYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xb4\x91\xcd\x6e\xd5\x30\x10\x85\xf7\x79\x8a\xc1\x17\x41\x4b\x49\x10\x12\x2b\xf3\x93\x45\x61\x0d\x0b\x36\xc8\x0e\x92\x71\xe6\x3a\x56\xfd\x13\xd9\x03\x4d\x45\x90\x78\x0d\x5e\x8f\x27\x41\x69\x6e\x0b\xb7\x49\x16\x2c\x9a\x9d\xe7\x4c\xbe\x73\x7c\xbc\xb7\x0e\xe9\xaa\x47\x0e\x83\x77\x45\xd1\x22\xa1\x26\x5e\x00\x00\x4c\x52\x50\x1e\x39\x30\x29\xab\x93\xc1\xbb\x31\x1b\xef\xea\x31\x05\x33\xe6\x6f\x66\xec\x9d\xcd\x74\xfa\x90\x5d\x6f\x77\xa8\x5a\x4c\x1c\xd8\x2b\x29\xeb\xc1\xbb\xea\x89\x94\xf5\x1b\x56\x14\xe9\xab\xc3\x3c\x13\x4b\xe8\x13\xf6\x29\xea\xf9\x38\x7d\x99\x54\xa2\xe9\xaf\x07\x6f\xdf\x9f\x7f\xfc\xf4\xe1\x1d\xbb\x95\x30\xb4\x1c\x98\x78\xd6\x4c\x98\x9b\xe1\x4c\x03\xd1\x1c\x80\x3a\x7a\x8f\x61\x26\x94\x65\x75\x56\x97\xe5\x61\x7b\x07\x01\x07\x02\x67\x03\xc2\x3e\x26\xe8\xac\xe9\x9c\x35\x1d\xd9\x60\x20\xee\x41\x77\x2a\x29\x4d\x98\x00\x03\x59\xb2\x98\xa1\x8d\x98\xc3\xef\x9f\xbf\x08\x2e\x63\xba\x00\x95\xa7\xbd\x10\x2f\x0f\x5e\xb9\x47\x6d\x95\xe3\xc0\x1e\x9d\xec\x84\xe0\xad\x35\x96\x78\xd3\x7c\x7f\xfe\xf4\xc5\x8f\x71\x37\x08\xc1\x87\xe3\x99\xf8\x2c\x04\xcf\xbd\xd2\xc8\x9b\xa6\x39\x3b\x7d\xc9\x6e\x50\x57\xfe\x4b\x74\x15\x29\xb3\x52\x85\x94\x75\x7d\xb7\x86\x69\xb6\xa8\xe1\xf6\x38\x43\x6d\x3b\xdd\x64\x6f\x31\x1d\x2b\xff\xc2\x81\x2d\xa4\xd9\xe0\xf5\x52\x38\xee\xfa\xaf\x8f\x8e\x21\x93\x0a\x54\x65\x4a\x36\x98\x6d\x33\xc9\xb6\xdc\xd6\x94\x7c\x61\xfb\xeb\x9b\x4a\x59\x6d\x85\x59\x8c\xef\x26\x9a\x9f\xe8\xbc\x53\x69\x1d\xf5\x1f\xe9\x1f\x6f\x85\x5f\x11\xee\x2d\xfb\x9f\x00\x00\x00\xff\xff\x72\x69\xe2\x4b\xa0\x03\x00\x00") func runtimeSyntaxXmlYamlBytes() ([]byte, error) { return bindataRead( diff --git a/runtime/syntax/html.yaml b/runtime/syntax/html.yaml index 347201cd..5ca4d7e7 100644 --- a/runtime/syntax/html.yaml +++ b/runtime/syntax/html.yaml @@ -7,7 +7,7 @@ rules: - error: "<[^!].*?>" - symbol.tag: "(?i)<[/]?(a(bbr|cronym|ddress|pplet|rea|rticle|side|udio)?|b(ase(font)?|d(i|o)|ig|lockquote|r)?|ca(nvas|ption)|center|cite|co(de|l|lgroup)|d(ata(list)?|d|el|etails|fn|ialog|ir|l|t)|em(bed)?|fieldset|fig(caption|ure)|font|form|(i)?frame|frameset|h[1-6]|hr|i|img|in(put|s)|kbd|keygen|label|legend|li(nk)?|ma(in|p|rk)|menu(item)?|met(a|er)|nav|no(frames|script)|o(l|pt(group|ion)|utput)|p(aram|icture|re|rogress)?|q|r(p|t|uby)|s(trike)?|samp|se(ction|lect)|small|source|span|strong|su(b|p|mmary)|textarea|time|track|u(l)?|var|video|wbr)( .*|>)*?>" - symbol.tag.extended: "(?i)<[/]?(body|div|html|head(er)?|footer|title|table|t(body|d|h(ead)?|r|foot))( .*)*?>" - - special: "&[^;[[:space:]]]*;" + - special: "&(#[[:digit:]]{1,4}|#x[[:xdigit:]]{1,4}|[^[[:space:]]]+);" - symbol: "[:=]" - identifier: "(alt|bgcolor|height|href|id|label|longdesc|name|on(click|focus|load|mouseover)|size|span|src|target|type|value|width)=" - constant.number: "(?i)#[0-9A-F]{6,6}" diff --git a/runtime/syntax/xml.yaml b/runtime/syntax/xml.yaml index 0386d8da..00f4406e 100644 --- a/runtime/syntax/xml.yaml +++ b/runtime/syntax/xml.yaml @@ -9,14 +9,9 @@ rules: start: "" rules: [] - - comment: - start: "" - rules: [] - - special: - start: "&" - end: ";" - rules: [] + - comment: "" + # next line for highlighting of character entities doesn’t work as of now + - special: "&(#[[:digit:]]{1,4}|#x[[:xdigit:]]{1,4}|[^[[:space:]]]+);" - symbol.tag: start: "<\\??" end: "\\??>"