Skip to content

Commit 1160290

Browse files
committed
Fix too short class names getting constant highlighted
1 parent d0a00da commit 1160290

File tree

1 file changed

+1
-1
lines changed
  • core/src/main/kotlin/dev/fishies/coho/core/highlighting

1 file changed

+1
-1
lines changed

core/src/main/kotlin/dev/fishies/coho/core/highlighting/Gdscript.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ fun createGdscriptGrammar() = grammar(
7676
token("constant", pattern(compile("PI|TAU|NAN|INF"))),
7777
token("boolean", pattern(compile("true|false"))),
7878
token("keyword", pattern(compile("\\b(?:$keywords)\\b"))),
79-
token("constant", pattern(compile("\\b[A-Z_][A-Z0-9_]*\\b"), false, true)),
79+
token("constant", pattern(compile("\\b[A-Z_][A-Z0-9_]{4,}\\b"), false, true)),
8080
token("pascal-class-name", pattern(compile("\\b[A-Z][a-zA-Z0-9_]*\\b"), false, true, "class-name")),
8181
token("variant-class-name", pattern(compile("\\b(?:$variantTypes)\\b"), false, true, "class-name")),
8282
token("function", pattern(compile("$identifier(?=\\s*\\()"))),

0 commit comments

Comments
 (0)