|
| 1 | +local L = {} |
| 2 | + |
| 3 | +L.lexer = "gdscript" |
| 4 | + |
| 5 | +L.singleLineComment = "# " |
| 6 | + |
| 7 | +L.tabSize = 4 |
| 8 | + |
| 9 | +L.first_line = { |
| 10 | + "^#!.*godot" |
| 11 | +} |
| 12 | + |
| 13 | +L.extensions = { |
| 14 | + "gd", |
| 15 | +} |
| 16 | + |
| 17 | +L.properties = { |
| 18 | + ["lexer.gdscript.keywords2.no.sub.identifiers"] = "1", |
| 19 | +} |
| 20 | + |
| 21 | +-- Godot 4 keywords (docs: GDScript reference > Keywords) plus the reserved |
| 22 | +-- operators and literals. |
| 23 | +L.keywords = { |
| 24 | + [0] = "and as assert await break breakpoint class class_name const continue elif else enum extends false for func if in is match namespace not null or pass preload return self signal static super trait true var void when while yield INF NAN PI TAU", |
| 25 | + [1] = "AABB Array Basis Callable Color Dictionary NodePath Object PackedByteArray PackedColorArray PackedFloat32Array PackedFloat64Array PackedInt32Array PackedInt64Array PackedStringArray PackedVector2Array PackedVector3Array PackedVector4Array Plane Projection Quaternion RID Rect2 Rect2i Signal String StringName Transform2D Transform3D Variant Vector2 Vector2i Vector3 Vector3i Vector4 Vector4i bool float int " .. |
| 26 | + "Color8 abs absf absi acos acosh angle_difference asin asinh atan atan2 atanh bezier_derivative bezier_interpolate bytes_to_var bytes_to_var_with_objects ceil ceilf ceili char clamp clampf clampi convert cos cosh cubic_interpolate cubic_interpolate_angle db_to_linear deg_to_rad dict_to_inst ease error_string exp floor floorf floori fmod fposmod get_stack hash inst_to_dict instance_from_id inverse_lerp is_equal_approx is_finite is_inf is_instance_id_valid is_instance_of is_instance_valid is_nan is_same is_zero_approx len lerp lerp_angle lerpf linear_to_db load log max maxf maxi min minf mini move_toward nearest_po2 ord pingpong posmod pow print print_debug print_rich print_stack printerr printraw prints printt push_error push_warning rad_to_deg rand_from_seed randf randf_range randfn randi randi_range randomize range remap rotate_toward round roundf roundi seed sign signf signi sin sinh smoothstep snapped snappedf snappedi sqrt step_decimals str str_to_var tan tanh type_convert type_exists type_string typeof var_to_bytes var_to_bytes_with_objects var_to_str weakref wrap wrapf wrapi", |
| 27 | +} |
| 28 | + |
| 29 | +L.styles = { |
| 30 | + ["DEFAULT"] = { |
| 31 | + id = 0, |
| 32 | + fgColor = rgb(0x000000), |
| 33 | + bgColor = rgb(0xFFFFFF), |
| 34 | + }, |
| 35 | + ["COMMENTLINE"] = { |
| 36 | + id = 1, |
| 37 | + fgColor = rgb(0x008000), |
| 38 | + bgColor = rgb(0xFFFFFF), |
| 39 | + }, |
| 40 | + ["NUMBER"] = { |
| 41 | + id = 2, |
| 42 | + fgColor = rgb(0xFF0000), |
| 43 | + bgColor = rgb(0xFFFFFF), |
| 44 | + }, |
| 45 | + ["STRING"] = { |
| 46 | + id = 3, |
| 47 | + fgColor = rgb(0x808080), |
| 48 | + bgColor = rgb(0xFFFFFF), |
| 49 | + }, |
| 50 | + ["CHARACTER"] = { |
| 51 | + id = 4, |
| 52 | + fgColor = rgb(0x808080), |
| 53 | + bgColor = rgb(0xFFFFFF), |
| 54 | + }, |
| 55 | + ["KEYWORDS"] = { |
| 56 | + id = 5, |
| 57 | + fgColor = rgb(0x0000FF), |
| 58 | + bgColor = rgb(0xFFFFFF), |
| 59 | + fontStyle = 1, |
| 60 | + }, |
| 61 | + ["TRIPLE"] = { |
| 62 | + id = 6, |
| 63 | + fgColor = rgb(0xFF8000), |
| 64 | + bgColor = rgb(0xFFFFFF), |
| 65 | + }, |
| 66 | + ["TRIPLEDOUBLE"] = { |
| 67 | + id = 7, |
| 68 | + fgColor = rgb(0xFF8000), |
| 69 | + bgColor = rgb(0xFFFFFF), |
| 70 | + }, |
| 71 | + ["CLASSNAME"] = { |
| 72 | + id = 8, |
| 73 | + fgColor = rgb(0x000000), |
| 74 | + bgColor = rgb(0xFFFFFF), |
| 75 | + fontStyle = 1, |
| 76 | + }, |
| 77 | + ["FUNCNAME"] = { |
| 78 | + id = 9, |
| 79 | + fgColor = rgb(0xFF00FF), |
| 80 | + bgColor = rgb(0xFFFFFF), |
| 81 | + }, |
| 82 | + ["OPERATOR"] = { |
| 83 | + id = 10, |
| 84 | + fgColor = rgb(0x000080), |
| 85 | + bgColor = rgb(0xFFFFFF), |
| 86 | + fontStyle = 1, |
| 87 | + }, |
| 88 | + ["IDENTIFIER"] = { |
| 89 | + id = 11, |
| 90 | + fgColor = rgb(0x000000), |
| 91 | + bgColor = rgb(0xFFFFFF), |
| 92 | + }, |
| 93 | + ["COMMENTBLOCK"] = { |
| 94 | + id = 12, |
| 95 | + fgColor = rgb(0x008000), |
| 96 | + bgColor = rgb(0xFFFFFF), |
| 97 | + }, |
| 98 | + ["STRINGEOL"] = { |
| 99 | + id = 13, |
| 100 | + fgColor = rgb(0x808080), |
| 101 | + bgColor = rgb(0xFFFFFF), |
| 102 | + }, |
| 103 | + ["BUILTINS"] = { |
| 104 | + id = 14, |
| 105 | + fgColor = rgb(0x880088), |
| 106 | + bgColor = rgb(0xFFFFFF), |
| 107 | + fontStyle = 1, |
| 108 | + }, |
| 109 | + ["ANNOTATION"] = { |
| 110 | + id = 15, |
| 111 | + fgColor = rgb(0xFF8000), |
| 112 | + bgColor = rgb(0xFFFFFF), |
| 113 | + fontStyle = 2, |
| 114 | + }, |
| 115 | + ["NODEPATH"] = { |
| 116 | + id = 16, |
| 117 | + fgColor = rgb(0x008080), |
| 118 | + bgColor = rgb(0xFFFFFF), |
| 119 | + }, |
| 120 | +} |
| 121 | +return L |
0 commit comments