소스 검색

Overhaul syntax highlighting (#342)

Co-authored-by: Hugo Locurcio <[email protected]>
Daelon Suzuka 3 년 전
부모
커밋
78e37e8016

+ 24 - 0
configurations/gdresource-configuration.json

@@ -0,0 +1,24 @@
+{
+    "comments": {
+        "lineComment": ";"
+    },
+    "brackets": [
+        ["(", ")"],
+        ["[", "]"],
+        ["{", "}"]
+    ],
+    "autoClosingPairs": [
+        ["'", "'"],
+        ["\"", "\""],
+        ["(", ")"],
+        ["[", "]"],
+        ["{", "}"]
+    ],
+    "surroundingPairs": [
+        ["'", "'"],
+        ["\"", "\""],
+        ["(", ")"],
+        ["[", "]"],
+        ["{", "}"]
+    ]
+}

+ 25 - 0
configurations/gdshader-configuration.json

@@ -0,0 +1,25 @@
+{
+    "comments": {
+        "lineComment": "//",
+        "blockComment": ["/*", "*/"]
+    },
+    "brackets": [
+        ["(", ")"],
+        ["[", "]"],
+        ["{", "}"]
+    ],
+    "autoClosingPairs": [
+        ["'", "'"],
+        ["\"", "\""],
+        ["(", ")"],
+        ["[", "]"],
+        ["{", "}"]
+    ],
+    "surroundingPairs": [
+        ["'", "'"],
+        ["\"", "\""],
+        ["(", ")"],
+        ["[", "]"],
+        ["{", "}"]
+    ]
+}

+ 33 - 7
package.json

@@ -27,6 +27,8 @@
 	"activationEvents": [
 		"workspaceContains:project.godot",
 		"onLanguage:gdscript",
+		"onLanguage:gdshader",
+		"onLanguage:gdresource",
 		"onDebugResolve:godot"
 	],
 	"main": "./out/extension.js",
@@ -171,23 +173,47 @@
 				"configuration": "./configurations/gdscript-configuration.json"
 			},
 			{
-				"id": "properties",
+				"id": "gdresource",
+				"aliases": [
+					"GDResource",
+					"gdresource"
+				],
 				"extensions": [
-					"cfg",
+					"godot",
 					"tres",
 					"tscn",
-					"godot",
+					"import",
 					"gdns",
-					"gdnlib",
-					"import"
-				]
-			}
+					"gdnlib"
+				],
+				"configuration": "./configurations/gdresource-configuration.json"
+			},
+            {
+				"id": "gdshader",
+				"aliases": [
+					"gdshader"
+				],
+				"extensions": [
+					".gdshader"
+				],
+				"configuration": "./configurations/gdshader-configuration.json"
+            }
 		],
 		"grammars": [
 			{
 				"language": "gdscript",
 				"scopeName": "source.gdscript",
 				"path": "./syntaxes/GDScript.tmLanguage.json"
+			},
+			{
+				"language": "gdresource",
+				"scopeName": "source.gdresource",
+				"path": "./syntaxes/GDResource.tmLanguage.json"
+			},
+			{
+				"language": "gdshader",
+				"scopeName": "source.gdshader",
+				"path": "./syntaxes/GDShader.tmLanguage.json"
 			}
 		],
 		"snippets": [

+ 329 - 0
syntaxes/GDResource.tmLanguage.json

@@ -0,0 +1,329 @@
+{
+    "version": "v0.6.0",
+    "scopeName": "source.gdresource",
+    "uuid": "e076faa2-3c52-42fa-a8e6-9a7c453c1a5b",
+    "information_for_contributors": [
+        "aster: [email protected]"
+    ],
+    "patterns": [
+        {
+            "include": "#embedded_shader"
+        },
+        {
+            "include": "#embedded_gdscript"
+        },
+        {
+            "include": "#comment"
+        },
+        {
+            "include": "#heading"
+        },
+        {
+            "include": "#key_value"
+        }
+    ],
+    "repository": {
+        "comment": {
+            "captures": {
+                "1": {
+                    "name": "punctuation.definition.comment.gdresource"
+                }
+            },
+            "match": "(;).*$\\n?",
+            "name": "comment.line.gdresource"
+        },
+        "embedded_shader": {
+            "name": "meta.embedded.block.gdshader",
+            "begin": "(code) = \"",
+            "end": "\"",
+            "beginCaptures": {
+                "1": {
+                    "name": "variable.other.property.gdresource"
+                }
+            },
+            "patterns": [
+                {
+                    "include": "source.gdshader"
+                }
+            ]
+        },
+        "embedded_gdscript": {
+            "comment": "meta.embedded.block.gdscript",
+            "begin": "(script/source) = \"",
+            "end": "\"",
+            "beginCaptures": {
+                "1": {
+                    "name": "variable.other.property.gdresource"
+                }
+            },
+            "patterns": [
+                {
+                    "include": "source.gdscript"
+                }
+            ]
+        },
+        "heading": {
+            "begin": "\\[([a-z_]*)\\s?",
+            "beginCaptures": {
+                "1": {
+                    "name": "keyword.control.gdresource"
+                }
+            },
+            "end": "\\]",
+            "patterns": [
+                {
+                    "include": "#heading_properties"
+                },
+                {
+                    "include": "#data"
+                }
+            ]
+        },
+        "heading_properties": {
+            "patterns": [
+                {
+                    "name": "invalid.deprecated.noValue.gdresource",
+                    "match": "(\\s*[A-Za-z_\\-][A-Za-z0-9_\\-]*\\s*=)(?=\\s*$)"
+                },
+                {
+                    "begin": "\\s*([A-Za-z_-][^\\s]*|\".+\"|'.+'|[0-9]+)\\s*(=)\\s*",
+                    "beginCaptures": {
+                        "1": {
+                            "name": "variable.other.property.gdresource"
+                        },
+                        "2": {
+                            "name": "punctuation.definition.keyValue.gdresource"
+                        }
+                    },
+                    "end": "($|(?==)|\\,?|\\s*(?=\\}))",
+                    "patterns": [
+                        {
+                            "include": "#data"
+                        }
+                    ]
+                }
+            ]
+        },
+        "key_value": {
+            "patterns": [
+                {
+                    "name": "invalid.deprecated.noValue.gdresource",
+                    "match": "(\\s*[A-Za-z_\\-][A-Za-z0-9_\\-]*\\s*=)(?=\\s*$)"
+                },
+                {
+                    "begin": "\\s*([A-Za-z_-][^\\s]*|\".+\"|'.+'|[0-9]+)\\s*(=)\\s*",
+                    "beginCaptures": {
+                        "1": {
+                            "name": "variable.other.property.gdresource"
+                        },
+                        "2": {
+                            "name": "punctuation.definition.keyValue.gdresource"
+                        }
+                    },
+                    "end": "($|(?==)|\\,|\\s*(?=\\}))",
+                    "patterns": [
+                        {
+                            "include": "#data"
+                        }
+                    ]
+                }
+            ]
+        },
+        "data": {
+            "patterns": [
+                {
+                    "include": "#comment"
+                },
+                {
+                    "begin": "(?<!\\w)(\\{)\\s*",
+                    "beginCaptures": {
+                        "1": {
+                            "name": "punctuation.definition.table.inline.gdresource"
+                        }
+                    },
+                    "end": "\\s*(\\})(?!\\w)",
+                    "endCaptures": {
+                        "1": {
+                            "name": "punctuation.definition.table.inline.gdresource"
+                        }
+                    },
+                    "patterns": [
+                        {
+                            "include": "#key_value"
+                        },
+                        {
+                            "include": "#data"
+                        }
+                    ]
+                },
+                {
+                    "begin": "(?<!\\w)(\\[)\\s*",
+                    "beginCaptures": {
+                        "1": {
+                            "name": "punctuation.definition.array.gdresource"
+                        }
+                    },
+                    "end": "\\s*(\\])(?!\\w)",
+                    "endCaptures": {
+                        "1": {
+                            "name": "punctuation.definition.array.gdresource"
+                        }
+                    },
+                    "patterns": [
+                        {
+                            "include": "#data"
+                        }
+                    ]
+                },
+                {
+                    "name": "string.quoted.triple.basic.block.gdresource",
+                    "begin": "\"\"\"",
+                    "end": "\"\"\"",
+                    "patterns": [
+                        {
+                            "match": "\\\\([btnfr\"\\\\\\n/ ]|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})",
+                            "name": "constant.character.escape.gdresource"
+                        },
+                        {
+                            "match": "\\\\[^btnfr/\"\\\\\\n]",
+                            "name": "invalid.illegal.escape.gdresource"
+                        }
+                    ]
+                },
+                {
+                    "name": "support.function.any-method.gdresource",
+                    "match": "\"res:\\/\\/[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*\""
+                },
+                {
+                    "name": "support.class.library.gdresource",
+                    "match": "(?<=type=)\"[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*\""
+                },
+                {
+                    "name": "constant.character.escape.gdresource",
+                    "match": "(?<=NodePath\\(|parent=|name=)\"[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*\""
+                },
+                {
+                    "name": "string.quoted.double.basic.line.gdresource",
+                    "match": "\"[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*\"",
+                    "patterns": [
+                        {
+                            "match": "\\\\([btnfr\"\\\\\\n/ ]|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})",
+                            "name": "constant.character.escape.gdresource"
+                        },
+                        {
+                            "match": "\\\\[^btnfr/\"\\\\\\n]",
+                            "name": "invalid.illegal.escape.gdresource"
+                        }
+                    ]
+                },
+                {
+                    "name": "invalid.illegal.escape.gdresource",
+                    "begin": "'''",
+                    "end": "'''"
+                },
+                {
+                    "name": "string.quoted.single.literal.line.gdresource",
+                    "match": "'.*?'"
+                },
+                {
+                    "match": "(?<!\\w)(true|false)(?!\\w)",
+                    "captures": {
+                        "1": {
+                            "name": "constant.language.gdresource"
+                        }
+                    }
+                },
+                {
+                    "match": "(?<!\\w)([\\+\\-]?(0|([1-9](([0-9]|_[0-9])+)?))(?:(?:\\.(0|([1-9](([0-9]|_[0-9])+)?)))?[eE][\\+\\-]?[1-9]_?[0-9]*|(?:\\.[0-9_]*)))(?!\\w)",
+                    "captures": {
+                        "1": {
+                            "name": "constant.numeric.float.gdresource"
+                        }
+                    }
+                },
+                {
+                    "match": "(?<!\\w)((?:[\\+\\-]?(0|([1-9](([0-9]|_[0-9])+)?))))(?!\\w)",
+                    "captures": {
+                        "1": {
+                            "name": "constant.numeric.integer.gdresource"
+                        }
+                    }
+                },
+                {
+                    "match": "(?<!\\w)([\\+\\-]?inf)(?!\\w)",
+                    "captures": {
+                        "1": {
+                            "name": "constant.numeric.inf.gdresource"
+                        }
+                    }
+                },
+                {
+                    "match": "(?<!\\w)([\\+\\-]?nan)(?!\\w)",
+                    "captures": {
+                        "1": {
+                            "name": "constant.numeric.nan.gdresource"
+                        }
+                    }
+                },
+                {
+                    "match": "(?<!\\w)((?:0x(([0-9a-fA-F](([0-9a-fA-F]|_[0-9a-fA-F])+)?))))(?!\\w)",
+                    "captures": {
+                        "1": {
+                            "name": "constant.numeric.hex.gdresource"
+                        }
+                    }
+                },
+                {
+                    "match": "(?<!\\w)(0o[0-7](_?[0-7])*)(?!\\w)",
+                    "captures": {
+                        "1": {
+                            "name": "constant.numeric.oct.gdresource"
+                        }
+                    }
+                },
+                {
+                    "match": "(?<!\\w)(0b[01](_?[01])*)(?!\\w)",
+                    "captures": {
+                        "1": {
+                            "name": "constant.numeric.bin.gdresource"
+                        }
+                    }
+                },
+                {
+                    "begin": "(?<!\\w)(Vector2|Vector2i|Vector3|Vector3i|Color|Rect2|Rect2i|Array|Basis|Dictionary|Plane|Quat|RID|Rect3|Transform|Transform2D|Transform3D|AABB|String|Color|NodePath|Object|PoolByteArray|PoolIntArray|PoolRealArray|PoolStringArray|PoolVector2Array|PoolVector3Array|PoolColorArray|bool|int|float|StringName|Quaternion|PackedByteArray|PackedInt32Array|PackedInt64Array|PackedFloat32Array|PackedFloat64Array|PackedStringArray|PackedVector2Array|PackedVector2iArray|PackedVector3Array|PackedVector3iArray|PackedColorArray)(\\()\\s?",
+                    "beginCaptures": {
+                        "1": {
+                            "name": "support.class.library.gdresource"
+                        }
+                    },
+                    "end": "\\s?(\\))",
+                    "patterns": [
+                        {
+                            "include": "#key_value"
+                        },
+                        {
+                            "include": "#data"
+                        }
+                    ]
+                },
+                {
+                    "begin": "(?<!\\w)(ExtResource|SubResource)(\\()\\s?",
+                    "beginCaptures": {
+                        "1": {
+                            "name": "keyword.control.gdresource"
+                        }
+                    },
+                    "end": "\\s?(\\))",
+                    "patterns": [
+                        {
+                            "include": "#key_value"
+                        },
+                        {
+                            "include": "#data"
+                        }
+                    ]
+                }
+            ]
+        }
+    }
+}

+ 543 - 327
syntaxes/GDScript.tmLanguage.json

@@ -1,351 +1,567 @@
 {
-  "fileTypes": [
-    "gd"
-  ],
-  "scopeName": "source.gdscript",
-  "name": "GDScript",
-  "patterns": [
-    { "include": "#base_expression" },
-    { "include": "#logic_op" },
-    { "include": "#compare_op" },
-    { "include": "#arithmetic_op" },
-    { "include": "#assignment_op" },
-    { "include": "#keywords" },
-    { "include": "#self" },
-    { "include": "#const_def" },
-    { "include": "#type_declear"},
-    { "include": "#class_def" },
-    { "include": "#class_name"},
-    { "include": "#builtin_func" },
-    { "include": "#builtin_get_node_shorthand" },
-    { "include": "#builtin_classes" },
-    { "include": "#const_vars" },
-    { "include": "#class_new"},
-    { "include": "#class_is"},
-    { "include": "#class_enum"},
-    { "include": "#function-declaration" },
-    { "include": "#function-return-type" },
-    { "include": "#any-method" },
-    { "include": "#any-property" },
-    { "include": "#extends" },
-    { "include": "#pascal_case_class" }
-  ],
-  "repository": {
-    "comment": {
-      "captures": {
-        "1": {
-          "name": "punctuation.definition.comment.number-sign.gdscript"
-        }
-      },
-      "match": "(#).*$\\n?",
-      "name": "comment.line.number-sign.gdscript"
-    },
-    "strings": {
-      "patterns": [{
-          "begin": "\"",
-          "end": "\"",
-          "patterns": [
-            {  "name": "constant.character.escape.untitled",
-                "match": "\\\\."
-            }
-          ],
-          "name": "string.quoted.double.gdscript"
+    "fileTypes": [
+        "gd"
+    ],
+    "scopeName": "source.gdscript",
+    "name": "GDScript",
+    "patterns": [
+        {
+            "include": "#base_expression"
         },
         {
-          "begin": "'",
-          "end": "'",
-          "patterns": [
-            {  "name": "constant.character.escape.untitled",
-                "match": "\\\\."
-            }
-          ],
-          "name": "string.quoted.single.gdscript"
+            "include": "#logic_op"
         },
         {
-          "begin": "@\"",
-          "end": "\"",
-          "patterns": [
-            {  "name": "constant.character.escape.untitled",
-                "match": "\\."
-            }
-          ],
-          "name": "string.nodepath.gdscript"
-        }
-      ]
-    },
-    "self": {
-      "match": "\\bself\\b",
-      "name": "variable.language.gdscript"
-    },
-    "base_expression": {
-      "patterns": [
-        { "include": "#strings"},
-        { "include": "#comment"},
-        { "include": "#letter"},
-        { "include": "#numbers"},
-        { "include": "#line-continuation"}
-      ]
-    },
-    "logic_op": {
-      "match": "\\b(and|or|not)\\b",
-      "name": "keyword.operator.wordlike.gdscript"
-    },
-    "compare_op": {
-      "match": "<=|>=|==|<|>|!=",
-      "name": "keyword.operator.comparison.gdscript"
-    },
-    "arithmetic_op": {
-      "match": "\\+=|-=|\\*=|/=|%=|&=|\\|=|\\*|/|%|\\+|-|<<|>>|&|\\||\\^|~",
-      "name": "keyword.operator.arithmetic.gdscript"
-    },
-    "assignment_op": {
-      "match": "=",
-      "name": "keyword.operator.assignment.gdscript"
-    },
-
-    "keywords": {
-      "patterns": [
+            "include": "#compare_op"
+        },
         {
-          "match": "\\b(?i:func|class|class_name|extends|is|in|onready|tool|static|export|setget|const|var|as|void|enum|preload|assert|yield|signal|breakpoint|rpc|sync|remote|master|puppet|slave|remotesync|mastersync|puppetsync|in)\\b",
-          "name": "keyword.language.gdscript"
+            "include": "#arithmetic_op"
         },
         {
-          "match": "\\b(?i:if|elif|else|for|while|break|continue|pass|return|match)\\b",
-          "name": "keyword.control"
-        }
-      ]
-    },
-    "letter": {
-        "match": "\\b(?i:true|false|null)\\b",
-        "name": "constant.language.gdscript"
-    },
-    "numbers": {
-      "patterns": [{
-          "match": "\\b(?i:0x\\h*)\\b",
-          "name": "constant.numeric.integer.hexadecimal.gdscript"
+            "include": "#assignment_op"
         },
         {
-          "match": "\\b(?i:(\\d+\\.\\d*(e[\\-\\+]?\\d+)?))\\b",
-          "name": "constant.numeric.float.gdscript"
+            "include": "#control_flow"
         },
         {
-          "match": "\\b(?i:(\\.\\d+(e[\\-\\+]?\\d+)?))\\b",
-          "name": "constant.numeric.float.gdscript"
+            "include": "#decorators"
         },
         {
-          "match": "\\b(?i:(\\d+e[\\-\\+]?\\d+))\\b",
-          "name": "constant.numeric.float.gdscript"
+            "include": "#keywords"
         },
         {
-          "match": "\\b\\d+\\b",
-          "name": "constant.numeric.integer.gdscript"
-        }
-      ]
-    },
-    "const_def": {
-      "match": "\\b(?i:(const))\\s+([a-zA-Z_][a-zA-Z_0-9]*)",
-      "captures": {
-        "1": { "name": "storage.type.const.gdscript" },
-        "2": { "name": "constant.language.gdscript" }
-      }
-    },
-    "var_def": {
-      "match": "\\b(?i:(var))\\s+([a-zA-Z_][a-zA-Z_0-9]*)",
-      "captures": {
-        "1": { "name": "storage.type.var.gdscript" },
-        "2": { "name": "variable.language.gdscript" }
-      }
-    },
-    "type_declear": {
-      "match": "\\:\\s*([a-zA-Z_][a-zA-Z_0-9]*)",
-      "captures": {
-        "1": { "name": "entity.name.type.class.gdscript" }
-      }
-    },
-    "function-return-type": {
-      "match": "\\)\\s*\\-\\>\\s*([a-zA-Z_][a-zA-Z_0-9]*)\\s*\\:",
-      "captures": {
-        "1": { "name": "entity.name.type.class.gdscript" }
-      }
-    },
-    "class_def": {
-      "captures": {
-        "1": { "name": "entity.name.type.class.gdscript" },
-        "2": { "name": "class.other.gdscript" }
-      },
-      "match": "(?<=^class)\\s+([a-zA-Z_]\\w*)\\s*(?=:)"
-    },
-    "class_new": {
-      "captures": {
-        "1": { "name": "entity.name.type.class.gdscript" },
-        "2": { "name": "storage.type.new.gdscript" }
-      },
-      "match": "\\b([a-zA-Z_][a-zA-Z_0-9]*).(new)\\("
-    },
-    "class_is": {
-      "captures": {
-        "1": { "name": "storage.type.is.gdscript" },
-        "2": { "name": "entity.name.type.class.gdscript" }
-      },
-      "match": "\\s+(is)\\s+([a-zA-Z_][a-zA-Z_0-9]*)"
-    },
-    "class_enum": {
-      "captures": {
-        "1": { "name": "entity.name.type.class.gdscript" },
-        "2": { "name": "constant.language.gdscript" }
-      },
-      "match": "\\b([A-Z][a-zA-Z_0-9]*)\\.([A-Z_0-9]+)"
-    },
-    "class_name": {
-      "captures": {
-        "1": { "name": "entity.name.type.class.gdscript" },
-        "2": { "name": "class.other.gdscript" }
-      },
-      "match": "(?<=class_name)\\s+([a-zA-Z_][a-zA-Z_0-9]*(\\.([a-zA-Z_][a-zA-Z_0-9]*))?)"
-    },
-    "extends": {
-      "match": "(?<=extends)\\s+[a-zA-Z_][a-zA-Z_0-9]*(\\.([a-zA-Z_][a-zA-Z_0-9]*))?",
-      "name": "entity.other.inherited-class.gdscript"
-    },
-    "builtin_func": {
-      "match": "(?<![^.]\\.|:)\\b(sin|cos|tan|sinh|cosh|tanh|asin|acos|atan|atan2|sqrt|fmod|fposmod|floor|ceil|round|abs|sign|pow|log|exp|is_nan|is_inf|ease|decimals|stepify|lerp|dectime|randomize|randi|randf|rand_range|seed|rand_seed|deg2rad|rad2deg|linear2db|db2linear|max|min|clamp|nearest_po2|weakref|funcref|convert|typeof|type_exists|char|str|print|printt|prints|printerr|printraw|var2str|str2var|var2bytes|bytes2var|range|load|inst2dict|dict2inst|hash|Color8|print_stack|instance_from_id|preload|yield|assert)\\b(?=(\\()([^)]*)(\\)))",
-      "name": "support.function.builtin.gdscript"
-    },
-    "builtin_get_node_shorthand": {
-      "match": "\\$(((?<quote>\"|')((\\.\\.\\/)+|\\/)?)[0-9A-Za-z_ ]+(\\/[0-9A-Za-z_ ]+)*\\k<quote>|[0-9A-Za-z_]+(\\/[0-9A-Za-z_]+)*)",
-      "name": "support.function.builtin.shorthand.gdscript"
-    },
-    "builtin_classes": {
-      "match": "(?<![^.]\\.|:)\\b(Vector2|Vector3|Color|Rect2|Array|Basis|Dictionary|Plane|Quat|RID|Rect3|Transform|Transform2D|AABB|String|Color|NodePath|RID|Object|Dictionary|Array|PoolByteArray|PoolIntArray|PoolRealArray|PoolStringArray|PoolVector2Array|PoolVector3Array|PoolColorArray)\\b",
-      "name": "support.class.library.gdscript"
-    },
-    "const_vars": {
-      "match": "\\b([A-Z_0-9]+)\\b",
-      "name": "constant.language.gdscript"
-    },
-    "function-declaration": {
-      "name": "meta.function.gdscript",
-      "begin": "(?x)\n  \\s*\n  (?:\\b(static) \\s+)? \\b(func|signal)\\s+\n    (?=\n      [[:alpha:]_][[:word:]]* \\s* \\(\n    )\n",
-      "end": "(:|(?=[#'\"\\n]))",
-      "beginCaptures": {
-        "1": { "name": "storage.type.function.static.gdscript" },
-        "2": { "name": "storage.type.function.gdscript" }
-      },
-      "endCaptures": {
-        "1": { "name": "punctuation.section.function.begin.gdscript" }
-      },
-      "patterns": [
-        { "include": "#function-def-name" },
-        { "include": "#parameters" },
-        { "include": "#line-continuation" },
-        { "include": "#return-annotation" }
-      ]
-    },
-    "function-def-name": {
-      "patterns": [
+            "include": "#self"
+        },
         {
-          "name": "entity.name.function.gdscript",
-          "match": "(?x)\n  \\b ([[:alpha:]_]\\w*) \\b\n"
-        }
-      ]
-    },
-    "parameters": {
-      "name": "meta.function.parameters.gdscript",
-      "begin": "(\\()",
-      "end": "(\\))",
-      "beginCaptures": {
-        "1": { "name": "punctuation.definition.parameters.begin.gdscript" }
-      },
-      "endCaptures": {
-        "1": { "name": "punctuation.definition.parameters.end.gdscript" }
-      },
-      "patterns": [{
-          "name": "keyword.operator.unpacking.parameter.gdscript",
-          "match": "(\\*\\*|\\*)"
-        },
-        { "include": "#parameter-special" },
+            "include": "#const_def"
+        },
+        {
+            "include": "#class_def"
+        },
+        {
+            "include": "#var_def"
+        },
+        {
+            "include": "#type_hint"
+        },
+        {
+            "include": "#class_name"
+        },
+        {
+            "include": "#builtin_func"
+        },
+        {
+            "include": "#node_path"
+        },
+        {
+            "include": "#builtin_get_node_shorthand"
+        },
+        {
+            "include": "#builtin_classes"
+        },
+        {
+            "include": "#const_vars"
+        },
+        {
+            "include": "#pascal_case_class"
+        },
+        {
+            "include": "#class_new"
+        },
+        {
+            "include": "#class_is"
+        },
+        {
+            "include": "#class_enum"
+        },
+        {
+            "include": "#signal-declaration-bare"
+        },
+        {
+            "include": "#signal-declaration"
+        },
+        {
+            "include": "#function-declaration"
+        },
         {
-          "match": "(?x)\n  ([[:alpha:]_]\\w*)\n    \\s* (?: (,) | (?=[)#\\n=]))\n",
-          "captures": {
-            "1": { "name": "variable.parameter.function.language.gdscript" },
-            "2": { "name": "punctuation.separator.parameters.gdscript" }
-          }
-        },
-        { "include": "#comment" },
-        { "include": "#loose-default"},
-        { "include": "#annotated-parameter" }
-      ]
-    },
-    "any-method": {
-      "match": "\\b([A-Za-z_]\\w*)\\b(?=\\s*(?:[(]))",
-      "name": "support.function.any-method.gdscript"
-    },
-    "any-property": {
-      "match": "(?<=[^.]\\.)\\b([A-Za-z_]\\w*)\\b(?![(])",
-      "name": "variable.other.property.gdscript"
-    },
-    "parameter-special": {
-      "match": "(?x)\n  \\b ((self)|(cls)) \\b \\s*(?:(,)|(?=\\)))\n",
-      "captures": {
-        "1": { "name": "variable.parameter.function.language.gdscript" },
-        "2": { "name": "variable.parameter.function.language.special.self.gdscript" },
-        "3": { "name": "variable.parameter.function.language.special.cls.gdscript" },
-        "4": { "name": "punctuation.separator.parameters.gdscript" }
-      }
-    },
-    "loose-default": {
-      "begin": "(=)",
-      "end": "(,)|(?=\\))",
-      "beginCaptures": {
-        "1": { "name": "keyword.operator.gdscript" }
-      },
-      "endCaptures": {
-        "1": { "name": "punctuation.separator.parameters.gdscript" }
-      },
-      "patterns": [
-          { "include": "#base_expression"}
-      ]
-    },
-    "annotated-parameter": {
-      "begin": "(?x)\n  \\b\n  ([[:alpha:]_]\\w*) \\s* (:)\n",
-      "end": "(,)|(?=\\))",
-      "beginCaptures": {
-        "1": { "name": "variable.parameter.function.language.gdscript" },
-        "2": { "name": "punctuation.separator.annotation.gdscript" }
-      },
-      "endCaptures": {
-        "1": { "name": "punctuation.separator.parameters.gdscript" }
-      },
-      "patterns": [
-        { "name": "keyword.operator.assignment.gdscript", "match": "=(?!=)"}
-      ]
-    },
-    "line-continuation": {
-      "patterns": [
+            "include": "#any-method"
+        },
         {
-          "match": "(\\\\)\\s*(\\S.*$\\n?)",
-          "captures": {
-            "1": { "name": "punctuation.separator.continuation.line.gdscript" },
-            "2": { "name": "invalid.illegal.line.continuation.gdscript" }
-          }
+            "include": "#any-property"
         },
         {
-          "begin": "(\\\\)\\s*$\\n?",
-          "end": "(?x)\n  (?=^\\s*$)\n  |\n  (?! (\\s* [rR]? (\\'\\'\\'|\\\"\\\"\\\"|\\'|\\\"))\n      |\n      (\\G $)  (?# '\\G' is necessary for ST)\n  )\n",
-          "beginCaptures": {
-            "1": { "name": "punctuation.separator.continuation.line.gdscript" }
-          },
-          "patterns": [
-            { "include": "#base_expression" }
-          ]
+            "include": "#extends"
+        }
+    ],
+    "repository": {
+        "comment": {
+            "captures": {
+                "1": {
+                    "name": "punctuation.definition.comment.number-sign.gdscript"
+                }
+            },
+            "match": "(#).*$\\n?",
+            "name": "comment.line.number-sign.gdscript"
+        },
+        "strings": {
+            "patterns": [
+                {
+                    "begin": "(?:(?<=get_node|has_node|NodePath)\\s*\\(\\s*)",
+                    "end": "(?:\\s*\\))",
+                    "patterns": [
+                        {
+                            "begin": "[\\\"\\']",
+                            "end": "[\\\"\\']",
+                            "name": "constant.character.escape"
+                        },
+                        {
+                            "include": "#base_expression"
+                        }
+                    ]
+                },
+                {
+                    "name": "invalid.illegal.escape.gdscript",
+                    "begin": "'''",
+                    "end": "'''"
+                },
+                {
+                    "begin": "\"",
+                    "end": "\"",
+                    "patterns": [
+                        {
+                            "name": "constant.character.escape.untitled",
+                            "match": "\\\\."
+                        }
+                    ],
+                    "name": "string.quoted.double.gdscript"
+                },
+                {
+                    "begin": "'",
+                    "end": "'",
+                    "patterns": [
+                        {
+                            "name": "constant.character.escape.untitled",
+                            "match": "\\\\."
+                        }
+                    ],
+                    "name": "string.quoted.single.gdscript"
+                },
+                {
+                    "begin": "@\"",
+                    "end": "\"",
+                    "patterns": [
+                        {
+                            "name": "constant.character.escape.untitled",
+                            "match": "\\."
+                        }
+                    ],
+                    "name": "string.nodepath.gdscript"
+                }
+            ]
+        },
+        "self": {
+            "match": "\\bself\\b",
+            "name": "variable.language.gdscript"
+        },
+        "base_expression": {
+            "patterns": [
+                {
+                    "include": "#strings"
+                },
+                {
+                    "include": "#comment"
+                },
+                {
+                    "include": "#letter"
+                },
+                {
+                    "include": "#numbers"
+                },
+                {
+                    "include": "#line-continuation"
+                }
+            ]
+        },
+        "logic_op": {
+            "match": "\\b(and|or|not)\\b",
+            "name": "keyword.operator.wordlike.gdscript"
+        },
+        "compare_op": {
+            "match": "<=|>=|==|<|>|!=",
+            "name": "keyword.operator.comparison.gdscript"
+        },
+        "arithmetic_op": {
+            "match": "\\+=|-=|\\*=|/=|%=|&=|\\|=|\\*|/|%|\\+|-|<<|>>|&|\\||\\^|~",
+            "name": "keyword.operator.arithmetic.gdscript"
+        },
+        "assignment_op": {
+            "match": "=",
+            "name": "keyword.operator.assignment.gdscript"
+        },
+        "control_flow": {
+            "match": "\\b(?i:if|elif|else|for|while|break|continue|pass|return|match|in|yield)\\b",
+            "name": "keyword.control.gdscript"
+        },
+        "keywords": {
+            "match": "\\b(?i:class|class_name|extends|is|onready|tool|static|export|setget|const|as|void|enum|preload|assert|breakpoint|rpc|sync|remote|master|puppet|slave|remotesync|mastersync|puppetsync)\\b",
+            "name": "keyword.language.gdscript"
+        },
+        "letter": {
+            "match": "\\b(?i:true|false|null)\\b",
+            "name": "constant.language.gdscript"
+        },
+        "numbers": {
+            "patterns": [
+                {
+                    "match": "\\b(?i:0x\\h*)\\b",
+                    "name": "constant.numeric.integer.hexadecimal.gdscript"
+                },
+                {
+                    "match": "\\b(?i:(\\d+\\.\\d*(e[\\-\\+]?\\d+)?))\\b",
+                    "name": "constant.numeric.float.gdscript"
+                },
+                {
+                    "match": "\\b(?i:(\\.\\d+(e[\\-\\+]?\\d+)?))\\b",
+                    "name": "constant.numeric.float.gdscript"
+                },
+                {
+                    "match": "\\b(?i:(\\d+e[\\-\\+]?\\d+))\\b",
+                    "name": "constant.numeric.float.gdscript"
+                },
+                {
+                    "match": "\\b\\d+\\b",
+                    "name": "constant.numeric.integer.gdscript"
+                }
+            ]
+        },
+        "const_def": {
+            "match": "\\b(?i:(const))\\s+([a-zA-Z_][a-zA-Z_0-9]*)",
+            "captures": {
+                "1": {
+                    "name": "storage.type.const.gdscript"
+                },
+                "2": {
+                    "name": "constant.language.gdscript"
+                }
+            }
+        },
+        "var_def": {
+            "match": "\\b(?i:(var))\\s+(?=[a-zA-Z_][a-zA-Z_0-9]*)",
+            "captures": {
+                "1": {
+                    "name": "storage.type.var.gdscript"
+                }
+            }
+        },
+        "type_hint": {
+            "match": "\\:\\s*([a-zA-Z_][a-zA-Z_0-9]*)\\s*(?=[=\\n]|setget)",
+            "captures": {
+                "1": {
+                    "name": "entity.name.type.class.gdscript"
+                }
+            }
+        },
+        "class_def": {
+            "captures": {
+                "1": {
+                    "name": "entity.name.type.class.gdscript"
+                },
+                "2": {
+                    "name": "class.other.gdscript"
+                }
+            },
+            "match": "(?<=^class)\\s+([a-zA-Z_]\\w*)\\s*(?=:)"
+        },
+        "class_new": {
+            "captures": {
+                "1": {
+                    "name": "entity.name.type.class.gdscript"
+                },
+                "2": {
+                    "name": "storage.type.new.gdscript"
+                }
+            },
+            "match": "\\b([a-zA-Z_][a-zA-Z_0-9]*).(new)\\("
+        },
+        "class_is": {
+            "captures": {
+                "1": {
+                    "name": "storage.type.is.gdscript"
+                },
+                "2": {
+                    "name": "entity.name.type.class.gdscript"
+                }
+            },
+            "match": "\\s+(is)\\s+([a-zA-Z_][a-zA-Z_0-9]*)"
+        },
+        "class_enum": {
+            "captures": {
+                "1": {
+                    "name": "entity.name.type.class.gdscript"
+                },
+                "2": {
+                    "name": "constant.language.gdscript"
+                }
+            },
+            "match": "\\b([A-Z][a-zA-Z_0-9]*)\\.([A-Z_0-9]+)"
+        },
+        "class_name": {
+            "captures": {
+                "1": {
+                    "name": "entity.name.type.class.gdscript"
+                },
+                "2": {
+                    "name": "class.other.gdscript"
+                }
+            },
+            "match": "(?<=class_name)\\s+([a-zA-Z_][a-zA-Z_0-9]*(\\.([a-zA-Z_][a-zA-Z_0-9]*))?)"
+        },
+        "extends": {
+            "match": "(?<=extends)\\s+[a-zA-Z_][a-zA-Z_0-9]*(\\.([a-zA-Z_][a-zA-Z_0-9]*))?",
+            "name": "entity.other.inherited-class.gdscript"
+        },
+        "builtin_func": {
+            "match": "(?<![^.]\\.|:)\\b(abs|absf|absi|acos|asin|assert|atan|atan2|bytes2var|bytes2var_with_objects|ceil|char|clamp|clampf|clampi|Color8|convert|cos|cosh|cubic_interpolate|db2linear|decimals|dectime|deg2rad|dict2inst|ease|error_string|exp|floor|fmod|fposmod|funcref|get_stack|hash|inst2dict|instance_from_id|inverse_lerp|is_equal_approx|is_inf|is_instance_id_valid|is_instance_valid|is_nan|is_zero_approx|len|lerp|lerp_angle|linear2db|load|log|max|maxf|maxi|min|minf|mini|move_toward|nearest_po2|pingpong|posmod|pow|preload|print|printerr|printraw|prints|printt|print_debug|print_stack|print_verbose|push_error|push_warning|rad2deg|randf|randfn|randf_range|randi|randi_range|randomize|rand_from_seed|rand_range|rand_seed|range|range_lerp|range_step_decimals|rid_allocate_id|rid_from_int64|round|seed|sign|signf|signi|sin|sinh|smoothstep|snapped|sqrt|stepify|step_decimals|str|str2var|tan|tanh|typeof|type_exists|var2bytes|var2bytes_with_objects|var2str|weakref|wrapf|wrapi|yield)\\b(?=(\\()([^)]*)(\\)))",
+            "name": "support.function.builtin.gdscript"
+        },
+        "builtin_get_node_shorthand": {
+            "match": "(\\$)([\\\"\\'].*[\\\"\\']|(?:[a-zA-Z_][a-zA-Z_0-9]*/?)*)",
+            "name": "support.function.builtin.shorthand.gdscript",
+            "captures": {
+                "1": {
+                    "name": "keyword.control.flow"
+                },
+                "2": {
+                    "name": "constant.character.escape"
+                }
+            }
+        },
+        "decorators": {
+            "match": "(@)(export|export_color_no_alpha|export_dir|export_enum|export_exp_easing|export_file|export_flags|export_flags_2d_navigation|export_flags_2d_physics|export_flags_2d_render|export_flags_3d_navigation|export_flags_3d_physics|export_flags_3d_render|export_global_dir|export_global_file|export_multiline|export_node_path|export_placeholder|export_range|icon|onready|rpc|tool|warning_ignore)\\b",
+            "captures": {
+                "1": {
+                    "name": "keyword.control.flow"
+                },
+                "2": {
+                    "name": "entity.name.function.decorator.gdscript"
+                }
+            }
+        },
+        "builtin_classes": {
+            "match": "(?<![^.]\\.|:)\\b(Vector2|Vector2i|Vector3|Vector3i|Color|Rect2|Rect2i|Array|Basis|Dictionary|Plane|Quat|RID|Rect3|Transform|Transform2D|Transform3D|AABB|String|Color|NodePath|Object|PoolByteArray|PoolIntArray|PoolRealArray|PoolStringArray|PoolVector2Array|PoolVector3Array|PoolColorArray|bool|int|float|StringName|Quaternion|PackedByteArray|PackedInt32Array|PackedInt64Array|PackedFloat32Array|PackedFloat64Array|PackedStringArray|PackedVector2Array|PackedVector2iArray|PackedVector3Array|PackedVector3iArray|PackedColorArray)\\b",
+            "name": "support.class.library.gdscript"
+        },
+        "const_vars": {
+            "match": "\\b([A-Z_][A-Z_0-9]*)\\b",
+            "name": "constant.language.gdscript"
+        },
+        "pascal_case_class": {
+            "match": "\\b([A-Z][a-z_0-9]*([A-Z]?[a-z_0-9]+)*[A-Z]?)\\b",
+            "name": "support.class.library.gdscript"
+        },
+        "signal-declaration-bare": {
+            "match": "(?x) \\s*\n (signal) \\s+\n ([a-zA-Z_][a-zA-Z_0-9]*)(?=[\\n\\s])",
+            "captures": {
+                "1": {
+                    "name": "storage.type.function.gdscript"
+                },
+                "2": {
+                    "name": "entity.name.function.gdscript"
+                }
+            }
+        },
+        "signal-declaration": {
+            "name": "meta.signal.gdscript",
+            "begin": "(?x) \\s*\n (signal) \\s+\n ([a-zA-Z_][a-zA-Z_0-9]*) \\s*\n (?=\\()",
+            "end": "((?=[#'\"\\n]))",
+            "beginCaptures": {
+                "1": {
+                    "name": "storage.type.function.gdscript"
+                },
+                "2": {
+                    "name": "entity.name.function.gdscript"
+                }
+            },
+            "patterns": [
+                {
+                    "include": "#parameters"
+                },
+                {
+                    "include": "#line-continuation"
+                },
+                {
+                    "match": "\\s*(\\-\\>)\\s*([a-zA-Z_][a-zA-Z_0-9]*)\\s*\\:",
+                    "captures": {
+                        "1": {},
+                        "2": {
+                            "name": "entity.name.type.class.gdscript"
+                        }
+                    }
+                }
+            ]
+        },
+        "function-declaration": {
+            "name": "meta.function.gdscript",
+            "begin": "(?x) \\s*\n (func) \\s+\n ([a-zA-Z_][a-zA-Z_0-9]*) \\s*\n (?=\\()",
+            "end": "(:|(?=[#'\"\\n]))",
+            "beginCaptures": {
+                "1": {
+                    "name": "storage.type.function.gdscript"
+                },
+                "2": {
+                    "name": "entity.name.function.gdscript"
+                }
+            },
+            "patterns": [
+                {
+                    "include": "#parameters"
+                },
+                {
+                    "include": "#line-continuation"
+                },
+                {
+                    "match": "\\s*(\\-\\>)\\s*([a-zA-Z_][a-zA-Z_0-9]*)\\s*\\:",
+                    "captures": {
+                        "1": {},
+                        "2": {
+                            "name": "entity.name.type.class.gdscript"
+                        }
+                    }
+                }
+            ]
+        },
+        "parameters": {
+            "name": "meta.function.parameters.gdscript",
+            "begin": "(\\()",
+            "end": "(\\))",
+            "beginCaptures": {
+                "1": {
+                    "name": "punctuation.definition.parameters.begin.gdscript"
+                }
+            },
+            "endCaptures": {
+                "1": {
+                    "name": "punctuation.definition.parameters.end.gdscript"
+                }
+            },
+            "patterns": [
+                {
+                    "include": "#annotated-parameter"
+                },
+                {
+                    "match": "(?x)\n  ([[:alpha:]_]\\w*)\n    \\s* (?: (,) | (?=[)#\\n=]))\n",
+                    "captures": {
+                        "1": {
+                            "name": "variable.parameter.function.language.gdscript"
+                        },
+                        "2": {
+                            "name": "punctuation.separator.parameters.gdscript"
+                        }
+                    }
+                },
+                {
+                    "include": "#comment"
+                },
+                {
+                    "include": "#loose-default"
+                }
+            ]
+        },
+        "loose-default": {
+            "begin": "(=)",
+            "end": "(,)|(?=\\))",
+            "beginCaptures": {
+                "1": {
+                    "name": "keyword.operator.gdscript"
+                }
+            },
+            "endCaptures": {
+                "1": {
+                    "name": "punctuation.separator.parameters.gdscript"
+                }
+            },
+            "patterns": [
+                {
+                    "include": "#base_expression"
+                }
+            ]
+        },
+        "annotated-parameter": {
+            "begin": "(?x)\n  \\b\n  ([[:alpha:]_]\\w*) \\s* (:) \\s* ([[:alpha:]_]\\w*)? \\s* (=)? \\s* ([[:alpha:].0-9\\'\\\"_]*)?\n",
+            "end": "(,)|(?=\\))",
+            "beginCaptures": {
+                "1": {
+                    "name": "variable.parameter.function.language.gdscript"
+                },
+                "2": {
+                    "name": "punctuation.separator.annotation.gdscript"
+                },
+                "3": {
+                    "patterns": [
+                        {
+                            "include": "#builtin_classes"
+                        },
+                        {
+                            "include": "#pascal_case_class"
+                        }
+                    ]
+                },
+                "4": {
+                    "name": "keyword.operator.assignment.gdscript"
+                },
+                "5": {
+                    "patterns": [
+                        {
+                            "include": "#numbers"
+                        },
+                        {
+                            "include": "#strings"
+                        }
+                    ]
+                }
+            },
+            "endCaptures": {
+                "1": {
+                    "name": "punctuation.separator.parameters.gdscript"
+                }
+            }
+        },
+        "line-continuation": {
+            "patterns": [
+                {
+                    "match": "(\\\\)\\s*(\\S.*$\\n?)",
+                    "captures": {
+                        "1": {
+                            "name": "punctuation.separator.continuation.line.gdscript"
+                        },
+                        "2": {
+                            "name": "invalid.illegal.line.continuation.gdscript"
+                        }
+                    }
+                },
+                {
+                    "begin": "(\\\\)\\s*$\\n?",
+                    "end": "(?x)\n  (?=^\\s*$)\n  |\n  (?! (\\s* [rR]? (\\'\\'\\'|\\\"\\\"\\\"|\\'|\\\"))\n      |\n      (\\G $)  (?# '\\G' is necessary for ST)\n  )\n",
+                    "beginCaptures": {
+                        "1": {
+                            "name": "punctuation.separator.continuation.line.gdscript"
+                        }
+                    },
+                    "patterns": [
+                        {
+                            "include": "#base_expression"
+                        }
+                    ]
+                }
+            ]
+        },
+        "any-method": {
+            "match": "\\b([A-Za-z_]\\w*)\\b(?=\\s*(?:[(]))",
+            "name": "support.function.any-method.gdscript"
+        },
+        "any-property": {
+            "match": "(?<=[^.]\\.)\\b([A-Za-z_]\\w*)\\b(?![(])",
+            "name": "variable.other.property.gdscript"
         }
-      ]
-    },
-    "pascal_case_class": {
-      "captures": {
-        "1": { "name": "entity.name.type.class.gdscript" }
-      },
-      "match": "\\b([A-Z][a-zA-Z_0-9]*)\\b"
     }
-  }
 }

+ 19 - 0
syntaxes/GDShader.tmLanguage.json

@@ -0,0 +1,19 @@
+{
+    "version": "v0.1.0",
+    "scopeName": "source.gdshader",
+    "uuid": "3a95d25d-688b-481f-a581-eee47f00e5ca",
+    "patterns": [
+        {
+            "include": "#shader_type"
+        },
+        {
+            "include": "source.glsl"
+        }
+    ],
+    "repository": {
+        "shader_type": {
+            "match": "(shader_type)",
+            "name": "storage.type.glsl"
+        }
+    }
+}

+ 143 - 0
syntaxes/examples/gdscript1.gd

@@ -0,0 +1,143 @@
+extends Node
+class_name TestClass
+
+# ******************************************************************************
+
+var a
+remote var b = 10.0
+remotesync var c := 20
+master var d :int = 30
+puppet var e :int
+
+signal sig_a
+signal sig_b()
+signal sig_c(param1, param2)
+signal sig_d(param1: int, param2: Dictionary)
+signal sig_e(
+		param1: int, # first param
+		param2: Dictionary,
+	)
+
+# ------------------------------------------------------------------------------
+
+var f = 40 setget set_f
+func set_f(value):
+	pass
+
+var g:int setget set_g, get_g
+func set_g(value: int=0) -> void:
+	pass
+
+var h:float = 1.0 setget set_h, get_h
+func set_h(value: int=0) -> void:
+	pass
+
+func get_g() -> int:
+	return 0
+
+# ------------------------------------------------------------------------------
+
+func func_a():
+	pass
+
+func func_b(param1, param2):
+	pass
+
+var dict = {
+	a = 0,
+	b = 0.0,
+	c = 'test',
+} 
+
+func func_c(
+		param1: int = 10,
+		param11,
+		param2 := 1.0,
+		param3: String = 'string',
+		param4 := {a=0, b=0.0, c='test'},
+	):
+	pass
+
+# ------------------------------------------------------------------------------
+
+var h = "double quotes"
+var i = 'single quotes'
+var j = """
+triple double quotes
+"""
+# var k = '''triple single quotes''' # this should be red because it's invalid
+
+# ------------------------------------------------------------------------------
+
+var IS_CONSTANT
+var not_CONSTANT
+var ALSO_NOT_constant
+var CONSTANT_not
+
+# ------------------------------------------------------------------------------
+
+onready var node_a = $Child
+onready var node_b = $Child/GrandChild
+onready var node_bb = $Child/GrandChild/GreatGrandChild
+onready var node_bbb = $Child/GrandChild/GreatGrandChild/GreatGreatGrandChild
+onready var node_c = $"../Sibling"
+onready var node_cc = $'../Sibling'
+onready var node_d = $'..' # parent
+onready var node_e = $"../.." # grandparent
+
+onready var node_f = get_node('Child')
+onready var node_g = get_node("Child/GrandChild")
+onready var node_h = get_node("../Sibling")
+
+if has_node('Child') and get_node('Child').has_node('GrandChild'):
+	pass
+
+onready var node_i = $badlyNamedChild
+onready var node_j = $badlyNamedChild/badly_named_grandchild
+
+var node_path_a = NodePath("Child")
+var node_path_b = NodePath('Child/GrandChild')
+var node_path_c = NodePath('../Sibling')
+
+# ------------------------------------------------------------------------------
+
+var _script = GDScript.new()
+
+var directions = [
+	Vector2.UP,
+	Vector2.DOWN,
+	Vector2.LEFT,
+	Vector2.RIGHT,
+]
+
+enum test_enum {
+	VALUE_1,
+	VALUE_2,
+	VALUE_3,
+}
+
+export(test_enum) var enum_variable = test_enum.VALUE_1
+
+# ------------------------------------------------------------------------------
+
+class InnerClass:
+	var some_var = 100
+	var dict = {
+		'key_a': some_var,
+		'key_b': str(10),
+		key_c = some_var,
+		key_d = int('10'),
+		key_e = Color(1, 1, 1),
+		key_f = Vector2(10, -10)
+	}
+
+	func _ready():
+		if true and true:
+			pass
+		elif false:
+			while true:
+				pass
+		else:
+			pass
+		
+		pass