Add string group to syntax files

This commit adds the string group (constant.string) to valid strings
in all the syntax files that support colorschemes (see the readme in
the runtime/syntax directory).

Fixes #178
This commit is contained in:
Zachary Yedidia 2016-06-25 19:20:13 -04:00
parent c51c185be6
commit cc9dd00948
11 changed files with 43 additions and 43 deletions

File diff suppressed because one or more lines are too long

View file

@ -26,7 +26,7 @@ color statement "[.:;,+*|=!\%]" "<" ">" "/" "-" "&"
## String highlighting. You will in general want your brightblacks and
## strings to come last, because syntax highlighting rules will be
## applied in the order they are read in.
color constant ""(\\.|[^"])*""
color constant.string ""(\\.|[^"])*""
##
## This string is VERY resource intensive!
#color cyan start=""(\\.|[^"])*\\[[:space:]]*$" end="^(\\.|[^"])*""

View file

@ -62,22 +62,22 @@ color constant "\b(__DATE__|__EOF__|__TIME__|__TIMESTAMP__|__VENDOR__|__VERSION_
## String literals
## TODO: multiline backtick and doublequote string. (Unlikely possible at all with nano.)
### DoubleQuotedString
color constant ""(\\.|[^"])*""
color constant.string ""(\\.|[^"])*""
### WysiwygString
color constant start="r"" end="""
color constant "`[^`]*`"
color constant.string start="r"" end="""
color constant.string "`[^`]*`"
### HexString
color ,constant "x"([[:space:]]*[[:xdigit:]][[:space:]]*[[:xdigit:]])*[[:space:]]*""
color constant.string "x"([[:space:]]*[[:xdigit:]][[:space:]]*[[:xdigit:]])*[[:space:]]*""
### DelimitedString
color constant "q"\(.*\)""
color constant "q"\{.*\}""
color constant "q"\[.*\]""
color constant "q"<.*>""
color constant start="q"[^({[<"][^"]*$" end="^[^"]+""
color constant "q"([^({[<"]).*""
color constant.string "q"\(.*\)""
color constant.string "q"\{.*\}""
color constant.string "q"\[.*\]""
color constant.string "q"<.*>""
color constant.string start="q"[^({[<"][^"]*$" end="^[^"]+""
color constant.string "q"([^({[<"]).*""
### TokenString
### True token strings require nesting, so, again, they can't be implemented accurately here.

View file

@ -4,7 +4,7 @@ syntax "Java" "\.java$"
color type "\b(boolean|byte|char|double|float|int|long|new|short|this|transient|void)\b"
color statement "\b(break|case|catch|continue|default|do|else|finally|for|if|return|switch|throw|try|while)\b"
color type "\b(abstract|class|extends|final|implements|import|instanceof|interface|native|package|private|protected|public|static|strictfp|super|synchronized|throws|volatile)\b"
color constant ""[^"]*""
color constant.string ""[^"]*""
color constant "\b(true|false|null)\b"
color comment "//.*"
color comment start="/\*" end="\*/"

View file

@ -17,4 +17,4 @@ color constant "\\[0-7][0-7]?[0-7]?|\\x[0-9a-fA-F]+|\\[bfnrt'"\?\\]"
color comment "(^|[[:space:]])//.*"
color comment "/\*.+\*/"
color todo "TODO:?"
color constant ""(\\.|[^"])*"|'(\\.|[^'])*'"
color constant.string ""(\\.|[^"])*"|'(\\.|[^'])*'"

View file

@ -52,7 +52,7 @@ color constant "\b([0-9]+)\b"
color statement "(\(|\)|\[|\]|\{|\})"
# Strings
color constant "\"(\\.|[^\\\"])*\"|'(\\.|[^\\'])*'"
color constant.string "\"(\\.|[^\\\"])*\"|'(\\.|[^\\'])*'"
# Multiline strings
color constant start="\s*\[\[" end="\]\]"

View file

@ -33,8 +33,8 @@ color statement "[(){}]" "\[" "\]"
color constant "\b[0-9]+\b"
## strings
color constant "['][^']*[^\\][']" "[']{3}.*[^\\][']{3}"
color constant "["][^"]*[^\\]["]" "["]{3}.*[^\\]["]{3}"
color constant.string "['][^']*[^\\][']" "[']{3}.*[^\\][']{3}"
color constant.string "["][^"]*[^\\]["]" "["]{3}.*[^\\]["]{3}"
## brightblacks
color comment "#.*$"

View file

@ -20,8 +20,8 @@ color constant "[A-Z][A-Z_]+"
color type "[A-Z][a-z]+"
# Strings
color constant "\".*\""
color constant start="\".*\\$" end=".*\""
color constant.string "\".*\""
color constant.string start="\".*\\$" end=".*\""
# NOTE: This isn't accurate but matching "#{0,} for the end of the string is too liberal
color green start="r#+\"" end="\"#+"

View file

@ -22,8 +22,8 @@ color statement "--[a-z-]+"
color statement "\ -[a-z]+"
# Strings
color constant ""(\\.|[^"])*""
color constant "'(\\.|[^'])*'"
color constant.string ""(\\.|[^"])*""
color constant.string "'(\\.|[^'])*'"
color special """
color special "'"
@ -33,4 +33,4 @@ color identifier (i) "\$\{?[0-9A-Z_!@#$*?-]+\}?"
# Comments & TODOs
color comment "(^|[[:space:]])#.*$"
color todo "(TODO|XXX|FIXME):?"
color todo "(TODO|XXX|FIXME):?"

View file

@ -25,7 +25,7 @@ color type "\ (Double|String|Float|Boolean|Dictionary|Array|Int)"
color type "\ (AnyObject)"
# Text
color constant ""[^"]*""
color constant.string ""[^"]*""
# Comments
color comment "//.*"

View file

@ -4,5 +4,5 @@ color identifier "[A-Za-z_][A-Za-z0-9_]*[[:space:]]*[()]"
color statement "\b([nvxsoilc]?(nore|un)?map|[nvlx]n|[ico]?no|[cilovx][um]|s?unm)\b"
color statement "\b(snor|nun|nm|set|if|endif|let|unlet)\b"
color statement "[!&=]"
color constant ""(\\.|[^"])*"|'(\\.|[^'])*'"
color constant.string ""(\\.|[^"])*"|'(\\.|[^'])*'"
color comment "(^|[[:space:]])\"[^"]*$"