Skip to content

Commit

Permalink
[Syntax highlighting] support implements on traits (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
scotchval authored and PranayAgarwal committed Nov 20, 2019
1 parent 4cdd005 commit 8adf0a1
Showing 1 changed file with 55 additions and 45 deletions.
100 changes: 55 additions & 45 deletions syntaxes/hack.json
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,55 @@
}
]
},
"implements": {
"patterns": [
{
"begin": "(?i)(implements)\\s+",
"beginCaptures": {
"1": {
"name": "storage.modifier.implements.php"
}
},
"end": "(?i)(?=[;{])",
"patterns": [
{
"include": "#comments"
},
{
"begin": "(?i)(?=[a-z0-9_\\\\]+)",
"contentName": "meta.other.inherited-class.php",
"end": "(?i)(?:\\s*(?:,|(?=[^a-z0-9_\\\\\\s]))\\s*)",
"patterns": [
{
"begin": "(?i)(?=\\\\?[a-z_0-9]+\\\\)",
"end": "(?i)([a-z_][a-z_0-9]*)?(?=[^a-z0-9_\\\\])",
"endCaptures": {
"1": {
"name": "entity.other.inherited-class.php"
}
},
"patterns": [
{
"include": "#namespace"
}
]
},
{
"include": "#class-builtin"
},
{
"include": "#namespace"
},
{
"match": "(?i)[a-z_][a-z_0-9]*",
"name": "entity.other.inherited-class.php"
}
]
}
]
}
]
},
"attributes": {
"patterns": [
{
Expand Down Expand Up @@ -693,6 +742,9 @@
},
{
"include": "#generics"
},
{
"include": "#implements"
}
]
},
Expand Down Expand Up @@ -781,6 +833,9 @@
{
"include": "#generics"
},
{
"include": "#implements"
},
{
"begin": "(?i)(extends)\\s+",
"beginCaptures": {
Expand Down Expand Up @@ -816,51 +871,6 @@
"name": "entity.other.inherited-class.php"
}
]
},
{
"begin": "(?i)(implements)\\s+",
"beginCaptures": {
"1": {
"name": "storage.modifier.implements.php"
}
},
"end": "(?i)(?=[;{])",
"patterns": [
{
"include": "#comments"
},
{
"begin": "(?i)(?=[a-z0-9_\\\\]+)",
"contentName": "meta.other.inherited-class.php",
"end": "(?i)(?:\\s*(?:,|(?=[^a-z0-9_\\\\\\s]))\\s*)",
"patterns": [
{
"begin": "(?i)(?=\\\\?[a-z_0-9]+\\\\)",
"end": "(?i)([a-z_][a-z_0-9]*)?(?=[^a-z0-9_\\\\])",
"endCaptures": {
"1": {
"name": "entity.other.inherited-class.php"
}
},
"patterns": [
{
"include": "#namespace"
}
]
},
{
"include": "#class-builtin"
},
{
"include": "#namespace"
},
{
"match": "(?i)[a-z_][a-z_0-9]*",
"name": "entity.other.inherited-class.php"
}
]
}
]
}
]
},
Expand Down

0 comments on commit 8adf0a1

Please sign in to comment.