forked from beefsack/GDScript-sublime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGDScript.YAML-tmLanguage
116 lines (116 loc) · 4.35 KB
/
GDScript.YAML-tmLanguage
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# [PackageDev] target_format: plist, ext: tmLanguage
name: GDScript (Godot Engine)
scopeName: source.gdscript
fileTypes: [gd]
uuid: e08b7d98-5d50-4aa9-8935-7c759a4a8fdd
patterns:
- name: comment.line.number-sign.gdscript
match: (#).*$\n?
captures:
'1': {name: punctuation.definition.comment.number-sign.gdscript}
- name: comment.block.triple-quote
begin: ^(""")
beginCaptures:
'1': {name: punctuation.definition.comment.triple-quote.gdscript}
end: '(""")'
endCaptures:
'1': {name: punctuation.definition.comment.triple-quote.gdscript}
- name: string.quoted.double.gdscript
begin: '"'
end: (?<!\\)"
- name: string.quoted.single.gdscript
begin: "'"
end: (?<!\\)'
- name: string.quoted.triple.gdscript
begin: '"""'
end: (?<!\\)"""
- name: string.quoted.double.node-path.gdscript
begin: '@"'
end: (?<!\\)"
- name: constant.numeric.integer.hexadecimal.gdscript
match: \b(?i:0x[0-9A-Fa-f]*)\b
- name: constant.numeric.float.gdscript
match: \b(?i:(\d+\.\d*(e[\-\+]?\d+)?))\b
- name: constant.numeric.float.gdscript
match: \b(?i:(\.\d+(e[\-\+]?\d+)?))\b
- name: constant.numeric.float.gdscript
match: \b(?i:(\d+e[\-\+]?\d+))\b
- name: constant.numeric.integer.gdscript
match: \b\d+\b
- name: keyword.control.flow.gdscript
match: \b(?i:elif|else|for|if|while|break|continue|pass|return)\b
- name: keyword.operator.logical.gdscript
match: \b(?i:&&|and|in|is|!|not|\|\||or)\b
- name: keyword.operator.comparison.gdscript
match: <=|>=|==|<|>|!=
- name: keyword.operator.arithmetic.gdscript
match: \+=|-=|\*=|/=|%=|&=|\|=|\*|/|%|\+|-|<<|>>|&|\||\^|~
- name: keyword.operator.assignment.gdscript
match: '='
- name: support.type.basic.gdscript
match: \b(bool|int|float|String|funcref)\b
- name: support.type.vector.gdscript
match: \b(Vector[23]|Rect2|Matrix32?|Plane|Quat|AABB|Transform)\b
- name: support.type.engine.gdscript
match: \b(Color|Image|NodePath|RID|Object|InputEvent)\b
- name: support.type.container.gdscript
match: \b(Array|Dictionary|ByteArray|IntArray|FloatArray|StringArray|Vector[23]Array|ColorArray)\b
- match: '^\s*(?i:(class))\s+([a-zA-Z_][a-zA-Z_0-9]*)\s*:'
captures:
'1': {name: storage.type.class.gdscript}
'2': {name: entity.name.type.class.gdscript}
- begin: ^\s*(?i:(?:(static)\s+)?(func))\s+([a-zA-Z_][a-zA-Z_0-9]*)\s*\(
beginCaptures:
'1': {name: storage.modifier.static-function.gdscript}
'2': {name: storage.type.function.gdscript}
'3': {name: entity.name.function.gdscript}
end: '\)\s*((\-\>)\s*([a-zA-Z_][a-zA-Z_0-9]*))?\s*:'
patterns:
- name: variable.parameter.gdscript
match: '[a-zA-Z_][a-zA-Z_0-9]*'
- begin: ^\s*(?i:(signal))\s+([a-zA-Z_][a-zA-Z_0-9]*)\s*\(
beginCaptures:
'1': {name: storage.type.signal.gdscript}
'2': {name: entity.name.function.siglan.gdscript}
end: '\)\s*((\-\>)\s*([a-zA-Z_][a-zA-Z_0-9]*))?\s*:'
patterns:
- name: variable.parameter.gdscript
match: '[a-zA-Z_][a-zA-Z_0-9]*'
- match: (?i:\b(?:(onready)\s+)?(var))\s+([a-zA-Z_][a-zA-Z_0-9]*)
captures:
'1': {name: keyword.other.onready.gdscript}
'2': {name: storage.type.var.gdscript}
'3': {name: variable.other.gdscript}
- match: \b(?i:(const))\s+([a-zA-Z_][a-zA-Z_0-9]*)
captures:
'1': {name: storage.type.const.gdscript}
'2': {name: variable.other.gdscript}
- name: keyword.other.gdscript
match: \b(?i:extends|assert|breakpoint)\b
- name: entity.other.inherited-class.gdscript
match: (?<=extends)\s+[a-zA-Z_][a-zA-Z_0-9]*(\.([a-zA-Z_][a-zA-Z_0-9]*))?
- name: constant.language.gdscript
match: \b(?i:true|false|null)\b
- name: storage.modifier.static.gdscript
match: \b(?i:export|tool)\b
- match: \b((?i:setget))\b\s+(?:,?([a-zA-Z_][a-zA-Z_0-9]*)|([a-zA-Z_][a-zA-Z_0-9]*)\s*,\s*([a-zA-Z_][a-zA-Z_0-9]*))
captures:
'1': {name: keyword.operator.setget.gdscript}
'2': {name: entity.name.function.gdscript}
'3': {name: entity.name.function.gdscript}
'4': {name: entity.name.function.gdscript}
- name: keyword.control.flow.yield.gdscript
match: \b(?i:yield)\b
- name: invalid.illegal
match: \b(?i:var|const|onready|class|func|signal)\b
- name: entity.name.type.class-type.gdscript
match: ([A-Z][a-zA-Z_0-9]*)
- name: entity.name.type.variant.gdscript
match: ([a-z_][a-zA-Z_0-9]*)
- begin: ([a-z][a-zA-Z_0-9]*)\s*\(
beginCaptures:
'1': {name: entity.name.function.reference.gdscript}
end: \)
patterns:
- name: variable.parameter.gdscript
match: ([a-zA-Z_][a-zA-Z_0-9]*)