Skip to content

Commit ed29741

Browse files
author
Blake Gearin
committed
Fix comparisons, add floats, add coords, remove extra patterns
1 parent 74488b0 commit ed29741

File tree

2 files changed

+91
-112
lines changed

2 files changed

+91
-112
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
node_modules
2-
*.vsix
1+
test_files
2+
*.vsix

syntaxes/pulpscript.tmLanguage.json

Lines changed: 89 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,20 @@
1717
{
1818
"include": "#comparisons"
1919
},
20+
{
21+
"include": "#commas"
22+
},
2023
{
2124
"include": "#augmented-assignments"
2225
},
2326
{
2427
"include": "#assignment"
2528
},
2629
{
27-
"include": "#numeric"
30+
"include": "#coords"
31+
},
32+
{
33+
"include": "#floats"
2834
},
2935
{
3036
"include": "#spaces"
@@ -41,9 +47,6 @@
4147
{
4248
"include": "#colons"
4349
},
44-
{
45-
"include": "#commas"
46-
},
4750
{
4851
"include": "#event"
4952
},
@@ -59,12 +62,8 @@
5962
],
6063
"repository": {
6164
"comments": {
62-
"patterns": [
63-
{
64-
"name": "comment.line.double-slash.pulpscript",
65-
"match": "//.*"
66-
}
67-
]
65+
"name": "comment.line.double-slash.pulpscript",
66+
"match": "//.*"
6867
},
6968
"strings": {
7069
"name": "string.quoted.double.pulpscript",
@@ -89,7 +88,7 @@
8988
"include": "#spaces"
9089
},
9190
{
92-
"include": "#numeric"
91+
"include": "#floats"
9392
},
9493
{
9594
"include": "#functions"
@@ -118,102 +117,102 @@
118117
]
119118
},
120119
"decrement": {
121-
"patterns": [
122-
{
123-
"name": "keyword.operator.decrement.pulpscript",
124-
"match": "--"
125-
}
126-
]
120+
"name": "keyword.operator.decrement.pulpscript",
121+
"match": "--"
127122
},
128123
"increment": {
129124
"name": "keyword.operator.increment.pulpscript",
130-
"patterns": [
131-
{
132-
"name": "keyword.operator.increment.pulpscript",
133-
"match": "\\+\\+"
134-
}
135-
]
125+
"match": "\\+\\+"
136126
},
137127
"comparisons": {
138-
"begin": "(if|elseif) (\\w*)( )?",
139-
"beginCaptures": {
140-
"0": {
141-
"name": "text.pulpscript"
142-
},
143-
"1": {
144-
"name": "keyword.control.pulpscript"
145-
},
146-
"2": {
147-
"name": "variable.pulpscript"
148-
}
149-
},
150-
"end": "[0-9]*\\b (then)",
151-
"endCaptures": {
152-
"0": {
153-
"name": "constant.numeric.pulpscript"
154-
},
155-
"1": {
156-
"name": "keyword.control.pulpscript"
157-
}
158-
},
159128
"patterns": [
160129
{
161-
"include": "#controls"
130+
"begin": "\\b([0-9]+)(==|<=|>=)([0-9]+)",
131+
"beginCaptures": {
132+
"0": {
133+
"name": "constant.numeric.pulpscript"
134+
},
135+
"1": {
136+
"name": "constant.numeric.pulpscript"
137+
},
138+
"2": {
139+
"name": "keyword.operator.comparison.pulpscript"
140+
}
141+
},
142+
"end": "\\b"
162143
},
163144
{
164-
"include": "#numeric"
145+
"begin": "\\b(\\w+)(==|<=|>=)([0-9]+)",
146+
"beginCaptures": {
147+
"0": {
148+
"name": "constant.numeric.pulpscript"
149+
},
150+
"1": {
151+
"name": "variable.pulpscript"
152+
},
153+
"2": {
154+
"name": "keyword.operator.comparison.pulpscript"
155+
}
156+
},
157+
"end": "\\b"
165158
},
166159
{
167-
"include": "#strings"
160+
"begin": "\\b([0-9]+)(==|<=|>=)(\\w+)",
161+
"beginCaptures": {
162+
"0": {
163+
"name": "variable.pulpscript"
164+
},
165+
"1": {
166+
"name": "constant.numeric.pulpscript"
167+
},
168+
"2": {
169+
"name": "keyword.operator.comparison.pulpscript"
170+
}
171+
},
172+
"end": "\\b"
168173
},
169174
{
170175
"name": "keyword.operator.comparison.pulpscript",
171176
"match": "(==|<=|>=)"
172-
},
173-
{
174-
"include": "#variables"
175177
}
176178
]
177179
},
178180
"augmented-assignments": {
179-
"patterns": [
180-
{
181-
"name": "keyword.operator.assignment.augmented.pulpscript",
182-
"match": "(-=|\\+=|\\*=|\/=)"
183-
}
184-
]
181+
"name": "keyword.operator.assignment.augmented.pulpscript",
182+
"match": "(-=|\\+=|\\*=|\/=)"
185183
},
186184
"assignment": {
187-
"patterns": [
188-
{
189-
"name": "keyword.operator.assignment.pulpscript",
190-
"match": "="
191-
}
192-
]
185+
"name": "keyword.operator.assignment.pulpscript",
186+
"match": "="
193187
},
194-
"numeric": {
195-
"patterns": [
196-
{
197-
"name": "constant.numeric.pulpscript",
198-
"match": "[^\\w][0-9]"
188+
"coords": {
189+
"begin": "\\b([0-9]+)",
190+
"beginCaptures": {
191+
"0": {
192+
"name": "constant.numeric.pulpscript"
199193
}
200-
]
194+
},
195+
"end": "(,)?([0-9]+)?\\b",
196+
"endCaptures": {
197+
"0": {
198+
"name": "constant.numeric.pulpscript"
199+
},
200+
"1": {
201+
"name": "punctuation.separator.comma.pulpscript"
202+
}
203+
}
204+
},
205+
"floats": {
206+
"name": "constant.numeric.pulpscript",
207+
"match": "[^a-zA-Z_][0-9]+"
201208
},
202209
"spaces": {
203-
"patterns": [
204-
{
205-
"name": "text.pulpscript",
206-
"match": " "
207-
}
208-
]
210+
"name": "text.pulpscript",
211+
"match": " "
209212
},
210213
"functions": {
211-
"patterns": [
212-
{
213-
"name": "support.function.pulpscript",
214-
"match": "\\b(log|dump|say|fin|swap|frame|play|wait|shake|tell|to|call|emit|mimic|ignore|listen|act|draw|hide|window|label(:( )?)?|fill|crop|goto|sound|stop|loop|bpm|store|restore|toss|random|floor|ceil|round|sine|cosine|tangent|radians|degrees|invert|solid|type|id|name|embed:( )?)\\b"
215-
}
216-
]
214+
"name": "support.function.pulpscript",
215+
"match": "\\b(log|dump|say|fin|swap|frame|play|wait|shake|tell|to|call|emit|mimic|ignore|listen|act|draw|hide|window|label(:( )?)?|fill|crop|goto|sound|stop|loop|bpm|store|restore|toss|random|floor|ceil|round|sine|cosine|tangent|radians|degrees|invert|solid|type|id|name|embed:( )?)\\b"
217216
},
218217
"built-in-events": {
219218
"begin": "\\b(on)\\b( )",
@@ -246,28 +245,16 @@
246245
]
247246
},
248247
"controls": {
249-
"patterns": [
250-
{
251-
"name": "keyword.control.pulpscript",
252-
"match": "\\b(if|then|on|while|do|else|elseif|end|menu|ask|option|once|at)\\b"
253-
}
254-
]
248+
"name": "keyword.control.pulpscript",
249+
"match": "\\b(if|then|on|while|do|else|elseif|end|menu|ask|option|once|at)\\b"
255250
},
256251
"colons": {
257-
"patterns": [
258-
{
259-
"name": "punctuation.definition.constant.pulpscript",
260-
"match": ":"
261-
}
262-
]
252+
"name": "punctuation.definition.constant.pulpscript",
253+
"match": ":"
263254
},
264255
"commas": {
265-
"patterns": [
266-
{
267-
"name": "punctuation.separator.comma.pulpscript",
268-
"match": ","
269-
}
270-
]
256+
"name": "punctuation.separator.comma.pulpscript",
257+
"match": ","
271258
},
272259
"event": {
273260
"patterns": [
@@ -327,20 +314,12 @@
327314
]
328315
},
329316
"variables": {
330-
"patterns": [
331-
{
332-
"name": "variable.pulpscript",
333-
"match": "(.)"
334-
}
335-
]
317+
"name": "variable.pulpscript",
318+
"match": "(.)"
336319
},
337320
"accessor": {
338-
"patterns": [
339-
{
340-
"name": "punctuation.accessor.pulpscript",
341-
"match": "\\b(\\.)\\b"
342-
}
343-
]
321+
"name": "punctuation.accessor.pulpscript",
322+
"match": "\\b(\\.)\\b"
344323
}
345324
},
346325
"scopeName": "text.pulpscript"

0 commit comments

Comments
 (0)