Skip to content

Commit fae5cd2

Browse files
committed
Fixed highlighting for constants
1 parent 32735c3 commit fae5cd2

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

syntaxes/zephir.tmLanguage.json

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,9 @@
458458
}
459459
]
460460
},
461+
{
462+
"include": "#constants"
463+
},
461464
{
462465
"include": "#scope-resolution"
463466
},
@@ -707,9 +710,6 @@
707710
}
708711
]
709712
},
710-
{
711-
"include": "#constants"
712-
},
713713
{
714714
"include": "#punctuation-comma"
715715
}
@@ -825,8 +825,23 @@
825825
"name": "constant.language.zephir"
826826
},
827827
{
828-
"match": "\\b[_A-Z][_A-Z0-9]*\\b",
829-
"name": "variable.other.constant.zephir"
828+
"match": "(?!\\|\\$|->)(?:::)?\\s*\\b([_A-Z][_A-Z0-9]*)\\b(?=\\s|;|$)",
829+
"captures":{
830+
"1": {
831+
"name": "constant.language.zephir"
832+
}
833+
}
834+
},
835+
{
836+
"match": "(?!\\|\\$|->)(const)\\s*\\b([_A-Z][_A-Z0-9]*)\\b(?=\\s|;|=|$)",
837+
"captures":{
838+
"1": {
839+
"name": "storage.modifier.zephir"
840+
},
841+
"2": {
842+
"name": "constant.language.zephir"
843+
}
844+
}
830845
}
831846
]
832847
},

0 commit comments

Comments
 (0)