Browse Source

update the gdscript highlighter

Hana 2 years ago
parent
commit
1395a928b5
1 changed files with 33 additions and 14 deletions
  1. 33 14
      _extensions/gdscript.py

+ 33 - 14
_extensions/gdscript.py

@@ -184,27 +184,37 @@ class GDScriptLexer(RegexLexer):
                         "asin",
                         "asin",
                         "atan",
                         "atan",
                         "atan2",
                         "atan2",
-                        "bytes2var",
-                        "bytes2var_with_objects",
+                        "bezier_derivative",
+                        "bezier_interpolate",
+                        "bytes_to_var",
+                        "bytes_to_var_with_objects",
                         "ceil",
                         "ceil",
+                        "ceilf",
+                        "ceili",
                         "clamp",
                         "clamp",
                         "clampf",
                         "clampf",
                         "clampi",
                         "clampi",
                         "cos",
                         "cos",
                         "cosh",
                         "cosh",
                         "cubic_interpolate",
                         "cubic_interpolate",
-                        "db2linear",
-                        "deg2rad",
+                        "cubic_interpolate_angle",
+                        "cubic_interpolate_angle_in_time",
+                        "cubic_interpolate_in_time",
+                        "db_to_linear",
+                        "deg_to_rad",
                         "ease",
                         "ease",
                         "error_string",
                         "error_string",
                         "exp",
                         "exp",
                         "floor",
                         "floor",
+                        "floorf",
+                        "floori",
                         "fmod",
                         "fmod",
                         "fposmod",
                         "fposmod",
                         "hash",
                         "hash",
                         "instance_from_id",
                         "instance_from_id",
                         "inverse_lerp",
                         "inverse_lerp",
                         "is_equal_approx",
                         "is_equal_approx",
+                        "is_finite",
                         "is_inf",
                         "is_inf",
                         "is_instance_id_valid",
                         "is_instance_id_valid",
                         "is_instance_valid",
                         "is_instance_valid",
@@ -212,7 +222,8 @@ class GDScriptLexer(RegexLexer):
                         "is_zero_approx",
                         "is_zero_approx",
                         "lerp",
                         "lerp",
                         "lerp_angle",
                         "lerp_angle",
-                        "linear2db",
+                        "lerpf",
+                        "linear_to_db",
                         "log",
                         "log",
                         "max",
                         "max",
                         "maxf",
                         "maxf",
@@ -226,6 +237,7 @@ class GDScriptLexer(RegexLexer):
                         "posmod",
                         "posmod",
                         "pow",
                         "pow",
                         "print",
                         "print",
+                        "print_rich",
                         "print_verbose",
                         "print_verbose",
                         "printerr",
                         "printerr",
                         "printraw",
                         "printraw",
@@ -233,7 +245,7 @@ class GDScriptLexer(RegexLexer):
                         "printt",
                         "printt",
                         "push_error",
                         "push_error",
                         "push_warning",
                         "push_warning",
-                        "rad2deg",
+                        "rad_to_deg",
                         "rand_from_seed",
                         "rand_from_seed",
                         "randf",
                         "randf",
                         "randf_range",
                         "randf_range",
@@ -241,11 +253,12 @@ class GDScriptLexer(RegexLexer):
                         "randi",
                         "randi",
                         "randi_range",
                         "randi_range",
                         "randomize",
                         "randomize",
-                        "range_lerp",
-                        "range_step_decimals",
+                        "remap",
                         "rid_allocate_id",
                         "rid_allocate_id",
                         "rid_from_int64",
                         "rid_from_int64",
                         "round",
                         "round",
+                        "roundf",
+                        "roundi",
                         "seed",
                         "seed",
                         "sign",
                         "sign",
                         "signf",
                         "signf",
@@ -254,17 +267,20 @@ class GDScriptLexer(RegexLexer):
                         "sinh",
                         "sinh",
                         "smoothstep",
                         "smoothstep",
                         "snapped",
                         "snapped",
+                        "snappedf",
+                        "snappedi",
                         "sqrt",
                         "sqrt",
                         "step_decimals",
                         "step_decimals",
                         "str",
                         "str",
-                        "str2var",
+                        "str_to_var",
                         "tan",
                         "tan",
                         "tanh",
                         "tanh",
                         "typeof",
                         "typeof",
-                        "var2bytes",
-                        "var2bytes_with_objects",
-                        "var2str",
+                        "var_to_bytes",
+                        "var_to_bytes_with_objects",
+                        "var_to_str",
                         "weakref",
                         "weakref",
+                        "wrap",
                         "wrapf",
                         "wrapf",
                         "wrapi",
                         "wrapi",
 
 
@@ -273,9 +289,9 @@ class GDScriptLexer(RegexLexer):
                         "assert",
                         "assert",
                         "char",
                         "char",
                         "convert",
                         "convert",
-                        "dict2inst",
+                        "dict_to_inst",
                         "get_stack",
                         "get_stack",
-                        "inst2dict",
+                        "inst_to_dict",
                         "len",
                         "len",
                         "load",
                         "load",
                         "preload",
                         "preload",
@@ -342,6 +358,7 @@ class GDScriptLexer(RegexLexer):
                 words(
                 words(
                     (
                     (
                         "@export",
                         "@export",
+                        "@export_category",
                         "@export_color_no_alpha",
                         "@export_color_no_alpha",
                         "@export_dir",
                         "@export_dir",
                         "@export_enum",
                         "@export_enum",
@@ -356,10 +373,12 @@ class GDScriptLexer(RegexLexer):
                         "@export_flags_3d_render",
                         "@export_flags_3d_render",
                         "@export_global_dir",
                         "@export_global_dir",
                         "@export_global_file",
                         "@export_global_file",
+                        "@export_group",
                         "@export_multiline",
                         "@export_multiline",
                         "@export_node_path",
                         "@export_node_path",
                         "@export_placeholder",
                         "@export_placeholder",
                         "@export_range",
                         "@export_range",
+                        "@export_subgroup",
                         "@icon",
                         "@icon",
                         "@onready",
                         "@onready",
                         "@rpc",
                         "@rpc",