File: php.nanorc

package info (click to toggle)
nano 8.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 16,632 kB
  • sloc: ansic: 78,234; sh: 4,960; makefile: 219; sed: 16
file content (38 lines) | stat: -rw-r--r-- 1,160 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
## Syntax highlighting for PHP.

## Original author:  Mike Frysinger
## License:  GPL version 3 or newer

syntax php "\.(php[23457s~]?|phtml|ctp)$"
magic "PHP script"
comment "//"

# PHP markings.
color brightgreen "(<\?(php|=)?|\?>)"

# Function names.
color white "\<[[:alpha:]_][[:alnum:]_]*\("
# Variable names.
color cyan "\$[[:alpha:]_][[:alnum:]_]*"

# 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 "(^|[[:blank:]]+)//.*"
color brightblue start="/\*" end="\*/"

# Trailing whitespace.
color ,green "[[:space:]]+$"