nano/syntax/php.nanorc
Benno Schulenberg 3e1fc6385b syntaxes: remove quotes from each syntax name, and color it differently
The different color will make the name stand out, as it should, instead
of looking the same as all the regex strings.
2018-02-14 17:36:50 +01:00

36 lines
1.0 KiB
Plaintext

## Here is an example for PHP.
syntax php "\.ph(p[23457s~]?|tml)$"
magic "PHP script"
comment "//"
# PHP markings.
color brightgreen "(<\?(php)?|\?>)"
# Function names.
color white "\<[A-Za-z_][A-Za-z_0-9]*\("
# Variable names.
color cyan "\$[A-Za-z_][A-Za-z_0-9]*"
# Types.
color green "\<(array|bool|callable|const|float|global|int|object|string|var)\>"
# Directives and structure.
color brightcyan "\<(abstract|as|class|clone|(end)?declare|extends|function|implements|include(_once)?|inst(ance|ead)of|interface|namespace|new|private|protected|public|require(_once)?|static|trait|use|yield)\>"
color brightcyan "\<(case|catch|default|do|echo|else(if)?|end(for(each)?|if|switch|while)|final(ly)?|for(each)?|if|print|switch|throw|try|while)\>"
# Operators.
color brightcyan "\<(and|or|xor)\>"
# Control flow.
color magenta "\<(break|continue|goto|return)\>"
# Strings.
color brightyellow ""(\.|[^"])*"" "'(\.|[^'])*'"
# Comments.
color brightblue "(^|[[:space:]]+)//.*"
color brightblue start="/\*" end="\*/"
# Trailing whitespace.
color ,green "[[:space:]]+$"