@@ -205,13 +205,13 @@ contexts:
205
205
206
206
- match : local{{identifier_break}}
207
207
scope : storage.modifier.lua
208
- push : expression-list
208
+ push : expression-list-stmt
209
209
210
210
- match : end{{identifier_break}}
211
211
scope : invalid.illegal.unexpected-end.lua
212
212
213
213
- match : (?=\S)
214
- push : expression
214
+ push : expression-stmt
215
215
216
216
block-contents :
217
217
- meta_scope : meta.block.lua
@@ -312,15 +312,15 @@ contexts:
312
312
- include : else-pop
313
313
314
314
- - match : (?==)
315
- set : expression-list-end
315
+ set : expression-list-stmt- end
316
316
317
317
- match : in{{identifier_break}}
318
318
scope : keyword.control.loop.lua
319
319
set : expression-list
320
320
321
321
- include : else-pop
322
322
323
- - expression-list
323
+ - expression-list-stmt
324
324
325
325
- match : ' ::'
326
326
scope : punctuation.definition.label.begin.lua
@@ -367,12 +367,24 @@ contexts:
367
367
- expression-end
368
368
- expression-begin
369
369
370
+ expression-stmt :
371
+ - match : ' '
372
+ set :
373
+ - expression-stmt-end
374
+ - expression-begin
375
+
370
376
expression-list :
371
377
- match : ' '
372
378
set :
373
379
- expression-list-end
374
380
- expression-begin
375
381
382
+ expression-list-stmt :
383
+ - match : ' '
384
+ set :
385
+ - expression-list-stmt-end
386
+ - expression-begin
387
+
376
388
expression-end :
377
389
- match : (?=;)
378
390
pop : 1
@@ -394,6 +406,12 @@ contexts:
394
406
395
407
- include : else-pop
396
408
409
+ expression-stmt-end :
410
+ - match : =(?!=)
411
+ scope : keyword.operator.assignment.lua
412
+ push : expression-begin
413
+ - include : expression-end
414
+
397
415
expression-list-end :
398
416
- match : ' ,'
399
417
scope : punctuation.separator.comma.lua
@@ -405,6 +423,12 @@ contexts:
405
423
- left-angle-is-less-than
406
424
- include : expression-end
407
425
426
+ expression-list-stmt-end :
427
+ - match : =(?!=)
428
+ scope : keyword.operator.assignment.lua
429
+ push : expression-begin
430
+ - include : expression-list-end
431
+
408
432
expression-begin :
409
433
- match : (?=;)
410
434
pop : 1
@@ -457,13 +481,19 @@ contexts:
457
481
- match : \.\.
458
482
scope : keyword.operator.concatenation.lua
459
483
push : expression-begin
460
- - match : =
461
- scope : keyword.operator.assignment.lua
462
- push : expression-begin
463
484
- match : (?:and|or){{identifier_break}}
464
485
scope : keyword.operator.logical.lua
465
486
push : expression-begin
466
487
488
+ # assume that == is being typed
489
+ - match : =(?=\s*(?:{{reserved_word_statement}}|$))
490
+ scope : keyword.operator.comparison.lua
491
+ push : expression-begin
492
+ # only complain once it is clear that it isn't ==
493
+ - match : =(?!=)
494
+ scope : invalid.illegal.invalid-operator.lua
495
+ push : expression-begin
496
+
467
497
accessor :
468
498
- match : ' [.:]'
469
499
scope : punctuation.accessor.lua
0 commit comments