Debian Codegraph @

runtime/syntax/php.yaml

raw
1 filetype: php
2
3 detect:
4 filename: "\\.php[2345s~]?$"
5
6 rules:
7 - symbol.operator: "<|>"
8 - error: "<[^!].*?>"
9 - symbol.tag: "(?i)<[/]?(a(bbr|cronym|ddress|pplet|rea|rticle|side|udio)?|b(ase(font)?|d(i|o)|ig|lockquote|r)?|ca(nvas|ption)|center|cite|co(de|l|lgroup)|d(ata(list)?|d|el|etails|fn|ialog|ir|l|t)|em(bed)?|fieldset|fig(caption|ure)|font|form|(i)?frame|frameset|h[1-6]|hr|i|img|in(put|s)|kbd|keygen|label|legend|li(nk)?|ma(in|p|rk)|menu(item)?|met(a|er)|nav|no(frames|script)|o(l|pt(group|ion)|utput)|p(aram|icture|re|rogress)?|q|r(p|t|uby)|s(trike)?|samp|se(ction|lect)|small|source|span|strong|su(b|p|mmary)|textarea|time|track|u(l)?|var|video|wbr)( .*|>)*?>"
10 - symbol.tag.extended: "(?i)<[/]?(body|div|html|head(er)?|footer|title|table|t(body|d|h(ead)?|r|foot))( .*|>)*?>"
11 - preproc: "(?i)<[/]?(script|style)( .*|>)*?>"
12 - preproc: "<\\?(php|=)?"
13 - preproc: "\\?>"
14 - preproc: "<!DOCTYPE.+?>"
15 - special: "&[^;[[:space:]]]*;"
16 - symbol: "[:=]"
17 - identifier: "(alt|bgcolor|height|href|label|longdesc|name|onclick|onfocus|onload|onmouseover|size|span|src|style|target|type|value|width)="
18 - constant.number: "(?i)#[0-9a-fA-F]{6,6}"
19 - constant.string.url: "(ftp(s)?|http(s)?|git|chrome)://[^ ]+"
20 - comment: "<!--.+?-->"
21 - default: "<\\?(php|=)\" end=\"\\?>"
22 - identifier.class: "([a-zA-Z0-9_-]+)\\("
23 - type: "\\b(array|bool|callable|float|int|iterable|object|mixed|string|void)\\b"
24 - identifier.class: "[a-zA-Z\\\\]+::"
25 - identifier: "\\b([A-Z][a-zA-Z0-9_]+)\\b"
26 - identifier: "([A-Z0-9_]+)[;|\\s|\\)|,]"
27 - type.keyword: "\\b(global|final|public|private|protected|static|const|var)\\b"
28 - statement: "\\b(abstract|catch|class|declare|do|else(if)?|end(declare|for(each)?|if|switch|while)|enum|finally|for(each)|function|if|interface|namespace|switch|trait|try|while)\\b"
29 - identifier: "\\bnew\\s+([a-zA-Z0-9\\\\]+)"
30 - special: "\\b(as|and|break|case|clone|continue|default|die|fn|echo|empty|eval|exit|extends|goto|or|include(_once)?|implements|instanceof|insteadof|isset|list|match|new|print|return|require(_once)?|unset|use|throw|xor|yield(\\s+from))\\b"
31 - constant.bool: "\\b(true|false|null|TRUE|FALSE|NULL)\\b"
32 - constant: "[\\s|=|\\s|\\(|/|+|-|\\*|\\[]"
33 - constant.number: "[0-9]"
34 - identifier: "(\\$this|parent|self|\\$this->)"
35 - symbol.operator: "(=>|===|!==|==|!=|&&|\\|\\||::|=|->|\\!)"
36 - identifier.var: "(\\$[a-zA-Z0-9\\-_]+)"
37 - symbol.operator: "[\\(|\\)|/|+|\\-|\\*|\\[|.|,|;]"
38 - symbol.brackets: "(\\[|\\]|\\{|\\}|[()])"
39
40 - comment:
41 start: "(^|[[:space:]])*(//|#)"
42 end: "$"
43 rules: []
44 - comment:
45 start: "/\\*"
46 end: "\\*/"
47 rules: []
48
49 - constant.string:
50 start: "\""
51 end: "\""
52 skip: "\\\\."
53 rules:
54 - constant.specialChar: "\\\\[abfnrtv'\\\"\\\\]"
55 - constant.string:
56 start: "'"
57 end: "'"
58 skip: "\\\\."
59 rules:
60 - constant.specialChar: "\\\\[abfnrtv'\\\"\\\\]"