Skip to content

Commit

Permalink
Some enhancements on the php syntax colorizer (stevencohn#1407)
Browse files Browse the repository at this point in the history
* Some enhancements for php

* small fixes
  • Loading branch information
d-faure authored and weissm committed May 26, 2024
1 parent e954246 commit 8af0a68
Showing 1 changed file with 32 additions and 2 deletions.
34 changes: 32 additions & 2 deletions OneMore/Colorizer/Languages/php.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,43 @@
]
},
{
"pattern": "\\b(__halt_compiler|abstract|and|array|as|break|callable|case|catch|class|clone|const|continue|declare|default|die|do|echo|else|elseif|em|ty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|imple|ents|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|new|or|print|private|protected|public|require|req|ire_once|return|static|switch|throw|trait|try|unset|use|var|while|xor|yield)\\b",
"pattern": "\\b(__halt_compiler|abstract|and|as|break|callable|case|catch|class|clone|const|continue|declare|default|die|do|echo|else|elseif|em|ty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|imple|ents|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|new|or|print|private|protected|public|require|req|ire_once|return|static|switch|throw|trait|try|unset|use|var|while|xor|yield)\\b",
"captures": [
"Keyword"
]
},
{
"pattern": "\\b([0-9]{1,})\\b",
"pattern": "\\b(array|bool|double|false|float|int|integer|object|mixed|never|null|numeric|real|string|true|void)\\b",
"captures": [
"Type"
]
},
{
"pattern": "\\b(__(?>CLASS|DIR|FILE|FUNCTION|LINE|METHOD|NAMESPACE|TRAIT)__)\\b",
"captures": [
"Predefined"
]
},
{
"pattern": "\\b(0|[1-9][0-9]*(?>_[0-9]+)*)\\b",
"captures": [
"Number"
]
},
{
"pattern": "\\b(0[xX][0-9a-fA-F]+(?>_[0-9a-fA-F]+)*)\\b",
"captures": [
"Number"
]
},
{
"pattern": "\\b(0[oO]?[0-7]+(?>_[0-7]+)*)\\b",
"captures": [
"Number"
]
},
{
"pattern": "\\b(0[bB][01]+(?>_[01]+)*)\\b",
"captures": [
"Number"
]
Expand Down

0 comments on commit 8af0a68

Please sign in to comment.