X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=runtime%2Fsyntax%2Fphp.yaml;h=82fd443a6981d7a9be55e421148dab81113c2b50;hb=54c23cae72d7237bc898a59f79aad0acffdf0ffe;hp=2a1c69e71b6c991bc800d366fae50e7bfbe0e861;hpb=e289d440348a46646355018a00704a284f1bfb96;p=micro.git diff --git a/runtime/syntax/php.yaml b/runtime/syntax/php.yaml index 2a1c69e7..82fd443a 100644 --- a/runtime/syntax/php.yaml +++ b/runtime/syntax/php.yaml @@ -1,6 +1,6 @@ filetype: php -detect: +detect: filename: "\\.php[2345s~]?$" rules: @@ -12,30 +12,32 @@ rules: - special: "&[^;[[:space:]]]*;" - symbol: "[:=]" - identifier: "(alt|bgcolor|height|href|label|longdesc|name|onclick|onfocus|onload|onmouseover|size|span|src|style|target|type|value|width)=" - - constant.string: "\"[^\"]*\"" - constant.number: "(?i)#[0-9A-F]{6,6}" - constant.string.url: "(ftp(s)?|http(s)?|git|chrome)://[^ ]+" - comment: "" - default: "<\\?(php|=)\" end=\"\\?>" - identifier.class: "([a-zA-Z0-9_-]+)\\(" - - preproc: "\\b(require|include)(_once)?\\b" - - 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" + - type: "\\b(array|bool(ean)?|callable|callback|float|int(eger)?|iterable|object|resource|mixed|string|void)\\b" - identifier.class: "[a-zA-Z\\\\]+::" - identifier: "\\b([A-Z][a-zA-Z0-9_]+)\\b" - identifier: "([A-Z0-9_]+)[;|\\s|\\)|,]" - - type.keyword: "(global|public|private|protected|static|const)" - - statement: "(implements|abstract|instanceof|if|else(if)?|endif|namespace|use|as|new|throw|catch|try|while|print|(end)?(foreach)?)\\b" - - identifier: "new\\s([a-zA-Z0-9\\\\]+)" - - special: "(break|continue|goto|return)" - - constant.bool: "(true|false|null|TRUE|FALSE|NULL)" + - type.keyword: "\\b(global|final|public|private|protected|static|const|var)\\b" + - statement: "\\b(abstract|catch|class|declare|do|else(if)?|end(declare|for(each)?|if|switch|while)|finally|for(each)|function|if|interface|namespace|switch|trait|try|while)\\b" + - identifier: "\\bnew\\s+([a-zA-Z0-9\\\\]+)" + - 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|new|print|return|require(_once)?|unset|use|throw|xor|yield(\\s+from))\\b" + - constant.bool: "\\b(true|false|null|TRUE|FALSE|NULL)\\b" - constant: "[\\s|=|\\s|\\(|/|+|-|\\*|\\[]" - constant.number: "[0-9]" - identifier: "(\\$this|parent|self|\\$this->)" - symbol.operator: "(=>|===|!==|==|!=|&&|\\|\\||::|=|->|\\!)" - identifier.var: "(\\$[a-zA-Z0-9\\-_]+)" - symbol.operator: "[\\(|\\)|/|+|\\-|\\*|\\[|.|,|;]" - - constant.string: "\"(\\\\.|[^\"])*\"|'(\\\\.|[^'])*'" - - constant.specialChar: "\\\\[abfnrtv'\\\"\\\\]" + - constant.string: + start: "\"" + end: "\"" + skip: "\\\\." + rules: + - constant.specialChar: "\\\\[abfnrtv'\\\"\\\\]" - symbol.brackets: "(\\[|\\]|\\{|\\}|[()])" - comment: "(^|[[:space:]])//.*" - comment: "(^|[[:space:]])#.*"