mirror of
git://git.sv.gnu.org/nano.git
synced 2025-02-18 06:14:19 +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}))'"
|
color brightmagenta "'([^'\]|\\(["'\abfnrtv]|x[[:xdigit:]]{1,2}|[0-3]?[0-7]{1,2}))'"
|
||||||
|
|
||||||
# GCC builtins.
|
# 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.
|
# Strings and names of included files.
|
||||||
color brightyellow ""([^"]|\\")*"" "#[[:blank:]]*include[[:blank:]]*<[^>]+>"
|
color brightyellow ""([^"]|\\")*"|#[[:blank:]]*include[[:blank:]]*<[^>]+>"
|
||||||
|
|
||||||
# Preprocessor directives.
|
# Preprocessor directives.
|
||||||
color brightcyan start="^[[:blank:]]*#[[:blank:]]*(if(n?def)?|elif|warning|error|pragma)\>" end="(\`|[^\])$"
|
color brightcyan start="^[[:blank:]]*#[[:blank:]]*(if(n?def)?|elif|warning|error|pragma)\>" end="(\`|[^\])$"
|
||||||
|
@ -3,23 +3,23 @@
|
|||||||
syntax groff "\.(m[ems]|rof|tmac)$|/tmac\.[^/]+$"
|
syntax groff "\.(m[ems]|rof|tmac)$|/tmac\.[^/]+$"
|
||||||
comment ".\""
|
comment ".\""
|
||||||
|
|
||||||
# The argument of .ds or .nr
|
# The setting of a string or register
|
||||||
color cyan "^\.(ds|nr) [^[:space:]]*"
|
color cyan "^\.(ds|nr) [^[:space:]]*"
|
||||||
# Single-character escapes
|
# Single-character escapes
|
||||||
color brightmagenta "\\."
|
color brightmagenta "\\."
|
||||||
# The argument of \f or \s in the same color
|
# The argument of \f or \s in the same color
|
||||||
color brightmagenta "\\f(.|\(..)" "\\s(\+|\-)?[0-9]"
|
color brightmagenta "\\f(.|\(..)|\\s(\+|\-)?[0-9]"
|
||||||
# Newlines
|
# References to registers
|
||||||
color cyan "\\(\\)?n(.|\(..)"
|
color cyan "\\(\\)?n(.|\(..)"
|
||||||
color cyan start="\\(\\)?n\[" end="]"
|
color cyan start="\\(\\)?n\[" end="]"
|
||||||
# Requests
|
# Requests
|
||||||
color brightgreen "^\.[[:blank:]]*[^[:space:]]*"
|
color brightgreen "^\.[[:blank:]]*[^[:space:]]*"
|
||||||
# Comments
|
# Comments
|
||||||
color yellow "^\.\\".*"
|
color yellow "^\.\\".*"
|
||||||
# Strings
|
# References to strings
|
||||||
color green "\\(\\)?\*(.|\(..)"
|
color green "\\(\\)?\*(.|\(..)"
|
||||||
color green start="\\(\\)?\*\[" end="]"
|
color green start="\\(\\)?\*\[" end="]"
|
||||||
# Characters
|
# Special characters
|
||||||
color brightred "\\\(.."
|
color brightred "\\\(.."
|
||||||
color brightred start="\\\[" end="]"
|
color brightred start="\\\[" end="]"
|
||||||
# Macro arguments
|
# Macro arguments
|
||||||
|
@ -22,9 +22,8 @@ color green "\<(true|false|null)\>"
|
|||||||
color brightblue ""[^"]+"[[:blank:]]*:"
|
color brightblue ""[^"]+"[[:blank:]]*:"
|
||||||
|
|
||||||
# Brackets, braces, and separators.
|
# Brackets, braces, and separators.
|
||||||
color brightblue "\[" "\]"
|
color brightblue "[][]"
|
||||||
color brightred "\{" "\}"
|
color brightred "[{},:]"
|
||||||
color brightred "," ":"
|
|
||||||
|
|
||||||
# Comments.
|
# Comments.
|
||||||
color cyan "(^|[[:blank:]]+)(//|#).*"
|
color cyan "(^|[[:blank:]]+)(//|#).*"
|
||||||
|
@ -6,10 +6,10 @@ comment ".\""
|
|||||||
|
|
||||||
# Section headers, title line, and indented paragraphs.
|
# Section headers, title line, and indented paragraphs.
|
||||||
color green "^\.(SH|SS|TH) .*"
|
color green "^\.(SH|SS|TH) .*"
|
||||||
color brightgreen "^\.(SH|SS|TH) " "^\.([HIT]P)"
|
color brightgreen "^\.((SH|SS|TH) |[HIT]P)"
|
||||||
# Type faces, and normal paragraphs.
|
# Type faces, and normal paragraphs.
|
||||||
color brightred "^\.(B[IR]?|I[BR]?|R[BI]|S[BM]) .*"
|
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.
|
# Inline type faces.
|
||||||
color magenta "\\f[BIPR]"
|
color magenta "\\f[BIPR]"
|
||||||
# Relative margins, hyperlinks, and various other stuff.
|
# Relative margins, hyperlinks, and various other stuff.
|
||||||
|
@ -15,7 +15,7 @@ color brightgreen "\<(goto|continue|break|return)\>"
|
|||||||
color brightgreen "@(encode|end|implementation|interface)|selector)\>"
|
color brightgreen "@(encode|end|implementation|interface)|selector)\>"
|
||||||
|
|
||||||
# GCC builtins.
|
# 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.
|
# Selector/method.
|
||||||
color brightmagenta "(^|[[:blank:]])\[.*[[:blank:]].*\]"
|
color brightmagenta "(^|[[:blank:]])\[.*[[:blank:]].*\]"
|
||||||
|
@ -23,11 +23,11 @@ color brightmagenta "(/([^/]|\\/)*/|%r\{([^}]|\\\})*\})[iomx]*"
|
|||||||
color brightblue "`[^`]*`|%x\{[^}]*\}"
|
color brightblue "`[^`]*`|%x\{[^}]*\}"
|
||||||
|
|
||||||
# Strings, double-quoted.
|
# Strings, double-quoted.
|
||||||
color green ""([^"]|\\")*"" "%[QW]?(\{[^}]*\}|\([^)]*\)|<[^>]*>|\[[^]]*\]|\$[^$]*\$|\^[^^]*\^|![^!]*!)"
|
color green ""([^"]|\\")*"|%[QW]?(\{[^}]*\}|\([^)]*\)|<[^>]*>|\[[^]]*\]|\$[^$]*\$|\^[^^]*\^|![^!]*!)"
|
||||||
# Expression substitution for inside double-quoted strings, "like #{this}".
|
# Expression substitution for inside double-quoted strings, "like #{this}".
|
||||||
color brightgreen "#\{[^}]*\}"
|
color brightgreen "#\{[^}]*\}"
|
||||||
# Strings, single-quoted.
|
# Strings, single-quoted.
|
||||||
color green "'([^']|\\')*'" "%[qw](\{[^}]*\}|\([^)]*\)|<[^>]*>|\[[^]]*\]|\$[^$]*\$|\^[^^]*\^|![^!]*!)"
|
color green "'([^']|\\')*'|%[qw](\{[^}]*\}|\([^)]*\)|<[^>]*>|\[[^]]*\]|\$[^$]*\$|\^[^^]*\^|![^!]*!)"
|
||||||
|
|
||||||
# Comments.
|
# Comments.
|
||||||
color cyan "#([^{#].*|$)"
|
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\>"
|
color normal "[.-]tar\>"
|
||||||
|
|
||||||
# Basic variable names (no braces).
|
# 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.
|
# More complicated variable names; handles braces and replacements and arrays.
|
||||||
color brightred "\$\{[#!]?([-@*#?$!]|[0-9]+|[[:alpha:]_][[:alnum:]_]*)(\[([[:blank:]]*[[:alnum:]_]+[[:blank:]]*|@)\])?(([#%/]|:?[-=?+])[^}]*\}|\[|\})"
|
color brightred "\$\{[#!]?([-@*#?$!]|[0-9]+|[[:alpha:]_][[:alnum:]_]*)(\[([[:blank:]]*[[:alnum:]_]+[[:blank:]]*|@)\])?(([#%/]|:?[-=?+])[^}]*\}|\[|\})"
|
||||||
|
|
||||||
|
@ -8,8 +8,8 @@ comment "<!--|-->"
|
|||||||
# The entire content of the tag:
|
# The entire content of the tag:
|
||||||
color green start="<" end=">"
|
color green start="<" end=">"
|
||||||
|
|
||||||
# The start and the end of the tag:
|
# The angled brackets and the name of the tag:
|
||||||
color cyan "<[^> ]+" ">"
|
color cyan "<[^> ]+|>"
|
||||||
|
|
||||||
# The strings inside the tag:
|
# The strings inside the tag:
|
||||||
color magenta ""[^"]*""
|
color magenta ""[^"]*""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user