php.nanorc (1160B)
1 ## Syntax highlighting for PHP. 2 3 ## Original author: Mike Frysinger 4 ## License: GPL version 3 or newer 5 6 syntax php "\.(php[23457s~]?|phtml|ctp)$" 7 magic "PHP script" 8 comment "//" 9 10 # PHP markings. 11 color brightgreen "(<\?(php|=)?|\?>)" 12 13 # Function names. 14 color white "\<[[:alpha:]_][[:alnum:]_]*\(" 15 # Variable names. 16 color cyan "\$[[:alpha:]_][[:alnum:]_]*" 17 18 # Types. 19 color green "\<(array|bool|callable|const|float|global|int|object|string|var)\>" 20 21 # Directives and structure. 22 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)\>" 23 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)\>" 24 # Operators. 25 color brightcyan "\<(and|or|xor)\>" 26 27 # Control flow. 28 color magenta "\<(break|continue|goto|return)\>" 29 30 # Strings. 31 color brightyellow ""([^"\]|\\.)*"|'([^'\]|\\.)*'" 32 33 # Comments. 34 color brightblue "(^|[[:blank:]]+)//.*" 35 color brightblue start="/\*" end="\*/" 36 37 # Trailing whitespace. 38 color ,green "[[:space:]]+$"