@@ -3,25 +3,28 @@ syntax "PHP" "\.php[2345s~]?$|\.module$"
3
3
header " ^ #!. * php"
4
4
magic " PHP script"
5
5
comment " //"
6
+
7
+ # Default
6
8
color white start =" <\? (php| =)? " end =" \? >"
7
9
# Constructs
8
10
color brightblue " (class| extends| goto) ([a -zA -Z0 -9_ ]* )"
9
- color brightblue " [ ^ a - z0 - 9_- ] { 1 } (var| class| function| echo| case| break| default| exit| switch| if| else| elseif| endif| foreach| endforeach| @| while| public| private| protected| return| const| static| extends| as| array| require| include| require_once| include_once| define| do| continue| declare| goto| print| in| namespace| use)[ ^ a - z0 - 9_- ] { 1 } "
11
+ color brightblue " \< (var| class| function| echo| case| break| default| exit| switch| if| else| elseif| endif| foreach| endforeach| @| while| public| private| protected| return| const| static| extends| as| array| require| include| require_once| include_once| define| do| continue| declare| goto| print| in| namespace| use)\> "
10
12
color brightblue " [a -zA -Z0 -9_ ]+ :"
11
13
# Variables
12
- color green " \$ [a -zA -Z_0 -9 $]* | [=!<> ]"
13
- color green " \- >[a -zA -Z_0 -9 $]* | [=!<> ]"
14
+ # color green "\$[a-zA-Z_0-9$]*|[=!<>]"
15
+ # color green "\->[a-zA-Z_0-9$]*|[=!<>]"
16
+ color green " \$ [a -zA -Z_0 -9 ]* "
17
+ color green " \- >[a -zA -Z_0 -9 ]* "
14
18
# Functions
15
19
color brightblue " ([a -zA -Z0 -9_- ]* )\( "
16
20
# Special values
17
- color brightmagenta " [^ a -z0 -9_- ]{1 } (true| false| null| TRUE| FALSE| NULL)$ "
18
- color brightmagenta " [^ a -z0 -9_- ]{1 } (true| false| null| TRUE| FALSE| NULL)[^ A -Za -z0 -9_- ]{1 } "
21
+ color brightmagenta " \< (true| false| null| TRUE| FALSE| NULL)\> "
19
22
# Special Characters
20
23
color yellow " [. ,{} (); ]"
21
24
color cyan " \[ "
22
25
color cyan " \] "
23
26
# Numbers
24
- color magenta " [+ - ]* ([0 -9 ]\. )* [0 -9 ]+ ([eE ][+ - ]? ( [0 -9 ]\. ) * [ 0 - 9 ]) * "
27
+ color magenta " \< [+ - ]? ([0 -9 ]* \. )? [0 -9 ]+ ([eE ][+ - ]? [0 -9 ]+ ) ? \> "
25
28
color magenta " 0x[0 -9a -zA -Z ]* "
26
29
# Special Variables
27
30
color brightblue " (\$ this| parent::| self::| \$ this->)"
@@ -30,26 +33,25 @@ color magenta ";"
30
33
color yellow " (<| >)"
31
34
# Assignment operator
32
35
color brightblue " ="
33
- # Bitwise Operations
36
+ # Bitwise operators
34
37
color magenta " (&| \| | \^ )"
35
38
color magenta " (<<| >>)"
36
39
# Comparison operators
37
40
color yellow " (==| ===| !=| <>| !==| <=| >=| <=>)"
38
41
# Logical Operators
39
- color yellow " ( and | or | xor | !| &&| \|\| )"
40
- # And/Or/ SRO/etc
41
- color cyan " (\;\; | \|\| | ::| =>| ->)"
42
+ color yellow " \< ( and| or | xor) \> " " ( !| &&| \|\| )"
43
+ # SRO and other operators
44
+ color cyan " (\;\; | ::| =>| ->)"
42
45
# Double quoted STRINGS!
43
- color red " (\" [^ \" ]* \" )"
46
+ color red " \" ([^ " \] | \\ . )* \" "
47
+ # Single quoted string
48
+ color red "' ([^' \] | \\ . )* '"
44
49
# Heredoc (typically ends with a semicolon ).
45
- color red start =" <<<[' \" ]? [A -Z ][A -Z0 -9_ ]* [' \" ]? " end =" ^ [A -Z ][A -Z0 -9_ ]* ;"
50
+ color red start="<<< [\" ]? [A -Z ][A -Z0 -9_ ]* [\" ]? " end="^ [A -Z ][A -Z0 -9_ ]* ;"
46
51
# Inline Variables
47
52
color white "\{\$ [^ } ]* \} "
48
- # Single quoted string
49
- color red " ('[^ ' ]* ')"
50
53
# Online Comments
51
- color brightyellow " ^ (#. * | //. * )$ "
52
- color brightyellow " [ | ](#. * | //. * )$ "
54
+ color brightyellow "(^ | [[:blank :] ])(#. * | //. * )$ "
53
55
# PHP Tags
54
56
color red "(<\? (php)? | \? >)"
55
57
# General HTML
0 commit comments