Merge pull request #3458 from JoeKar/feature/empty-rules

Remove empty rules in regions
This commit is contained in:
Jöran Karl 2024-09-09 18:48:21 +02:00 committed by GitHub
commit 8c52d2426d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
73 changed files with 11 additions and 145 deletions

View File

@ -258,7 +258,7 @@ func ParseDef(f *File, header *Header) (s *Def, err error) {
if s.rules == nil { if s.rules == nil {
// allow empty rules // allow empty rules
s.rules = new(rules) s.rules = &rules{}
} }
return s, err return s, err
@ -476,10 +476,17 @@ func parseRegion(group string, regionInfo map[interface{}]interface{}, prevRegio
r.limitGroup = r.group r.limitGroup = r.group
} }
r.rules, err = parseRules(regionInfo["rules"].([]interface{}), r) // rules are optional
if rules, ok := regionInfo["rules"]; ok {
r.rules, err = parseRules(rules.([]interface{}), r)
if err != nil {
return nil, err
}
}
if err != nil { if r.rules == nil {
return nil, err // allow empty rules
r.rules = &rules{}
} }
return r, nil return r, nil

View File

@ -371,7 +371,6 @@ highlighted. For example:
start: "\"" start: "\""
end: "\"" end: "\""
skip: "\\." skip: "\\."
rules: []
``` ```
#### Includes #### Includes

View File

@ -47,7 +47,6 @@ function onBufferOpen(buf)
syntaxFile = syntaxFile .. " - special:\n" syntaxFile = syntaxFile .. " - special:\n"
syntaxFile = syntaxFile .. " start: \"@\\\\{\"\n" syntaxFile = syntaxFile .. " start: \"@\\\\{\"\n"
syntaxFile = syntaxFile .. " end: \"\\\\}\"\n" syntaxFile = syntaxFile .. " end: \"\\\\}\"\n"
syntaxFile = syntaxFile .. " rules: []\n"
syntaxFile = syntaxFile .. " - include: " .. codetype .. "\n" syntaxFile = syntaxFile .. " - include: " .. codetype .. "\n"
config.AddRuntimeFileFromMemory(config.RTSyntax, "literate.yaml", syntaxFile) config.AddRuntimeFileFromMemory(config.RTSyntax, "literate.yaml", syntaxFile)

View File

@ -19,5 +19,4 @@ rules:
- comment: - comment:
start: "#" start: "#"
end: "$" end: "$"
rules: []

View File

@ -30,7 +30,6 @@ rules:
- preproc: - preproc:
start: "\\$(\\{|ENV\\{)" start: "\\$(\\{|ENV\\{)"
end: "\\}" end: "\\}"
rules: []
- identifier.macro: "\\b(APPLE|UNIX|WIN32|CYGWIN|BORLAND|MINGW|MSVC(_IDE|60|71|80|90)?)\\b" - identifier.macro: "\\b(APPLE|UNIX|WIN32|CYGWIN|BORLAND|MINGW|MSVC(_IDE|60|71|80|90)?)\\b"

View File

@ -27,12 +27,10 @@ rules:
- constant.string: - constant.string:
start: "`" start: "`"
end: "`" end: "`"
rules: []
- constant.string: - constant.string:
start: "%x\\{" start: "%x\\{"
end: "\\}" end: "\\}"
rules: []
- constant.string: - constant.string:
start: "\"" start: "\""
@ -68,5 +66,4 @@ rules:
- constant: - constant:
start: "<<-?'?EOT'?" start: "<<-?'?EOT'?"
end: "^EOT" end: "^EOT"
rules: []

File diff suppressed because one or more lines are too long

View File

@ -109,13 +109,10 @@ rules:
- comment: - comment:
start: "//" start: "//"
end: "$" end: "$"
rules: []
- comment: - comment:
start: "/\\*" start: "/\\*"
end: "\\*/" end: "\\*/"
rules: []
- comment: - comment:
start: "/\\+" start: "/\\+"
end: "\\+/" end: "\\+/"
rules: []

View File

@ -19,7 +19,6 @@ rules:
- default: - default:
start: "<%" start: "<%"
end: "%>" end: "%>"
rules: []
- preproc: "<%|%>" - preproc: "<%|%>"
- red: "&[^;[[:space:]]]*;" - red: "&[^;[[:space:]]]*;"
@ -37,6 +36,5 @@ rules:
- identifier.macro: - identifier.macro:
start: "<<-?'?EOT'?" start: "<<-?'?EOT'?"
end: "^EOT" end: "^EOT"
rules: []
- todo: "(XXX|TODO|FIXME|\\?\\?\\?)" - todo: "(XXX|TODO|FIXME|\\?\\?\\?)"

View File

@ -22,7 +22,6 @@ rules:
start: "'" start: "'"
end: "'" end: "'"
skip: "\\\\." skip: "\\\\."
rules: []
# - constant.specialChar: "%." # - constant.specialChar: "%."
# - constant.specialChar: "\\\\[abfnrtv'\\\"\\\\]" # - constant.specialChar: "\\\\[abfnrtv'\\\"\\\\]"
# - constant.specialChar: "\\\\([0-7]{3}|x[A-Fa-f0-9]{2}|u[A-Fa-f0-9]{4}|U[A-Fa-f0-9]{8})" # - constant.specialChar: "\\\\([0-7]{3}|x[A-Fa-f0-9]{2}|u[A-Fa-f0-9]{4}|U[A-Fa-f0-9]{8})"
@ -42,4 +41,3 @@ rules:
- comment: - comment:
start: "%" start: "%"
end: "$" end: "$"
rules: []

View File

@ -38,7 +38,6 @@ rules:
start: "'" start: "'"
end: "'" end: "'"
skip: "\\\\." skip: "\\\\."
rules: []
- comment: - comment:
start: "#" start: "#"

View File

@ -19,7 +19,6 @@ rules:
- constant.string: - constant.string:
start: "\\b([Ss.]\" )" start: "\\b([Ss.]\" )"
end: "\"" end: "\""
rules: []
- comment: - comment:
start: "\\(" start: "\\("

View File

@ -45,4 +45,3 @@ rules:
- comment: - comment:
start: "\\(\\*" start: "\\(\\*"
end: "\\*\\)" end: "\\*\\)"
rules: []

View File

@ -10,7 +10,6 @@ rules:
- special: - special:
start: "^```" start: "^```"
end: "^```" end: "^```"
rules: []
# heading lines # heading lines
- special: "^#{1,3}.*" - special: "^#{1,3}.*"
# unordered list items # unordered list items

View File

@ -20,4 +20,3 @@ rules:
- comment: - comment:
start: "#" start: "#"
end: "$" end: "$"
rules: []

View File

@ -22,7 +22,6 @@ rules:
- comment.line: - comment.line:
start: "^#" start: "^#"
end: "$" end: "$"
rules: []
# Diffs (i.e. git commit --verbose) # Diffs (i.e. git commit --verbose)
- default: - default:

View File

@ -11,4 +11,3 @@ rules:
- comment: - comment:
start: "#" start: "#"
end: "$" end: "$"
rules: []

View File

@ -16,4 +16,3 @@ rules:
- comment.line: - comment.line:
start: "^#" start: "^#"
end: "$" end: "$"
rules: []

View File

@ -47,7 +47,6 @@ rules:
- constant.string: - constant.string:
start: "`" start: "`"
end: "`" end: "`"
rules: []
- comment: - comment:
start: "//" start: "//"

View File

@ -44,4 +44,3 @@ rules:
- comment: - comment:
start: "#" start: "#"
end: "$" end: "$"
rules: []

View File

@ -11,7 +11,6 @@ rules:
- constant: - constant:
start: "(\\\\|\\\\\\\\)n\\[" start: "(\\\\|\\\\\\\\)n\\["
end: "]" end: "]"
rules: []
- type: "^\\.[[:space:]]*[^[[:space:]]]*" - type: "^\\.[[:space:]]*[^[[:space:]]]*"
- comment: "^\\.\\\\\".*$" - comment: "^\\.\\\\\".*$"
@ -19,12 +18,10 @@ rules:
- constant.string: - constant.string:
start: "(\\\\|\\\\\\\\)\\*\\[" start: "(\\\\|\\\\\\\\)\\*\\["
end: "]" end: "]"
rules: []
- constant.specialChar: "\\\\\\(.." - constant.specialChar: "\\\\\\(.."
- constant.specialChar: - constant.specialChar:
start: "\\\\\\[" start: "\\\\\\["
end: "]" end: "]"
rules: []
- identifier.macro: "\\\\\\\\\\$[1-9]" - identifier.macro: "\\\\\\\\\\$[1-9]"

View File

@ -75,7 +75,6 @@ rules:
- identifier: - identifier:
start: "[$][{]" start: "[$][{]"
end: "[}]" end: "[}]"
rules: []
# Triple-single-quoted strings # Triple-single-quoted strings
- constant.string: - constant.string:
@ -90,7 +89,6 @@ rules:
- constant.string: - constant.string:
start: "[$]/" start: "[$]/"
end: "/[$]" end: "/[$]"
rules: []
# Single-line comments # Single-line comments
- comment: - comment:
@ -110,4 +108,3 @@ rules:
- comment: - comment:
start: "/[*][*]@?" start: "/[*][*]@?"
end: "[*]/" end: "[*]/"
rules: []

View File

@ -17,7 +17,6 @@ rules:
- default: - default:
start: ">" start: ">"
end: "<" end: "<"
rules: []
- symbol.tag: "<|>" - symbol.tag: "<|>"
- constant.string.url: "(ftp(s)?|http(s)?|git|chrome)://[^ ]+" - constant.string.url: "(ftp(s)?|http(s)?|git|chrome)://[^ ]+"

View File

@ -17,7 +17,6 @@ rules:
- default: - default:
start: ">" start: ">"
end: "<" end: "<"
rules: []
- symbol.tag: "<|>" - symbol.tag: "<|>"
- constant.string.url: "(ftp(s)?|http(s)?|git|chrome)://[^ ]+" - constant.string.url: "(ftp(s)?|http(s)?|git|chrome)://[^ ]+"

View File

@ -28,10 +28,8 @@ rules:
- comment: - comment:
start: "//" start: "//"
end: "$" end: "$"
rules: []
- comment: - comment:
start: "/\\*" start: "/\\*"
end: "\\*/" end: "\\*/"
rules: []

View File

@ -16,4 +16,3 @@ rules:
- comment: - comment:
start: "{#" start: "{#"
end: "#}" end: "#}"
rules: []

View File

@ -75,7 +75,6 @@ rules:
start: "\\|\\|\\| *$" start: "\\|\\|\\| *$"
end: "^ *\\|\\|\\|" end: "^ *\\|\\|\\|"
rules: []
# multi-line comment # multi-line comment
- comment: - comment:

View File

@ -30,7 +30,6 @@ rules:
- constant.string: - constant.string:
start: "\"\"\"" start: "\"\"\""
end: "\"\"\"" end: "\"\"\""
rules: []
- constant.string: - constant.string:
start: "\"" start: "\""
@ -44,14 +43,11 @@ rules:
- constant.string: - constant.string:
start: "'\"" start: "'\""
end: "'" end: "'"
rules: []
- comment: - comment:
start: "#=" start: "#="
end: "=#" end: "=#"
rules: []
- comment: - comment:
start: "#" start: "#"
end: "$" end: "$"
rules: []

View File

@ -37,4 +37,3 @@ rules:
- comment: - comment:
start: "#" start: "#"
end: "$" end: "$"
rules: []

View File

@ -23,5 +23,4 @@ rules:
- comment: - comment:
start: "^!" start: "^!"
end: "$" end: "$"
rules: []

View File

@ -54,14 +54,11 @@ rules:
start: "\"" start: "\""
end: "(\"|$)" end: "(\"|$)"
skip: "\\\\." skip: "\\\\."
rules: []
- constant.string: - constant.string:
start: "'" start: "'"
end: "('|$)" end: "('|$)"
skip: "\\\\." skip: "\\\\."
rules: []
- comment: - comment:
start: "#" start: "#"
end: "$" end: "$"
rules: []

View File

@ -18,9 +18,7 @@ rules:
- comment: - comment:
start: "%\\{" start: "%\\{"
end: "%\\}" end: "%\\}"
rules: []
- comment: - comment:
start: "%" start: "%"
end: "$" end: "$"
rules: []

View File

@ -83,7 +83,6 @@ rules:
- constant.string.url: - constant.string.url:
start: "https?://" start: "https?://"
end: "\\s" end: "\\s"
rules: []
# path # path
# - constant.string.url: "\\b(.+)/([^/]+)\\b" # linux # - constant.string.url: "\\b(.+)/([^/]+)\\b" # linux

View File

@ -45,7 +45,6 @@ rules:
- constant.string: - constant.string:
start: "\\[\\[" start: "\\[\\["
end: "\\]\\]" end: "\\]\\]"
rules: []
# support first few lengths of "long brackets" explicitly # support first few lengths of "long brackets" explicitly
# brackets longer than that will give false positives # brackets longer than that will give false positives
@ -53,22 +52,18 @@ rules:
- constant.string: - constant.string:
start: "\\[=\\[" start: "\\[=\\["
end: "\\]=\\]" end: "\\]=\\]"
rules: []
- constant.string: - constant.string:
start: "\\[==\\[" start: "\\[==\\["
end: "\\]==\\]" end: "\\]==\\]"
rules: []
- constant.string: - constant.string:
start: "\\[===\\[" start: "\\[===\\["
end: "\\]===\\]" end: "\\]===\\]"
rules: []
- constant.string: - constant.string:
start: "\\[====+\\[" start: "\\[====+\\["
end: "\\]====+\\]" end: "\\]====+\\]"
rules: []
- comment.block: - comment.block:
start: "\\-\\-\\[\\[" start: "\\-\\-\\[\\["

View File

@ -18,8 +18,6 @@ rules:
- default: - default:
start: "^\\n\\n" start: "^\\n\\n"
end: ".*" end: ".*"
rules: []
- comment: - comment:
start: "^>.*" start: "^>.*"
end: "$" end: "$"
rules: []

View File

@ -34,5 +34,4 @@ rules:
- comment: - comment:
start: "#" start: "#"
end: "$" end: "$"
rules: []

View File

@ -46,4 +46,3 @@ rules:
- special: - special:
start: "`" start: "`"
end: "`" end: "`"
rules: []

View File

@ -11,13 +11,10 @@ rules:
- comment: - comment:
start: "#" start: "#"
end: "$" end: "$"
rules: []
- comment: - comment:
start: "dnl" start: "dnl"
end: "$" end: "$"
rules: []
- constant.string: - constant.string:
start: "`" start: "`"
end: "'" end: "'"
rules: []

View File

@ -15,7 +15,6 @@ rules:
- constant.string: - constant.string:
start: "'$" start: "'$"
end: "';$" end: "';$"
rules: []
- comment: "(^|[[:space:]])#([^{].*)?$" - comment: "(^|[[:space:]])#([^{].*)?$"
- indent-char.whitespace: "[[:space:]]+$" - indent-char.whitespace: "[[:space:]]+$"

View File

@ -22,6 +22,5 @@ rules:
- comment: - comment:
start: "\\#\\[" start: "\\#\\["
end: "\\]\\#" end: "\\]\\#"
rules: []
- todo: "(TODO|FIXME|XXX):?" - todo: "(TODO|FIXME|XXX):?"

View File

@ -14,19 +14,15 @@ rules:
- constant.string: - constant.string:
start: "\"" start: "\""
end: "\"" end: "\""
rules: []
- constant.string: - constant.string:
start: "''" start: "''"
end: "''" end: "''"
rules: []
- comment: - comment:
start: "#" start: "#"
end: "$" end: "$"
rules: []
- comment: - comment:
start: "/\\*" start: "/\\*"
end: "\\*/" end: "\\*/"
rules: []

View File

@ -94,7 +94,6 @@ rules:
- comment: - comment:
start: "#" start: "#"
end: "$" end: "$"
rules: []
- comment: - comment:
start: "/\\*" start: "/\\*"
end: "\\*/" end: "\\*/"

View File

@ -40,4 +40,3 @@ rules:
- comment: - comment:
start: "\\(\\*" start: "\\(\\*"
end: "\\*\\)" end: "\\*\\)"
rules: []

View File

@ -49,7 +49,6 @@ rules:
- constant.string: - constant.string:
start: "`" start: "`"
end: "`" end: "`"
rules: []
- comment: - comment:
start: "//" start: "//"

View File

@ -12,7 +12,6 @@ rules:
- special: - special:
start: "asm" start: "asm"
end: "end" end: "end"
rules: []
- constant.number: "\\$[0-9A-Fa-f]+" - constant.number: "\\$[0-9A-Fa-f]+"
- constant.number: "\\b[+-]?[0-9]+([.]?[0-9]+)?(?i:e[+-]?[0-9]+)?" - constant.number: "\\b[+-]?[0-9]+([.]?[0-9]+)?(?i:e[+-]?[0-9]+)?"
- constant.string: - constant.string:
@ -29,17 +28,13 @@ rules:
- preproc: - preproc:
start: "{\\$" start: "{\\$"
end: "}" end: "}"
rules: []
- comment: - comment:
start: "//" start: "//"
end: "$" end: "$"
rules: []
- comment: - comment:
start: "\\(\\*" start: "\\(\\*"
end: "\\*\\)" end: "\\*\\)"
rules: []
- comment: - comment:
start: "({)(?:[^$])" start: "({)(?:[^$])"
end: "}" end: "}"
rules: []

View File

@ -28,12 +28,10 @@ rules:
start: "'" start: "'"
end: "'" end: "'"
skip: "\\\\'" skip: "\\\\'"
rules: []
- comment: - comment:
start: "#" start: "#"
end: "$" end: "$"
rules: []
- constant.string: "\"\\(.*\\)\"|qq?\\|.*\\||qq?\\{.*\\}|qq?\\/.*\\/" - constant.string: "\"\\(.*\\)\"|qq?\\|.*\\||qq?\\{.*\\}|qq?\\/.*\\/"
- constant.number: "\\b([0-9]*[.])?[0-9]+" - constant.number: "\\b([0-9]*[.])?[0-9]+"
@ -45,14 +43,11 @@ rules:
- preproc: - preproc:
start: "(^use| = new)" start: "(^use| = new)"
end: ";" end: ";"
rules: []
- comment: - comment:
start: "^=" start: "^="
end: "^=cut" end: "^=cut"
rules: []
- identifier.macro: - identifier.macro:
start: "<< 'STOP'" start: "<< 'STOP'"
end: "STOP" end: "STOP"
rules: []

View File

@ -40,11 +40,9 @@ rules:
- comment: - comment:
start: "(^|[[:space:]])*(//|#)" start: "(^|[[:space:]])*(//|#)"
end: "$" end: "$"
rules: []
- comment: - comment:
start: "/\\*" start: "/\\*"
end: "\\*/" end: "\\*/"
rules: []
- constant.string: - constant.string:
start: "\"" start: "\""

View File

@ -26,12 +26,10 @@ rules:
- comment: - comment:
start: "\"\"\"[^\"]*" start: "\"\"\"[^\"]*"
end: "\"\"\"" end: "\"\"\""
rules: []
- comment: "(^|[[:space:]])//.*" - comment: "(^|[[:space:]])//.*"
- comment: - comment:
start: "/\\*" start: "/\\*"
end: "\\*/" end: "\\*/"
rules: []
- todo: "TODO:?" - todo: "TODO:?"

View File

@ -17,5 +17,4 @@ rules:
- comment: - comment:
start: "/\\*" start: "/\\*"
end: "\\*/" end: "\\*/"
rules: []

View File

@ -32,12 +32,10 @@ rules:
- constant.string: - constant.string:
start: "\"\"\"" start: "\"\"\""
end: "\"\"\"" end: "\"\"\""
rules: []
- constant.string: - constant.string:
start: "'''" start: "'''"
end: "'''" end: "'''"
rules: []
- constant.string: - constant.string:
start: "\"" start: "\""
@ -56,5 +54,4 @@ rules:
- comment: - comment:
start: "#" start: "#"
end: "$" end: "$"
rules: []

View File

@ -34,12 +34,10 @@ rules:
- constant.string: - constant.string:
start: "\"\"\"" start: "\"\"\""
end: "\"\"\"" end: "\"\"\""
rules: []
- constant.string: - constant.string:
start: "'''" start: "'''"
end: "'''" end: "'''"
rules: []
- constant.string: - constant.string:
start: "\"" start: "\""

View File

@ -29,14 +29,11 @@ rules:
- preproc: - preproc:
start: "(^use| = new)" start: "(^use| = new)"
end: ";" end: ";"
rules: []
- identifier.macro: - identifier.macro:
start: "<<EOSQL" start: "<<EOSQL"
end: "EOSQL" end: "EOSQL"
rules: []
- comment: - comment:
start: "#" start: "#"
end: "$" end: "$"
rules: []

View File

@ -14,7 +14,6 @@ rules:
- preproc: - preproc:
start: "^(Source|Patch)" start: "^(Source|Patch)"
end: ":" end: ":"
rules: []
- preproc: "(i386|i486|i586|i686|athlon|ia64|alpha|alphaev5|alphaev56|alphapca56|alphaev6|alphaev67|sparc|sparcv9|sparc64armv3l|armv4b|armv4lm|ips|mipsel|ppc|ppc|iseries|ppcpseries|ppc64|m68k|m68kmint|Sgi|rs6000|i370|s390x|s390|noarch)" - preproc: "(i386|i486|i586|i686|athlon|ia64|alpha|alphaev5|alphaev56|alphapca56|alphaev6|alphaev67|sparc|sparcv9|sparc64armv3l|armv4b|armv4lm|ips|mipsel|ppc|ppc|iseries|ppcpseries|ppc64|m68k|m68kmint|Sgi|rs6000|i370|s390x|s390|noarch)"
- preproc: "(ifarch|ifnarch|ifos|ifnos)" - preproc: "(ifarch|ifnarch|ifos|ifnos)"
@ -24,12 +23,10 @@ rules:
- statement: - statement:
start: "%\\{" start: "%\\{"
end: "\\}" end: "\\}"
rules: []
- statement: - statement:
start: "%\\{__" start: "%\\{__"
end: "\\}" end: "\\}"
rules: []
- statement: "\\$(RPM_BUILD_ROOT)\\>" - statement: "\\$(RPM_BUILD_ROOT)\\>"
- special: "^%(build$|changelog|check$|clean$|description)" - special: "^%(build$|changelog|check$|clean$|description)"

View File

@ -30,7 +30,6 @@ rules:
start: "'" start: "'"
end: "'" end: "'"
skip: "\\\\." skip: "\\\\."
rules: []
- constant.string: - constant.string:
start: "\"" start: "\""
@ -63,6 +62,5 @@ rules:
- constant.macro: - constant.macro:
start: "<<-?'?EOT'?" start: "<<-?'?EOT'?"
end: "^EOT" end: "^EOT"
rules: []
- preproc.shebang: "^#!.+?( |$)" - preproc.shebang: "^#!.+?( |$)"

View File

@ -31,22 +31,18 @@ rules:
- constant.string: - constant.string:
start: "[bc]?r#\"" start: "[bc]?r#\""
end: "\"#" end: "\"#"
rules: []
- constant.string: - constant.string:
start: "[bc]?r##\"" start: "[bc]?r##\""
end: "\"##" end: "\"##"
rules: []
- constant.string: - constant.string:
start: "[bc]?r###\"" start: "[bc]?r###\""
end: "\"###" end: "\"###"
rules: []
- constant.string: - constant.string:
start: "[bc]?r####+\"" start: "[bc]?r####+\""
end: "\"####+" end: "\"####+"
rules: []
# Character literals # Character literals
# NOTE: This is an ugly hack to work around the fact that rust uses # NOTE: This is an ugly hack to work around the fact that rust uses
@ -58,7 +54,6 @@ rules:
- constant.string: - constant.string:
start: "'\"" start: "'\""
end: "'" end: "'"
rules: []
- comment: - comment:
start: "//" start: "//"
@ -75,4 +70,3 @@ rules:
- special: - special:
start: "#!\\[" start: "#!\\["
end: "\\]" end: "\\]"
rules: []

View File

@ -32,12 +32,10 @@ rules:
- comment: - comment:
start: "\"\"\"" start: "\"\"\""
end: "\"\"\"" end: "\"\"\""
rules: []
- comment: - comment:
start: "'''" start: "'''"
end: "'''" end: "'''"
rules: []
- constant.string: - constant.string:
start: "\"" start: "\""
@ -56,5 +54,4 @@ rules:
- comment: - comment:
start: "#" start: "#"
end: "$" end: "$"
rules: []

View File

@ -28,7 +28,6 @@ rules:
- preproc: - preproc:
start: "^ *(use|include) <" start: "^ *(use|include) <"
end: ">;?" end: ">;?"
rules: []
- constant.number: "\\b[-+]?[0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?|PI|inf|nan\\b" - constant.number: "\\b[-+]?[0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?|PI|inf|nan\\b"
- constant.bool: "\\b(true|false)\\b" - constant.bool: "\\b(true|false)\\b"

View File

@ -10,7 +10,6 @@ rules:
- constant.string: - constant.string:
start: "\"\"\"" start: "\"\"\""
end: "\"\"\"" end: "\"\"\""
rules: []
- constant.string: - constant.string:
start: "\"" start: "\""
end: "\"" end: "\""
@ -21,13 +20,10 @@ rules:
- comment: - comment:
start: "//" start: "//"
end: "$" end: "$"
rules: []
- comment: - comment:
start: "/\\*" start: "/\\*"
end: "\\*/" end: "\\*/"
rules: []
- comment: - comment:
start: "/\\*\\*" start: "/\\*\\*"
end: "\\*/" end: "\\*/"
rules: []

View File

@ -48,19 +48,16 @@ rules:
start: "\"" start: "\""
end: "\"" end: "\""
skip: "\\\\." skip: "\\\\."
rules: []
- constant.string: - constant.string:
start: "'" start: "'"
end: "'" end: "'"
skip: "\\\\." skip: "\\\\."
rules: []
- constant.string: - constant.string:
start: "<<[^\\s]+[-~.]*[A-Za-z0-9]+$" start: "<<[^\\s]+[-~.]*[A-Za-z0-9]+$"
end: "^[^\\s]+[A-Za-z0-9]+$" end: "^[^\\s]+[A-Za-z0-9]+$"
skip: "\\\\." skip: "\\\\."
rules: []
- comment: - comment:
start: "(^|\\s)#" start: "(^|\\s)#"

View File

@ -18,7 +18,6 @@ rules:
start: "'" start: "'"
end: "'" end: "'"
skip: "\\\\." skip: "\\\\."
rules: []
- constant.string: - constant.string:
start: "\"" start: "\""
@ -50,6 +49,5 @@ rules:
- constant.macro: - constant.macro:
start: "<<-?'?EOT'?" start: "<<-?'?EOT'?"
end: "^EOT" end: "^EOT"
rules: []
- preproc.shebang: "^#!.+?( |$)" - preproc.shebang: "^#!.+?( |$)"

View File

@ -20,11 +20,9 @@ rules:
- comment: - comment:
start: "//" start: "//"
end: "$" end: "$"
rules: []
- comment: - comment:
start: "/\\*" start: "/\\*"
end: "\\*/" end: "\\*/"
rules: []
- todo: "TODO:?" - todo: "TODO:?"
- constant.string: - constant.string:
start: "\"" start: "\""

View File

@ -11,7 +11,6 @@ rules:
- identifier.macro: - identifier.macro:
start: "`" start: "`"
end: "'" end: "'"
rules: []
- identifier.macro: "\\$\\w+" - identifier.macro: "\\$\\w+"
- constant.specialChar: "\\\\." - constant.specialChar: "\\\\."
@ -22,7 +21,6 @@ rules:
- identifier.macro: - identifier.macro:
start: "`" start: "`"
end: "'" end: "'"
rules: []
- identifier.macro: "\\$\\w+" - identifier.macro: "\\$\\w+"
- constant.specialChar: "\\\\." - constant.specialChar: "\\\\."
@ -46,7 +44,6 @@ rules:
- identifier.macro: - identifier.macro:
start: "`" start: "`"
end: "'" end: "'"
rules: []
- comment: - comment:
start: "///?" start: "///?"

View File

@ -149,7 +149,6 @@ func generateFile(filetype, syntax, header string, rules []interface{}) string {
output += fmt.Sprintf(" - %s:\n", rule.color) output += fmt.Sprintf(" - %s:\n", rule.color)
output += fmt.Sprintf(" start: \"%s\"\n", strings.Replace(strings.Replace(rule.start, "\\", "\\\\", -1), "\"", "\\\"", -1)) output += fmt.Sprintf(" start: \"%s\"\n", strings.Replace(strings.Replace(rule.start, "\\", "\\\\", -1), "\"", "\\\"", -1))
output += fmt.Sprintf(" end: \"%s\"\n", strings.Replace(strings.Replace(rule.end, "\\", "\\\\", -1), "\"", "\\\"", -1)) output += fmt.Sprintf(" end: \"%s\"\n", strings.Replace(strings.Replace(rule.end, "\\", "\\\\", -1), "\"", "\\\"", -1))
output += fmt.Sprintf(" rules: []\n\n")
} }
} }

View File

@ -8,11 +8,9 @@ rules:
- identifier: - identifier:
start: "\\{" start: "\\{"
end: "\\}" end: "\\}"
rules: []
- identifier: - identifier:
start: "\\[" start: "\\["
end: "\\]" end: "\\]"
rules: []
# numbers # numbers
- constant.number: "\\b[0-9]+(\\.[0-9]+)?([[:space:]](pt|mm|cm|in|ex|em|bp|pc|dd|cc|nd|nc|sp))?\\b" - constant.number: "\\b[0-9]+(\\.[0-9]+)?([[:space:]](pt|mm|cm|in|ex|em|bp|pc|dd|cc|nd|nc|sp))?\\b"
# let brackets have the default color again # let brackets have the default color again
@ -25,8 +23,6 @@ rules:
- comment: - comment:
start: "[^\\\\]%|^%" start: "[^\\\\]%|^%"
end: "$" end: "$"
rules: []
- comment: - comment:
start: "\\\\begin\\{comment\\}" start: "\\\\begin\\{comment\\}"
end: "\\\\end\\{comment\\}" end: "\\\\end\\{comment\\}"
rules: []

View File

@ -27,11 +27,9 @@ rules:
- constant.string: - constant.string:
start: "'''" start: "'''"
end: "'{3,5}" end: "'{3,5}"
rules: []
- constant.string: - constant.string:
start: "'" start: "'"
end: "'" end: "'"
rules: []
# Integer # Integer
- constant.number: '[+-]?(\d+_)*\d+\b' - constant.number: '[+-]?(\d+_)*\d+\b'
- constant.number: '(0x([[:xdigit:]]+_)*[[:xdigit:]]+|0o([0-7]_)*[0-7]+|0b([01]+_)*[01]+)' - constant.number: '(0x([[:xdigit:]]+_)*[[:xdigit:]]+|0o([0-7]_)*[0-7]+|0b([01]+_)*[01]+)'

View File

@ -52,4 +52,3 @@ rules:
- comment: - comment:
start: "\\{#" start: "\\{#"
end: "#\\}" end: "#\\}"
rules: []

View File

@ -23,7 +23,6 @@ rules:
- comment: - comment:
start: "//" start: "//"
end: "$" end: "$"
rules: []
- comment: - comment:
start: "/\\*" start: "/\\*"
end: "\\*/" end: "\\*/"

View File

@ -65,7 +65,6 @@ rules:
- constant.string: - constant.string:
start: "`" start: "`"
end: "`" end: "`"
rules: []
- comment: - comment:
start: "//" start: "//"

View File

@ -19,7 +19,6 @@ rules:
- comment: - comment:
start: "/\\*" start: "/\\*"
end: "\\*/" end: "\\*/"
rules: []
- todo: "TODO:?" - todo: "TODO:?"
- indent-char.whitespace: "[[:space:]]+$" - indent-char.whitespace: "[[:space:]]+$"

View File

@ -14,7 +14,6 @@ rules:
- comment: - comment:
start: "(^\"|[ \t]+\" |[ \t]+\"$)" start: "(^\"|[ \t]+\" |[ \t]+\"$)"
end: "$" end: "$"
rules: []
- constant.string: - constant.string:
start: "\"" start: "\""

View File

@ -27,7 +27,6 @@ rules:
- comment.block: - comment.block:
start: "<!\\-\\-" start: "<!\\-\\-"
end: "\\-\\->" end: "\\-\\->"
rules: []
# Bootstrap # Bootstrap
- symbol.tag.extended: "(?i)<[/]?(b-alert|b-aspect|b-avatar|b-badge|b-icon|b-breadcrumb|b-button-group|b-button-toolbar|b-button|b-calendar|b-card-text|b-card-input|b-card|b-carousel-slide|b-carousel|b-collapse|b-dropdown|b-dropdown-item|b-dropdown-divider|b-embed|b-form-checkbox-group|b-form-checkbox|b-form-datepicker|b-form-file|b-form-group|b-form-input|b-form-radio|b-form-rating|b-form-select|b-form-spinbutton|b-form-tags|b-form-textarea|b-form|b-form-timepicker|b-img-lazy|b-img|b-input-group|b-jumbotron|b-input|b-container|b-row|b-col|b-link|b-list-group|b-list-group-item|b-media|b-modal|b-nav|b-nav-item|b-nav-item-dropdown|b-nav-text|b-nav-form|b-navbar|b-navbar-brand|b-navbar-toggle|b-navbar-nav|b-overlay|b-pagination|b-pagination-nav|b-popover|b-progress|b-progress-bar|b-sidebar|b-skeleton-wrapper|b-skeleton|b-spinner|b-table|b-table-lite|b-table-simple|b-tabs|b-tab|b-time|b-toast|b-tooltip)\\b" - symbol.tag.extended: "(?i)<[/]?(b-alert|b-aspect|b-avatar|b-badge|b-icon|b-breadcrumb|b-button-group|b-button-toolbar|b-button|b-calendar|b-card-text|b-card-input|b-card|b-carousel-slide|b-carousel|b-collapse|b-dropdown|b-dropdown-item|b-dropdown-divider|b-embed|b-form-checkbox-group|b-form-checkbox|b-form-datepicker|b-form-file|b-form-group|b-form-input|b-form-radio|b-form-rating|b-form-select|b-form-spinbutton|b-form-tags|b-form-textarea|b-form|b-form-timepicker|b-img-lazy|b-img|b-input-group|b-jumbotron|b-input|b-container|b-row|b-col|b-link|b-list-group|b-list-group-item|b-media|b-modal|b-nav|b-nav-item|b-nav-item-dropdown|b-nav-text|b-nav-form|b-navbar|b-navbar-brand|b-navbar-toggle|b-navbar-nav|b-overlay|b-pagination|b-pagination-nav|b-popover|b-progress|b-progress-bar|b-sidebar|b-skeleton-wrapper|b-skeleton|b-spinner|b-table|b-table-lite|b-table-simple|b-tabs|b-tab|b-time|b-toast|b-tooltip)\\b"

View File

@ -8,12 +8,10 @@ rules:
- preproc: - preproc:
start: "<!DOCTYPE" start: "<!DOCTYPE"
end: "[/]?>" end: "[/]?>"
rules: []
- comment: - comment:
start: "<!--" start: "<!--"
end: "-->" end: "-->"
rules: []
- symbol.tag: - symbol.tag:
start: "<\\??" start: "<\\??"
@ -22,7 +20,6 @@ rules:
- identifier: - identifier:
start: " " start: " "
end: "=" end: "="
rules: []
- constant.string: - constant.string:
start: "\"" start: "\""
end: "\"" end: "\""

View File

@ -43,10 +43,8 @@ rules:
- constant.string: - constant.string:
start: "'" start: "'"
end: "'" end: "'"
rules: []
- comment: - comment:
start: "(^|\\s)#" start: "(^|\\s)#"
end: "$" end: "$"
rules: []