]> git.lizzy.rs Git - micro.git/blob - runtime/syntax/php.yaml
Merge pull request #1067 from sum01/issue-1066
[micro.git] / runtime / syntax / php.yaml
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     - special: "&[^;[[:space:]]]*;"
13     - symbol: "[:=]"
14     - identifier: "(alt|bgcolor|height|href|label|longdesc|name|onclick|onfocus|onload|onmouseover|size|span|src|style|target|type|value|width)="
15     - constant.string: "\"[^\"]*\""
16     - constant.number: "(?i)#[0-9A-F]{6,6}"
17     - constant.string.url: "(ftp(s)?|http(s)?|git|chrome)://[^  ]+"
18     - comment: "<!--.+?-->"
19     - default: "<\\?(php|=)\" end=\"\\?>"
20     - identifier.class: "([a-zA-Z0-9_-]+)\\("
21     - preproc: "\\b(require|include)(_once)?)\\b"
22     - type: "\\b(var|class|extends|function|echo|case|default|exit|switch|extends|as|define|do|declare|in|trait|interface|[E|e]xception|array|int|string|bool|iterable|void)\\b"
23     - identifier.class: "[a-zA-Z\\\\]+::"
24     - identifier: "([A-Z][a-zA-Z0-9_]+)\\s"
25     - identifier: "([A-Z0-9_]+)[;|\\s|\\)|,]"
26     - type.keyword: "(global|public|private|protected|static|const)"
27     - statement: "(implements|abstract|instanceof|if|else(if)?|endif|namespace|use|as|new|throw|catch|try|while|print|(end)?(foreach)?)\\b"
28     - identifier: "new\\s([a-zA-Z0-9\\\\]+)"
29     - special: "(break|continue|goto|return)"
30     - constant.bool: "(true|false|null|TRUE|FALSE|NULL)"
31     - constant: "[\\s|=|\\s|\\(|/|+|-|\\*|\\[]"
32     - constant.number: "[0-9]"
33     - identifier: "(\\$this|parent|self|\\$this->)"
34     - symbol.operator: "(=>|===|!==|==|!=|&&|\\|\\||::|=|->|\\!)"
35     - identifier.var: "(\\$[a-zA-Z0-9\\-_]+)"
36     - symbol.operator: "[\\(|\\)|/|+|\\-|\\*|\\[|.|,|;]"
37     - constant.string: "\"(\\\\.|[^\"])*\"|'(\\\\.|[^'])*'"
38     - constant.specialChar: "\\\\[abfnrtv'\\\"\\\\]"
39     - symbol.brackets: "(\\[|\\]|\\{|\\}|[()])"
40     - comment: "(^|[[:space:]])//.*"
41     - comment: "(^|[[:space:]])#.*"
42     - comment:
43         start: "/\\*"
44         end: "\\*/"
45         rules: []
46
47     - preproc: "<\\?(php|=)?"
48     - preproc: "\\?>"
49     - preproc: "<!DOCTYPE.+?>"