Skip to content

Commit

Permalink
Fix colorization for top-level declarations (#148)
Browse files Browse the repository at this point in the history
Fix colorization

Co-authored-by: Pranay Agarwal <[email protected]>
  • Loading branch information
panopticoncentral and PranayAgarwal authored Oct 3, 2022
1 parent 1eb0810 commit b997653
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 5 deletions.
10 changes: 5 additions & 5 deletions syntaxes/hack.json
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@
"name": "meta.function-call.invoke.php"
},
"interface": {
"begin": "^(?i)\\s*(?:(public|internal)?\\s+)(interface)\\b",
"begin": "^(?i)\\s*(?:(public|internal)\\s+)?(interface)\\b",
"beginCaptures": {
"1": {
"name": "storage.modifier.php"
Expand Down Expand Up @@ -697,7 +697,7 @@
]
},
{
"begin": "(?i)^\\s*(?:(public|internal)?\\s+)(enum)\\s+(class)\\s+([a-z0-9_]+)\\s*:?",
"begin": "(?i)^\\s*(?:(public|internal)\\s+)?(enum)\\s+(class)\\s+([a-z0-9_]+)\\s*:?",
"beginCaptures": {
"1": {
"name": "storage.modifier.php"
Expand Down Expand Up @@ -725,7 +725,7 @@
]
},
{
"begin": "(?i)^\\s*(?:(public|internal)?\\s+)(enum)\\s+([a-z0-9_]+)\\s*:?",
"begin": "(?i)^\\s*(?:(public|internal)\\s+)?(enum)\\s+([a-z0-9_]+)\\s*:?",
"beginCaptures": {
"1": {
"name": "storage.modifier.php"
Expand All @@ -749,7 +749,7 @@
]
},
{
"begin": "(?i)^\\s*(?:(public|internal)?\\s+)(trait)\\s+([a-z0-9_]+)\\s*",
"begin": "(?i)^\\s*(?:(public|internal)\\s+)?(trait)\\s+([a-z0-9_]+)\\s*",
"beginCaptures": {
"1": {
"name": "storage.modifier.php"
Expand Down Expand Up @@ -1022,7 +1022,7 @@
"name": "keyword.control.exception.php"
},
{
"begin": "(?i)\\s*(?:(public|internal)?\\s+)(function)\\s*(?=\\()",
"begin": "(?i)\\s*(?:(public|internal)\\s+)?(function)\\s*(?=\\()",
"beginCaptures": {
"1": {
"name": "storage.modifier.php"
Expand Down
24 changes: 24 additions & 0 deletions syntaxes/test/modules.hack
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,27 @@ internal interface foo {
public interface foo {
}

interface foo {
}

internal enum foo {
}

public enum foo {
}

enum foo {
}

internal enum class foo {
}

public enum class foo {
}

enum class foo {
}

internal trait foo {
internal int $x;
internal function y(): void {
Expand All @@ -32,6 +41,9 @@ internal trait foo {
public trait foo {
}

trait foo {
}

internal class foo {
internal int $x;
internal function y(): void {
Expand All @@ -40,3 +52,15 @@ internal class foo {

public class foo {
}

class foo {
}

internal function foo(): void {
}

public function foo(): void {
}

function foo(): void {
}

0 comments on commit b997653

Please sign in to comment.