diff options
Diffstat (limited to 'vendor/github.com/alecthomas/chroma/v2/lexers/embedded/php.xml')
| -rw-r--r-- | vendor/github.com/alecthomas/chroma/v2/lexers/embedded/php.xml | 211 |
1 files changed, 211 insertions, 0 deletions
diff --git a/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/php.xml b/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/php.xml new file mode 100644 index 0000000..69e9e85 --- /dev/null +++ b/vendor/github.com/alecthomas/chroma/v2/lexers/embedded/php.xml | |||
| @@ -0,0 +1,211 @@ | |||
| 1 | <lexer> | ||
| 2 | <config> | ||
| 3 | <name>PHP</name> | ||
| 4 | <alias>php</alias> | ||
| 5 | <alias>php3</alias> | ||
| 6 | <alias>php4</alias> | ||
| 7 | <alias>php5</alias> | ||
| 8 | <filename>*.php</filename> | ||
| 9 | <filename>*.php[345]</filename> | ||
| 10 | <filename>*.inc</filename> | ||
| 11 | <mime_type>text/x-php</mime_type> | ||
| 12 | <case_insensitive>true</case_insensitive> | ||
| 13 | <dot_all>true</dot_all> | ||
| 14 | <ensure_nl>true</ensure_nl> | ||
| 15 | </config> | ||
| 16 | <rules> | ||
| 17 | <state name="magicfuncs"> | ||
| 18 | <rule pattern="(__callStatic|__set_state|__construct|__debugInfo|__toString|__destruct|__invoke|__wakeup|__clone|__sleep|__isset|__unset|__call|__get|__set)\b"> | ||
| 19 | <token type="NameFunctionMagic"/> | ||
| 20 | </rule> | ||
| 21 | </state> | ||
| 22 | <state name="magicconstants"> | ||
| 23 | <rule pattern="(__NAMESPACE__|__FUNCTION__|__METHOD__|__CLASS__|__TRAIT__|__LINE__|__FILE__|__DIR__)\b"> | ||
| 24 | <token type="NameConstant"/> | ||
| 25 | </rule> | ||
| 26 | </state> | ||
| 27 | <state name="classname"> | ||
| 28 | <rule pattern="(?:[\\_a-z]|[^\x00-\x7f])(?:[\\\w]|[^\x00-\x7f])*"> | ||
| 29 | <token type="NameClass"/> | ||
| 30 | <pop depth="1"/> | ||
| 31 | </rule> | ||
| 32 | </state> | ||
| 33 | <state name="functionname"> | ||
| 34 | <rule> | ||
| 35 | <include state="magicfuncs"/> | ||
| 36 | </rule> | ||
| 37 | <rule pattern="(?:[\\_a-z]|[^\x00-\x7f])(?:[\\\w]|[^\x00-\x7f])*"> | ||
| 38 | <token type="NameFunction"/> | ||
| 39 | <pop depth="1"/> | ||
| 40 | </rule> | ||
| 41 | <rule> | ||
| 42 | <pop depth="1"/> | ||
| 43 | </rule> | ||
| 44 | </state> | ||
| 45 | <state name="string"> | ||
| 46 | <rule pattern="""> | ||
| 47 | <token type="LiteralStringDouble"/> | ||
| 48 | <pop depth="1"/> | ||
| 49 | </rule> | ||
| 50 | <rule pattern="[^{$"\\]+"> | ||
| 51 | <token type="LiteralStringDouble"/> | ||
| 52 | </rule> | ||
| 53 | <rule pattern="\\([nrt"$\\]|[0-7]{1,3}|x[0-9a-f]{1,2})"> | ||
| 54 | <token type="LiteralStringEscape"/> | ||
| 55 | </rule> | ||
| 56 | <rule pattern="\$(?:[\\_a-z]|[^\x00-\x7f])(?:[\\\w]|[^\x00-\x7f])*(\[\S+?\]|->(?:[\\_a-z]|[^\x00-\x7f])(?:[\\\w]|[^\x00-\x7f])*)?"> | ||
| 57 | <token type="LiteralStringInterpol"/> | ||
| 58 | </rule> | ||
| 59 | <rule pattern="(\{\$\{)(.*?)(\}\})"> | ||
| 60 | <bygroups> | ||
| 61 | <token type="LiteralStringInterpol"/> | ||
| 62 | <usingself state="root"/> | ||
| 63 | <token type="LiteralStringInterpol"/> | ||
| 64 | </bygroups> | ||
| 65 | </rule> | ||
| 66 | <rule pattern="(\{)(\$.*?)(\})"> | ||
| 67 | <bygroups> | ||
| 68 | <token type="LiteralStringInterpol"/> | ||
| 69 | <usingself state="root"/> | ||
| 70 | <token type="LiteralStringInterpol"/> | ||
| 71 | </bygroups> | ||
| 72 | </rule> | ||
| 73 | <rule pattern="(\$\{)(\S+)(\})"> | ||
| 74 | <bygroups> | ||
| 75 | <token type="LiteralStringInterpol"/> | ||
| 76 | <token type="NameVariable"/> | ||
| 77 | <token type="LiteralStringInterpol"/> | ||
| 78 | </bygroups> | ||
| 79 | </rule> | ||
| 80 | <rule pattern="[${\\]"> | ||
| 81 | <token type="LiteralStringDouble"/> | ||
| 82 | </rule> | ||
| 83 | </state> | ||
| 84 | <state name="root"> | ||
| 85 | <rule pattern="\?>"> | ||
| 86 | <token type="CommentPreproc"/> | ||
| 87 | <pop depth="1"/> | ||
| 88 | </rule> | ||
| 89 | <rule pattern="(<<<)([\'"]?)((?:[\\_a-z]|[^\x00-\x7f])(?:[\\\w]|[^\x00-\x7f])*)(\2\n.*?\n\s*)(\3)(;?)(\n)"> | ||
| 90 | <bygroups> | ||
| 91 | <token type="LiteralString"/> | ||
| 92 | <token type="LiteralString"/> | ||
| 93 | <token type="LiteralStringDelimiter"/> | ||
| 94 | <token type="LiteralString"/> | ||
| 95 | <token type="LiteralStringDelimiter"/> | ||
| 96 | <token type="Punctuation"/> | ||
| 97 | <token type="Text"/> | ||
| 98 | </bygroups> | ||
| 99 | </rule> | ||
| 100 | <rule pattern="\s+"> | ||
| 101 | <token type="Text"/> | ||
| 102 | </rule> | ||
| 103 | <rule pattern="#.*?\n"> | ||
| 104 | <token type="CommentSingle"/> | ||
| 105 | </rule> | ||
| 106 | <rule pattern="//.*?\n"> | ||
| 107 | <token type="CommentSingle"/> | ||
| 108 | </rule> | ||
| 109 | <rule pattern="/\*\*/"> | ||
| 110 | <token type="CommentMultiline"/> | ||
| 111 | </rule> | ||
| 112 | <rule pattern="/\*\*.*?\*/"> | ||
| 113 | <token type="LiteralStringDoc"/> | ||
| 114 | </rule> | ||
| 115 | <rule pattern="/\*.*?\*/"> | ||
| 116 | <token type="CommentMultiline"/> | ||
| 117 | </rule> | ||
| 118 | <rule pattern="(->|::)(\s*)((?:[\\_a-z]|[^\x00-\x7f])(?:[\\\w]|[^\x00-\x7f])*)"> | ||
| 119 | <bygroups> | ||
| 120 | <token type="Operator"/> | ||
| 121 | <token type="Text"/> | ||
| 122 | <token type="NameAttribute"/> | ||
| 123 | </bygroups> | ||
| 124 | </rule> | ||
| 125 | <rule pattern="[~!%^&*+=|:.<>/@-]+"> | ||
| 126 | <token type="Operator"/> | ||
| 127 | </rule> | ||
| 128 | <rule pattern="\?"> | ||
| 129 | <token type="Operator"/> | ||
| 130 | </rule> | ||
| 131 | <rule pattern="[\[\]{}();,]+"> | ||
| 132 | <token type="Punctuation"/> | ||
| 133 | </rule> | ||
| 134 | <rule pattern="(class)(\s+)"> | ||
| 135 | <bygroups> | ||
| 136 | <token type="Keyword"/> | ||
| 137 | <token type="Text"/> | ||
| 138 | </bygroups> | ||
| 139 | <push state="classname"/> | ||
| 140 | </rule> | ||
| 141 | <rule pattern="(function)(\s*)(?=\()"> | ||
| 142 | <bygroups> | ||
| 143 | <token type="Keyword"/> | ||
| 144 | <token type="Text"/> | ||
| 145 | </bygroups> | ||
| 146 | </rule> | ||
| 147 | <rule pattern="(function)(\s+)(&?)(\s*)"> | ||
| 148 | <bygroups> | ||
| 149 | <token type="Keyword"/> | ||
| 150 | <token type="Text"/> | ||
| 151 | <token type="Operator"/> | ||
| 152 | <token type="Text"/> | ||
| 153 | </bygroups> | ||
| 154 | <push state="functionname"/> | ||
| 155 | </rule> | ||
| 156 | <rule pattern="(const)(\s+)((?:[\\_a-z]|[^\x00-\x7f])(?:[\\\w]|[^\x00-\x7f])*)"> | ||
| 157 | <bygroups> | ||
| 158 | <token type="Keyword"/> | ||
| 159 | <token type="Text"/> | ||
| 160 | <token type="NameConstant"/> | ||
| 161 | </bygroups> | ||
| 162 | </rule> | ||
| 163 | <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"> | ||
| 164 | <token type="Keyword"/> | ||
| 165 | </rule> | ||
| 166 | <rule pattern="(true|false|null)\b"> | ||
| 167 | <token type="KeywordConstant"/> | ||
| 168 | </rule> | ||
| 169 | <rule> | ||
| 170 | <include state="magicconstants"/> | ||
| 171 | </rule> | ||
| 172 | <rule pattern="\$\{\$+(?:[\\_a-z]|[^\x00-\x7f])(?:[\\\w]|[^\x00-\x7f])*\}"> | ||
| 173 | <token type="NameVariable"/> | ||
| 174 | </rule> | ||
| 175 | <rule pattern="\$+(?:[\\_a-z]|[^\x00-\x7f])(?:[\\\w]|[^\x00-\x7f])*"> | ||
| 176 | <token type="NameVariable"/> | ||
| 177 | </rule> | ||
| 178 | <rule pattern="(?:[\\_a-z]|[^\x00-\x7f])(?:[\\\w]|[^\x00-\x7f])*"> | ||
| 179 | <token type="NameOther"/> | ||
| 180 | </rule> | ||
| 181 | <rule pattern="(\d+\.\d*|\d*\.\d+)(e[+-]?[0-9]+)?"> | ||
| 182 | <token type="LiteralNumberFloat"/> | ||
| 183 | </rule> | ||
| 184 | <rule pattern="\d+e[+-]?[0-9]+"> | ||
| 185 | <token type="LiteralNumberFloat"/> | ||
| 186 | </rule> | ||
| 187 | <rule pattern="0[0-7]+"> | ||
| 188 | <token type="LiteralNumberOct"/> | ||
| 189 | </rule> | ||
| 190 | <rule pattern="0x[a-f0-9_]+"> | ||
| 191 | <token type="LiteralNumberHex"/> | ||
| 192 | </rule> | ||
| 193 | <rule pattern="\d[\d_]*"> | ||
| 194 | <token type="LiteralNumberInteger"/> | ||
| 195 | </rule> | ||
| 196 | <rule pattern="0b[01]+"> | ||
| 197 | <token type="LiteralNumberBin"/> | ||
| 198 | </rule> | ||
| 199 | <rule pattern="'([^'\\]*(?:\\.[^'\\]*)*)'"> | ||
| 200 | <token type="LiteralStringSingle"/> | ||
| 201 | </rule> | ||
| 202 | <rule pattern="`([^`\\]*(?:\\.[^`\\]*)*)`"> | ||
| 203 | <token type="LiteralStringBacktick"/> | ||
| 204 | </rule> | ||
| 205 | <rule pattern="""> | ||
| 206 | <token type="LiteralStringDouble"/> | ||
| 207 | <push state="string"/> | ||
| 208 | </rule> | ||
| 209 | </state> | ||
| 210 | </rules> | ||
| 211 | </lexer> \ No newline at end of file | ||
