-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathgdscript.yaml
More file actions
68 lines (58 loc) · 2.94 KB
/
gdscript.yaml
File metadata and controls
68 lines (58 loc) · 2.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
filetype: gdscript
detect:
filename: "\\.gd$"
rules:
# Built-in constants
- constant: "\\b(INF|NAN|PI|TAU)\\b"
- constant.bool: "\\b(null|true|false)\\b"
# Function calls
- identifier: "\\b[a-zA-Z_][a-zA-Z_0-9]+\\("
# Built-in functions
- identifier: "\\b(abs|acos|asin|atan|atan2|bool|ceil|clamp|convert|cos|cosh|db2linear|decimals|deg2rad|ease|exp|float|floor|fmod|fposmod|hash|int|isinf|isnan|lerp|linear2db|load|log|max|min|nearest_po2|pow|preload|print|printerr|printraw|prints|printt|rad2deg|rand_range|rand_seed|randomize|randi|randf|range|round|seed|sin|slerp|sqrt|str|str2var|tan|typeof|var2str|weakref)\\b"
# Types
- type: "\\b(AABB|Array|Basis|Callable|Color|Dictionary|NodePath|Object|PackedByteArray|PackedColorArray|PackedFloat32Array|PackedFloat64Array|PackedInt32Array|PackedInt64Array|PackedVector2Array|PackedVector3Array|PackedVector4Array|Plane|PoolByteArray|PoolColorArray|PoolIntArray|PoolRealArray|PoolVector2Array|PoolVector3Array|Projection|Quat|Quaternion|Rect2|Rect2i|RID|Signal|String|StringName|Transform|Transform2D|Transform3D|Variant|Vector2|Vector2i|Vector3|Vector3i|Vector4|Vector4i|void)\\b"
# Class names (PascalCase)
- identifier: "\\b([A-Z][a-zA-Z0-9_]*)\\b"
# Constant names (CONSTANT_CASE)
- constant: "\\b([A-Z][A-Z0-9_]*)\\b"
# Definitions
- identifier: "func\\s+[a-zA-Z_][a-zA-Z_0-9]*"
# Annotations
- statement.meta: "@[A-Za-z_][A-Za-z0-9_]*\\b"
# Keywords
- statement: "\\b(and|as|assert|await|break|breakpoint|class|class_name|const|continue|elif|else|enum|export|extends|for|func|get|if|in|is|map|master|mastersync|match|not|onready|or|pass|remote|remotesync|return|self|set|setget|slave|slavesync|signal|static|super|sync|tool|var|when|while|yield)\\b"
# Operators
- statement: "[.:;,+*|=!\\%]|<|>|/|-|&"
# Parentheses
- statement: "[(){}]|\\[|\\]"
# Numbers
- constant.number: "-?\\b(?:0[xX](?:[0-9a-fA-F]_?)+|0[bB](?:[01]_?)+|(?:(?:[0-9]_?)*\\.(?:[0-9]_?)+)(?:[eE]-?(?:[0-9]_?)+)?|(?:[0-9]_?)+\\.?(?:[eE]-?(?:[0-9]_?)+)?)\\b"
- constant.string:
start: "\"\"\""
end: "\"\"\""
skip: "\\\\."
rules:
- constant.specialChar: "\\\\([0-7]{3}|x[A-Fa-f0-9]{2}|u[A-Fa-f0-9]{4}|U[A-Fa-f0-9]{8})"
- constant.string:
start: "\'\'\'"
end: "\'\'\'"
skip: "\\\\."
rules:
- constant.specialChar: "\\\\([0-7]{3}|x[A-Fa-f0-9]{2}|u[A-Fa-f0-9]{4}|U[A-Fa-f0-9]{8})"
- constant.string:
start: "\""
end: "\""
skip: "\\\\."
rules:
- constant.specialChar: "\\\\([0-7]{3}|x[A-Fa-f0-9]{2}|u[A-Fa-f0-9]{4}|U[A-Fa-f0-9]{8})"
- constant.string:
start: "'"
end: "'"
skip: "\\\\."
rules:
- constant.specialChar: "\\\\([0-7]{3}|x[A-Fa-f0-9]{2}|u[A-Fa-f0-9]{4}|U[A-Fa-f0-9]{8})"
- comment:
start: "#"
end: "$"
rules:
- todo: "(TODO|XXX|FIXME):?"