|
@@ -88,6 +88,7 @@ class GDScriptLexer(RegexLexer):
|
|
(r"(func)((?:\s|\\\s)+)", bygroups(Keyword, Text), "funcname"),
|
|
(r"(func)((?:\s|\\\s)+)", bygroups(Keyword, Text), "funcname"),
|
|
(r"(class)((?:\s|\\\s)+)", bygroups(Keyword, Text), "classname"),
|
|
(r"(class)((?:\s|\\\s)+)", bygroups(Keyword, Text), "classname"),
|
|
include("builtins"),
|
|
include("builtins"),
|
|
|
|
+ include("decorators"),
|
|
(
|
|
(
|
|
'([rR]|[uUbB][rR]|[rR][uUbB])(""")',
|
|
'([rR]|[uUbB][rR]|[rR][uUbB])(""")',
|
|
bygroups(String.Affix, String.Double),
|
|
bygroups(String.Affix, String.Double),
|
|
@@ -136,7 +137,10 @@ class GDScriptLexer(RegexLexer):
|
|
words(
|
|
words(
|
|
(
|
|
(
|
|
"and",
|
|
"and",
|
|
|
|
+ "await",
|
|
"in",
|
|
"in",
|
|
|
|
+ "get",
|
|
|
|
+ "set",
|
|
"not",
|
|
"not",
|
|
"or",
|
|
"or",
|
|
"as",
|
|
"as",
|
|
@@ -161,6 +165,7 @@ class GDScriptLexer(RegexLexer):
|
|
"return",
|
|
"return",
|
|
"match",
|
|
"match",
|
|
"while",
|
|
"while",
|
|
|
|
+ "super",
|
|
),
|
|
),
|
|
suffix=r"\b",
|
|
suffix=r"\b",
|
|
),
|
|
),
|
|
@@ -171,77 +176,114 @@ class GDScriptLexer(RegexLexer):
|
|
(
|
|
(
|
|
words(
|
|
words(
|
|
(
|
|
(
|
|
- "Color8",
|
|
|
|
- "ColorN",
|
|
|
|
|
|
+ # doc/classes/@GlobalScope.xml
|
|
"abs",
|
|
"abs",
|
|
|
|
+ "absf",
|
|
|
|
+ "absi",
|
|
"acos",
|
|
"acos",
|
|
"asin",
|
|
"asin",
|
|
- "assert",
|
|
|
|
"atan",
|
|
"atan",
|
|
"atan2",
|
|
"atan2",
|
|
- "await",
|
|
|
|
"bytes2var",
|
|
"bytes2var",
|
|
|
|
+ "bytes2var_with_objects",
|
|
"ceil",
|
|
"ceil",
|
|
- "char",
|
|
|
|
"clamp",
|
|
"clamp",
|
|
- "convert",
|
|
|
|
|
|
+ "clampf",
|
|
|
|
+ "clampi",
|
|
"cos",
|
|
"cos",
|
|
"cosh",
|
|
"cosh",
|
|
|
|
+ "cubic_interpolate",
|
|
"db2linear",
|
|
"db2linear",
|
|
- "decimals",
|
|
|
|
- "dectime",
|
|
|
|
"deg2rad",
|
|
"deg2rad",
|
|
- "dict2inst",
|
|
|
|
"ease",
|
|
"ease",
|
|
|
|
+ "error_string",
|
|
"exp",
|
|
"exp",
|
|
"floor",
|
|
"floor",
|
|
"fmod",
|
|
"fmod",
|
|
"fposmod",
|
|
"fposmod",
|
|
- "funcref",
|
|
|
|
"hash",
|
|
"hash",
|
|
- "inst2dict",
|
|
|
|
"instance_from_id",
|
|
"instance_from_id",
|
|
|
|
+ "inverse_lerp",
|
|
|
|
+ "is_equal_approx",
|
|
"is_inf",
|
|
"is_inf",
|
|
|
|
+ "is_instance_id_valid",
|
|
|
|
+ "is_instance_valid",
|
|
"is_nan",
|
|
"is_nan",
|
|
|
|
+ "is_zero_approx",
|
|
"lerp",
|
|
"lerp",
|
|
|
|
+ "lerp_angle",
|
|
"linear2db",
|
|
"linear2db",
|
|
- "load",
|
|
|
|
"log",
|
|
"log",
|
|
"max",
|
|
"max",
|
|
|
|
+ "maxf",
|
|
|
|
+ "maxi",
|
|
"min",
|
|
"min",
|
|
|
|
+ "minf",
|
|
|
|
+ "mini",
|
|
|
|
+ "move_toward",
|
|
"nearest_po2",
|
|
"nearest_po2",
|
|
|
|
+ "pingpong",
|
|
|
|
+ "posmod",
|
|
"pow",
|
|
"pow",
|
|
- "preload",
|
|
|
|
"print",
|
|
"print",
|
|
- "print_stack",
|
|
|
|
|
|
+ "print_verbose",
|
|
"printerr",
|
|
"printerr",
|
|
"printraw",
|
|
"printraw",
|
|
"prints",
|
|
"prints",
|
|
"printt",
|
|
"printt",
|
|
|
|
+ "push_error",
|
|
|
|
+ "push_warning",
|
|
"rad2deg",
|
|
"rad2deg",
|
|
- "rand_range",
|
|
|
|
- "rand_seed",
|
|
|
|
|
|
+ "rand_from_seed",
|
|
"randf",
|
|
"randf",
|
|
|
|
+ "randf_range",
|
|
|
|
+ "randfn",
|
|
"randi",
|
|
"randi",
|
|
|
|
+ "randi_range",
|
|
"randomize",
|
|
"randomize",
|
|
- "range",
|
|
|
|
|
|
+ "range_lerp",
|
|
|
|
+ "range_step_decimals",
|
|
|
|
+ "rid_allocate_id",
|
|
|
|
+ "rid_from_int64",
|
|
"round",
|
|
"round",
|
|
"seed",
|
|
"seed",
|
|
"sign",
|
|
"sign",
|
|
|
|
+ "signf",
|
|
|
|
+ "signi",
|
|
"sin",
|
|
"sin",
|
|
"sinh",
|
|
"sinh",
|
|
|
|
+ "smoothstep",
|
|
|
|
+ "snapped",
|
|
"sqrt",
|
|
"sqrt",
|
|
- "stepify",
|
|
|
|
|
|
+ "step_decimals",
|
|
"str",
|
|
"str",
|
|
"str2var",
|
|
"str2var",
|
|
"tan",
|
|
"tan",
|
|
- "tan",
|
|
|
|
"tanh",
|
|
"tanh",
|
|
- "type_exist",
|
|
|
|
"typeof",
|
|
"typeof",
|
|
"var2bytes",
|
|
"var2bytes",
|
|
|
|
+ "var2bytes_with_objects",
|
|
"var2str",
|
|
"var2str",
|
|
"weakref",
|
|
"weakref",
|
|
|
|
+ "wrapf",
|
|
|
|
+ "wrapi",
|
|
|
|
+
|
|
|
|
+ # modules/gdscript/doc_classes/@GDScript.xml
|
|
|
|
+ "Color8",
|
|
|
|
+ "assert",
|
|
|
|
+ "char",
|
|
|
|
+ "convert",
|
|
|
|
+ "dict2inst",
|
|
|
|
+ "get_stack",
|
|
|
|
+ "inst2dict",
|
|
|
|
+ "len",
|
|
|
|
+ "load",
|
|
|
|
+ "preload",
|
|
|
|
+ "print_debug",
|
|
|
|
+ "print_stack",
|
|
|
|
+ "range",
|
|
|
|
+ "str",
|
|
|
|
+ "type_exists",
|
|
),
|
|
),
|
|
prefix=r"(?<!\.)",
|
|
prefix=r"(?<!\.)",
|
|
suffix=r"\b",
|
|
suffix=r"\b",
|
|
@@ -256,14 +298,18 @@ class GDScriptLexer(RegexLexer):
|
|
"int",
|
|
"int",
|
|
"float",
|
|
"float",
|
|
"String",
|
|
"String",
|
|
|
|
+ "StringName",
|
|
"NodePath",
|
|
"NodePath",
|
|
"Vector2",
|
|
"Vector2",
|
|
|
|
+ "Vector2i",
|
|
"Rect2",
|
|
"Rect2",
|
|
|
|
+ "Rect2i",
|
|
"Transform2D",
|
|
"Transform2D",
|
|
"Vector3",
|
|
"Vector3",
|
|
- "Rect3",
|
|
|
|
|
|
+ "Vector3i",
|
|
|
|
+ "AABB",
|
|
"Plane",
|
|
"Plane",
|
|
- "Quat",
|
|
|
|
|
|
+ "Quaternion",
|
|
"Basis",
|
|
"Basis",
|
|
"Transform3D",
|
|
"Transform3D",
|
|
"Color",
|
|
"Color",
|
|
@@ -279,7 +325,9 @@ class GDScriptLexer(RegexLexer):
|
|
"PackedFloat64Array",
|
|
"PackedFloat64Array",
|
|
"PackedStringArray",
|
|
"PackedStringArray",
|
|
"PackedVector2Array",
|
|
"PackedVector2Array",
|
|
|
|
+ "PackedVector2iArray",
|
|
"PackedVector3Array",
|
|
"PackedVector3Array",
|
|
|
|
+ "PackedVector3iArray",
|
|
"PackedColorArray",
|
|
"PackedColorArray",
|
|
"null",
|
|
"null",
|
|
),
|
|
),
|
|
@@ -289,10 +337,46 @@ class GDScriptLexer(RegexLexer):
|
|
Name.Builtin.Type,
|
|
Name.Builtin.Type,
|
|
),
|
|
),
|
|
],
|
|
],
|
|
|
|
+ "decorators": [
|
|
|
|
+ (
|
|
|
|
+ words(
|
|
|
|
+ (
|
|
|
|
+ "@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",
|
|
|
|
+ ),
|
|
|
|
+ prefix=r"(?<!\.)",
|
|
|
|
+ suffix=r"\b",
|
|
|
|
+ ),
|
|
|
|
+ Name.Decorator,
|
|
|
|
+ ),
|
|
|
|
+ ],
|
|
"numbers": [
|
|
"numbers": [
|
|
(r"(\d+\.\d*|\d*\.\d+)([eE][+-]?[0-9]+)?j?", Number.Float),
|
|
(r"(\d+\.\d*|\d*\.\d+)([eE][+-]?[0-9]+)?j?", Number.Float),
|
|
(r"\d+[eE][+-]?[0-9]+j?", Number.Float),
|
|
(r"\d+[eE][+-]?[0-9]+j?", Number.Float),
|
|
- (r"0[xX][a-fA-F0-9]+", Number.Hex),
|
|
|
|
|
|
+ (r"0x[a-fA-F0-9]+", Number.Hex),
|
|
|
|
+ (r"0b[01]+", Number.Bin),
|
|
(r"\d+j?", Number.Integer),
|
|
(r"\d+j?", Number.Integer),
|
|
],
|
|
],
|
|
"name": [(r"@?[a-zA-Z_]\w*", Name)],
|
|
"name": [(r"@?[a-zA-Z_]\w*", Name)],
|