diff --git a/_extensions/gdscript.py b/_extensions/gdscript.py index ec69e78f7..3ee47475c 100644 --- a/_extensions/gdscript.py +++ b/_extensions/gdscript.py @@ -88,6 +88,7 @@ class GDScriptLexer(RegexLexer): (r"(func)((?:\s|\\\s)+)", bygroups(Keyword, Text), "funcname"), (r"(class)((?:\s|\\\s)+)", bygroups(Keyword, Text), "classname"), include("builtins"), + include("decorators"), ( '([rR]|[uUbB][rR]|[rR][uUbB])(""")', bygroups(String.Affix, String.Double), @@ -136,7 +137,10 @@ class GDScriptLexer(RegexLexer): words( ( "and", + "await", "in", + "get", + "set", "not", "or", "as", @@ -161,6 +165,7 @@ class GDScriptLexer(RegexLexer): "return", "match", "while", + "super", ), suffix=r"\b", ), @@ -171,77 +176,114 @@ class GDScriptLexer(RegexLexer): ( words( ( - "Color8", - "ColorN", + # doc/classes/@GlobalScope.xml "abs", + "absf", + "absi", "acos", "asin", - "assert", "atan", "atan2", - "await", "bytes2var", + "bytes2var_with_objects", "ceil", - "char", "clamp", - "convert", + "clampf", + "clampi", "cos", "cosh", + "cubic_interpolate", "db2linear", - "decimals", - "dectime", "deg2rad", - "dict2inst", "ease", + "error_string", "exp", "floor", "fmod", "fposmod", - "funcref", "hash", - "inst2dict", "instance_from_id", + "inverse_lerp", + "is_equal_approx", "is_inf", + "is_instance_id_valid", + "is_instance_valid", "is_nan", + "is_zero_approx", "lerp", + "lerp_angle", "linear2db", - "load", "log", "max", + "maxf", + "maxi", "min", + "minf", + "mini", + "move_toward", "nearest_po2", + "pingpong", + "posmod", "pow", - "preload", "print", - "print_stack", + "print_verbose", "printerr", "printraw", "prints", "printt", + "push_error", + "push_warning", "rad2deg", - "rand_range", - "rand_seed", + "rand_from_seed", "randf", + "randf_range", + "randfn", "randi", + "randi_range", "randomize", - "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", - "tan", "tanh", - "type_exist", "typeof", "var2bytes", + "var2bytes_with_objects", "var2str", "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"(?