bacb0f717d
Since file-5.10 (end of 2011), libmagic identifies a C file in most cases as "C source" instead of as "C program". Nano's magic strings for some other files didn't match any more what file-5.32 currently produces, either. So, they have been adjusted, new ones added, and old ones deleted. This fixes https://savannah.gnu.org/bugs/?52445.
36 строки
1.0 KiB
Plaintext
36 строки
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-z_]*\("
|
|
# Variable names.
|
|
color cyan "\$[a-z_]+"
|
|
|
|
# Types.
|
|
color green "\<(array|bool|callable|const|float|global|int|object|string|var)\>"
|
|
|
|
# Directives and structure.
|
|
color brightyellow "\<(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 brightyellow "\<(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 brightyellow "\<(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:]]+$"
|