mirror of
git://git.sv.gnu.org/nano.git
synced 2024-11-25 14:20:46 +03:00
syntaxes: fold a couple of regexes together, and improve a few comments
This commit is contained in:
parent
a58efa70bc
commit
89bb88e4f5
@ -26,10 +26,10 @@ color magenta "\<(break|continue|goto|return)\>"
|
||||
color brightmagenta "'([^'\]|\\(["'\abfnrtv]|x[[:xdigit:]]{1,2}|[0-3]?[0-7]{1,2}))'"
|
||||
|
||||
# GCC builtins.
|
||||
color cyan "__attribute__[[:blank:]]*\(\([^)]*\)\)" "__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__"
|
||||
color cyan "__attribute__[[:blank:]]*\(\([^)]*\)\)|__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__"
|
||||
|
||||
# Strings and names of included files.
|
||||
color brightyellow ""([^"]|\\")*"" "#[[:blank:]]*include[[:blank:]]*<[^>]+>"
|
||||
color brightyellow ""([^"]|\\")*"|#[[:blank:]]*include[[:blank:]]*<[^>]+>"
|
||||
|
||||
# Preprocessor directives.
|
||||
color brightcyan start="^[[:blank:]]*#[[:blank:]]*(if(n?def)?|elif|warning|error|pragma)\>" end="(\`|[^\])$"
|
||||
|
@ -3,23 +3,23 @@
|
||||
syntax groff "\.(m[ems]|rof|tmac)$|/tmac\.[^/]+$"
|
||||
comment ".\""
|
||||
|
||||
# The argument of .ds or .nr
|
||||
# The setting of a string or register
|
||||
color cyan "^\.(ds|nr) [^[:space:]]*"
|
||||
# Single-character escapes
|
||||
color brightmagenta "\\."
|
||||
# The argument of \f or \s in the same color
|
||||
color brightmagenta "\\f(.|\(..)" "\\s(\+|\-)?[0-9]"
|
||||
# Newlines
|
||||
color brightmagenta "\\f(.|\(..)|\\s(\+|\-)?[0-9]"
|
||||
# References to registers
|
||||
color cyan "\\(\\)?n(.|\(..)"
|
||||
color cyan start="\\(\\)?n\[" end="]"
|
||||
# Requests
|
||||
color brightgreen "^\.[[:blank:]]*[^[:space:]]*"
|
||||
# Comments
|
||||
color yellow "^\.\\".*"
|
||||
# Strings
|
||||
# References to strings
|
||||
color green "\\(\\)?\*(.|\(..)"
|
||||
color green start="\\(\\)?\*\[" end="]"
|
||||
# Characters
|
||||
# Special characters
|
||||
color brightred "\\\(.."
|
||||
color brightred start="\\\[" end="]"
|
||||
# Macro arguments
|
||||
|
@ -22,9 +22,8 @@ color green "\<(true|false|null)\>"
|
||||
color brightblue ""[^"]+"[[:blank:]]*:"
|
||||
|
||||
# Brackets, braces, and separators.
|
||||
color brightblue "\[" "\]"
|
||||
color brightred "\{" "\}"
|
||||
color brightred "," ":"
|
||||
color brightblue "[][]"
|
||||
color brightred "[{},:]"
|
||||
|
||||
# Comments.
|
||||
color cyan "(^|[[:blank:]]+)(//|#).*"
|
||||
|
@ -6,10 +6,10 @@ comment ".\""
|
||||
|
||||
# Section headers, title line, and indented paragraphs.
|
||||
color green "^\.(SH|SS|TH) .*"
|
||||
color brightgreen "^\.(SH|SS|TH) " "^\.([HIT]P)"
|
||||
color brightgreen "^\.((SH|SS|TH) |[HIT]P)"
|
||||
# Type faces, and normal paragraphs.
|
||||
color brightred "^\.(B[IR]?|I[BR]?|R[BI]|S[BM]) .*"
|
||||
color brightblue "^\.(B[IR]?|I[BR]?|R[BI]|S[BM]) " "^\.([LP]?P)$"
|
||||
color brightblue "^\.((B[IR]?|I[BR]?|R[BI]|S[BM]) |[LP]?P$)"
|
||||
# Inline type faces.
|
||||
color magenta "\\f[BIPR]"
|
||||
# Relative margins, hyperlinks, and various other stuff.
|
||||
|
@ -15,7 +15,7 @@ color brightgreen "\<(goto|continue|break|return)\>"
|
||||
color brightgreen "@(encode|end|implementation|interface)|selector)\>"
|
||||
|
||||
# GCC builtins.
|
||||
color cyan "__attribute__[[:blank:]]*\(\([^)]*\)\)" "__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__"
|
||||
color cyan "__attribute__[[:blank:]]*\(\([^)]*\)\)|__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__"
|
||||
|
||||
# Selector/method.
|
||||
color brightmagenta "(^|[[:blank:]])\[.*[[:blank:]].*\]"
|
||||
|
@ -23,11 +23,11 @@ color brightmagenta "(/([^/]|\\/)*/|%r\{([^}]|\\\})*\})[iomx]*"
|
||||
color brightblue "`[^`]*`|%x\{[^}]*\}"
|
||||
|
||||
# Strings, double-quoted.
|
||||
color green ""([^"]|\\")*"" "%[QW]?(\{[^}]*\}|\([^)]*\)|<[^>]*>|\[[^]]*\]|\$[^$]*\$|\^[^^]*\^|![^!]*!)"
|
||||
color green ""([^"]|\\")*"|%[QW]?(\{[^}]*\}|\([^)]*\)|<[^>]*>|\[[^]]*\]|\$[^$]*\$|\^[^^]*\^|![^!]*!)"
|
||||
# Expression substitution for inside double-quoted strings, "like #{this}".
|
||||
color brightgreen "#\{[^}]*\}"
|
||||
# Strings, single-quoted.
|
||||
color green "'([^']|\\')*'" "%[qw](\{[^}]*\}|\([^)]*\)|<[^>]*>|\[[^]]*\]|\$[^$]*\$|\^[^^]*\^|![^!]*!)"
|
||||
color green "'([^']|\\')*'|%[qw](\{[^}]*\}|\([^)]*\)|<[^>]*>|\[[^]]*\]|\$[^$]*\$|\^[^^]*\^|![^!]*!)"
|
||||
|
||||
# Comments.
|
||||
color cyan "#([^{#].*|$)"
|
||||
|
@ -25,7 +25,7 @@ color brightblue "\<(awk|cat|cd|ch(grp|mod|own)|cp|cut|echo|env|grep|head|instal
|
||||
color normal "[.-]tar\>"
|
||||
|
||||
# Basic variable names (no braces).
|
||||
color brightred "\$[-0-9@*#?$!]" "\$[[:alpha:]_][[:alnum:]_]*"
|
||||
color brightred "\$([-@*#?$!0-9]|[[:alpha:]_][[:alnum:]_]*)"
|
||||
# More complicated variable names; handles braces and replacements and arrays.
|
||||
color brightred "\$\{[#!]?([-@*#?$!]|[0-9]+|[[:alpha:]_][[:alnum:]_]*)(\[([[:blank:]]*[[:alnum:]_]+[[:blank:]]*|@)\])?(([#%/]|:?[-=?+])[^}]*\}|\[|\})"
|
||||
|
||||
|
@ -8,8 +8,8 @@ comment "<!--|-->"
|
||||
# The entire content of the tag:
|
||||
color green start="<" end=">"
|
||||
|
||||
# The start and the end of the tag:
|
||||
color cyan "<[^> ]+" ">"
|
||||
# The angled brackets and the name of the tag:
|
||||
color cyan "<[^> ]+|>"
|
||||
|
||||
# The strings inside the tag:
|
||||
color magenta ""[^"]*""
|
||||
|
Loading…
Reference in New Issue
Block a user