mirror of
https://github.com/zyedidia/micro.git
synced 2026-02-05 14:40:20 +09:00
PHP: Add enum and keyword, and modify types (#2204)
* Add enum keyword to PHP (8.1) syntax * Specify only keywords that are valid as type declarations as PHP types boolean, integer and resource are not valid type name. * Add match keyword to PHP (8.2) syntax
This commit is contained in:
@@ -17,14 +17,14 @@ rules:
|
||||
- comment: "<!--.+?-->"
|
||||
- default: "<\\?(php|=)\" end=\"\\?>"
|
||||
- identifier.class: "([a-zA-Z0-9_-]+)\\("
|
||||
- type: "\\b(array|bool(ean)?|callable|callback|float|int(eger)?|iterable|object|resource|mixed|string|void)\\b"
|
||||
- type: "\\b(array|bool|callable|float|int|iterable|object|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: "\\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"
|
||||
- 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"
|
||||
- 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"
|
||||
- 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"
|
||||
- constant.bool: "\\b(true|false|null|TRUE|FALSE|NULL)\\b"
|
||||
- constant: "[\\s|=|\\s|\\(|/|+|-|\\*|\\[]"
|
||||
- constant.number: "[0-9]"
|
||||
|
||||
Reference in New Issue
Block a user