Cache syntax highlighting rules

This commit is contained in:
Zachary Yedidia
2016-03-23 16:36:17 -04:00
parent e2f25947cc
commit a35af11924
6 changed files with 55 additions and 47 deletions

View File

@@ -95,7 +95,7 @@ color brightyellow "\b(setup|loop)\b"
color brightcyan "^[[:space:]]*#[[:space:]]*(define|include(_next)?|(un|ifn?)def|endif|el(if|se)|if|warning|error|pragma)"
##
color brightmagenta "'([^'\]|(\\["'abfnrtv\\]))'" "'\\(([0-3]?[0-7]{1,2}))'" "'\\x[0-9A-Fa-f]{1,2}'"
color brightmagenta "'([^'\\]|(\\["'abfnrtv\\]))'" "'\\(([0-3]?[0-7]{1,2}))'" "'\\x[0-9A-Fa-f]{1,2}'"
## GCC builtins
color cyan "__attribute__[[:space:]]*\(\([^)]*\)\)" "__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__"

View File

@@ -16,7 +16,7 @@ color brightblue "\b(split|sprintf|strtonum|sub|substr|tolower|toupper)\b"
color brightblue "\b(mktime|strftime|systime)\b"
color brightblue "\b(and|compl|lshift|or|rshift|xor)\b"
color brightblue "\b(bindtextdomain|dcgettext|dcngettext)\b"
color magenta "/.*[^\]/"
color magenta "/.*[^\\]/"
color yellow ""(\\.|[^"])*"|'(\\.|[^'])*'"
color magenta "\\."
color brightblack "(^|[[:space:]])#([^{].*)?$"

View File

@@ -9,7 +9,7 @@ color statement "\b(for|if|while|do|else|case|default|switch)\b"
color statement "\b(try|throw|catch|operator|new|delete)\b"
color statement "\b(goto|continue|break|return)\b"
color preproc "^[[:space:]]*#[[:space:]]*(define|include|(un|ifn?)def|endif|el(if|se)|if|warning|error)"
color brightmagenta "'([^'\]|(\\["'abfnrtv\\]))'" "'\\(([0-3]?[0-7]{1,2}))'" "'\\x[0-9A-Fa-f]{1,2}'"
color constant "'([^'\\]|(\\["'abfnrtv\\]))'" "'\\(([0-3]?[0-7]{1,2}))'" "'\\x[0-9A-Fa-f]{1,2}'"
##
## GCC builtins

View File

@@ -77,7 +77,7 @@ color constant "q"\{.*\}""
color constant "q"\[.*\]""
color constant "q"<.*>""
color constant (s) "q"[^({[<"][^"]*$.*?^[^"]+""
color constant "q"([^({[<"]).*\1""
color constant "q"([^({[<"]).*""
### TokenString
### True token strings require nesting, so, again, they can't be implemented accurately here.