|
54 | 54 | <rule pattern="\\([nrt"$\\]|[0-7]{1,3}|x[0-9a-f]{1,2})"> |
55 | 55 | <token type="LiteralStringEscape"/> |
56 | 56 | </rule> |
57 | | - <rule pattern="\$(?:[\\_a-z]|[^\x00-\x7f])(?:[\\\w]|[^\x00-\x7f])*(\[\S+?\]|->(?:[\\_a-z]|[^\x00-\x7f])(?:[\\\w]|[^\x00-\x7f])*)?"> |
| 57 | + <rule pattern="\$(?:[_a-z]|[^\x00-\x7f])(?:\w|[^\x00-\x7f])*(\[\S+?\]|->(?:[_a-z]|[^\x00-\x7f])(?:\w|[^\x00-\x7f])*)?"> |
58 | 58 | <token type="LiteralStringInterpol"/> |
59 | 59 | </rule> |
60 | 60 | <rule pattern="(\{\$\{)(.*?)(\}\})"> |
|
82 | 82 | <token type="LiteralStringDouble"/> |
83 | 83 | </rule> |
84 | 84 | </state> |
| 85 | + <state name="variablevariable"> |
| 86 | + <rule pattern="\}"> |
| 87 | + <token type="NameVariable"/> |
| 88 | + <pop depth="1"/> |
| 89 | + </rule> |
| 90 | + <rule> |
| 91 | + <include state="root"/> |
| 92 | + </rule> |
| 93 | + </state> |
| 94 | + <state name="attribute"> |
| 95 | + <rule pattern="\]"> |
| 96 | + <token type="Punctuation"/> |
| 97 | + <pop depth="1"/> |
| 98 | + </rule> |
| 99 | + <rule pattern="\("> |
| 100 | + <token type="Punctuation"/> |
| 101 | + <push state="attributeparams"/> |
| 102 | + </rule> |
| 103 | + <rule pattern="(?:[\\_a-z]|[^\x00-\x7f])(?:[\\\w]|[^\x00-\x7f])*"> |
| 104 | + <token type="NameDecorator"/> |
| 105 | + </rule> |
| 106 | + <rule> |
| 107 | + <include state="root"/> |
| 108 | + </rule> |
| 109 | + </state> |
| 110 | + <state name="attributeparams"> |
| 111 | + <rule pattern="\)"> |
| 112 | + <token type="Punctuation"/> |
| 113 | + <pop depth="1"/> |
| 114 | + </rule> |
| 115 | + <rule> |
| 116 | + <include state="root"/> |
| 117 | + </rule> |
| 118 | + </state> |
85 | 119 | <state name="root"> |
86 | 120 | <rule pattern="\?>"> |
87 | 121 | <token type="CommentPreproc"/> |
88 | 122 | <pop depth="1"/> |
89 | 123 | </rule> |
90 | | - <rule pattern="(<<<)([\'"]?)((?:[\\_a-z]|[^\x00-\x7f])(?:[\\\w]|[^\x00-\x7f])*)(\2\n.*?\n\s*)(\3)(;?)(\n)"> |
| 124 | + <rule pattern="(<<<)([\'"]?)((?:[_a-z]|[^\x00-\x7f])(?:\w|[^\x00-\x7f])*)(\2\n.*?\n\s*)(\3)(;?)(\n)"> |
91 | 125 | <bygroups> |
92 | 126 | <token type="LiteralString"/> |
93 | 127 | <token type="LiteralString"/> |
|
101 | 135 | <rule pattern="\s+"> |
102 | 136 | <token type="Text"/> |
103 | 137 | </rule> |
| 138 | + <rule pattern="#\["> |
| 139 | + <token type="Punctuation"/> |
| 140 | + <push state="attribute"/> |
| 141 | + </rule> |
104 | 142 | <rule pattern="#.*?\n"> |
105 | 143 | <token type="CommentSingle"/> |
106 | 144 | </rule> |
|
116 | 154 | <rule pattern="/\*.*?\*/"> |
117 | 155 | <token type="CommentMultiline"/> |
118 | 156 | </rule> |
119 | | - <rule pattern="(->|::)(\s*)((?:[\\_a-z]|[^\x00-\x7f])(?:[\\\w]|[^\x00-\x7f])*)"> |
| 157 | + <rule pattern="(->|::)(\s*)((?:[_a-z]|[^\x00-\x7f])(?:\w|[^\x00-\x7f])*)"> |
120 | 158 | <bygroups> |
121 | 159 | <token type="Operator"/> |
122 | 160 | <token type="Text"/> |
|
132 | 170 | <rule pattern="[\[\]{}();,]+"> |
133 | 171 | <token type="Punctuation"/> |
134 | 172 | </rule> |
| 173 | + <rule pattern="(new)(\s+)(class)\b"> |
| 174 | + <bygroups> |
| 175 | + <token type="Keyword"/> |
| 176 | + <token type="Text"/> |
| 177 | + <token type="Keyword"/> |
| 178 | + </bygroups> |
| 179 | + </rule> |
135 | 180 | <rule pattern="(class)(\s+)"> |
136 | 181 | <bygroups> |
137 | 182 | <token type="Keyword"/> |
|
161 | 206 | <token type="NameConstant"/> |
162 | 207 | </bygroups> |
163 | 208 | </rule> |
164 | | - <rule pattern="(and|E_PARSE|old_function|E_ERROR|or|as|E_WARNING|parent|eval|PHP_OS|break|exit|case|extends|PHP_VERSION|cfunction|FALSE|print|for|require|continue|foreach|require_once|declare|return|default|static|do|switch|die|stdClass|echo|else|TRUE|elseif|var|empty|if|xor|enddeclare|include|virtual|endfor|include_once|while|endforeach|global|endif|list|endswitch|new|endwhile|not|array|E_ALL|NULL|final|php_user_filter|interface|implements|public|private|protected|abstract|clone|try|catch|throw|this|use|namespace|trait|yield|finally)\b"> |
| 209 | + <rule pattern="(and|E_PARSE|old_function|E_ERROR|or|as|E_WARNING|parent|eval|PHP_OS|break|exit|case|extends|PHP_VERSION|cfunction|FALSE|print|for|require|continue|foreach|require_once|declare|return|default|static|do|switch|die|stdClass|echo|else|TRUE|elseif|var|empty|if|xor|enddeclare|include|virtual|endfor|include_once|while|endforeach|global|endif|list|endswitch|new|endwhile|not|array|E_ALL|NULL|final|php_user_filter|interface|implements|public|private|protected|abstract|clone|try|catch|throw|this|use|namespace|trait|yield|finally|match)\b"> |
165 | 210 | <token type="Keyword"/> |
166 | 211 | </rule> |
167 | 212 | <rule pattern="(true|false|null)\b"> |
|
170 | 215 | <rule> |
171 | 216 | <include state="magicconstants"/> |
172 | 217 | </rule> |
173 | | - <rule pattern="\$\{\$+(?:[\\_a-z]|[^\x00-\x7f])(?:[\\\w]|[^\x00-\x7f])*\}"> |
| 218 | + <rule pattern="\$\{"> |
174 | 219 | <token type="NameVariable"/> |
| 220 | + <push state="variablevariable"/> |
175 | 221 | </rule> |
176 | 222 | <rule pattern="\$+(?:[\\_a-z]|[^\x00-\x7f])(?:[\\\w]|[^\x00-\x7f])*"> |
177 | 223 | <token type="NameVariable"/> |
|
185 | 231 | <rule pattern="\d+e[+-]?[0-9]+"> |
186 | 232 | <token type="LiteralNumberFloat"/> |
187 | 233 | </rule> |
188 | | - <rule pattern="0[0-7]+"> |
| 234 | + <rule pattern="0o?[0-7_]+"> |
189 | 235 | <token type="LiteralNumberOct"/> |
190 | 236 | </rule> |
191 | 237 | <rule pattern="0x[a-f0-9_]+"> |
|
194 | 240 | <rule pattern="\d[\d_]*"> |
195 | 241 | <token type="LiteralNumberInteger"/> |
196 | 242 | </rule> |
197 | | - <rule pattern="0b[01]+"> |
| 243 | + <rule pattern="0b[01_]+"> |
198 | 244 | <token type="LiteralNumberBin"/> |
199 | 245 | </rule> |
200 | 246 | <rule pattern="'([^'\\]*(?:\\.[^'\\]*)*)'"> |
|
0 commit comments