Переглянути джерело

Fix keywords being incorrectly highlighted as function calls (#353)

Daelon Suzuka 3 роки тому
батько
коміт
fb96098c70

+ 4 - 0
syntaxes/.prettierrc.json

@@ -0,0 +1,4 @@
+{
+    "useTabs": false,
+    "tabWidth": 4
+}

+ 3 - 0
syntaxes/GDScript.tmLanguage.json

@@ -220,6 +220,9 @@
                 {
                     "include": "#keywords"
                 },
+                {
+                    "include": "#control_flow"
+                },
                 {
                     "include": "#function-call"
                 },

+ 24 - 0
syntaxes/examples/gdscript1.gd

@@ -155,6 +155,30 @@ export(test_enum) var enum_variable = test_enum.VALUE_1
 
 # ------------------------------------------------------------------------------
 
+func if_test():
+	var some_bool := true
+
+	while some_bool:
+		pass
+	while (some_bool):
+		pass
+
+	if some_bool:
+		return some_bool
+
+	if (some_bool):
+		return (some_bool)
+	elif !some_bool:
+		return !some_bool
+	elif !(some_bool):
+		return !(some_bool)
+	elif (some_bool):
+		pass
+	else:
+		pass
+
+# ------------------------------------------------------------------------------
+
 class InnerClass:
 	var some_var = 100
 	var dict = {