Skip to content

Commit 569ca39

Browse files
authored
Fix missing bailout from incomplete member terms (#262)
Fixes #261
1 parent 95a1c63 commit 569ca39

2 files changed

Lines changed: 49 additions & 10 deletions

File tree

CoffeeScript.sublime-syntax

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -911,6 +911,7 @@ contexts:
911911
- member-function
912912
- member-variable
913913
pop: 1
914+
- include: immediately-pop
914915

915916
member-function:
916917
- meta_include_prototype: false

tests/syntax_test_scope.coffee

Lines changed: 48 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -562,10 +562,19 @@ class
562562
# ^ meta.function-call.identifier.coffee variable.function.coffee
563563
# ^^^^ meta.function-call.arguments.coffee
564564

565-
@name()
565+
@name(@, obj.obj.)
566566
# ^ variable.language.this.coffee
567567
# ^^^^ meta.function-call.identifier.coffee variable.function.coffee
568-
# ^^ meta.function-call.arguments.coffee
568+
# ^^^^^^^^^^^^^ meta.function-call.arguments.coffee
569+
# ^ punctuation.section.group.begin.coffee
570+
# ^ variable.language.this.coffee
571+
# ^ punctuation.separator.sequence.coffee
572+
# ^^^^^^^^ meta.path.coffee
573+
# ^^^ variable.other.object.coffee
574+
# ^ punctuation.accessor.dot.coffee
575+
# ^^^ variable.other.object.coffee
576+
# ^ punctuation.accessor.dot.coffee
577+
# ^ punctuation.section.group.end.coffee
569578

570579
@$('#notification')
571580
# ^ variable.language.this.coffee
@@ -581,19 +590,48 @@ class
581590
super.key
582591
# ^^^^^^^^^ meta.path.coffee
583592
# ^^^^^ variable.language.super.coffee
584-
# ^ meta.path.coffee punctuation.accessor.dot.coffee
585-
# ^^^ meta.path.coffee variable.other.member.coffee
593+
# ^ punctuation.accessor.dot.coffee
594+
# ^^^ variable.other.member.coffee
595+
# ^ - meta
596+
597+
this.member
598+
# ^^^^^^^^^^^ meta.path.coffee
599+
# ^^^^ variable.language.this.coffee
600+
# ^ punctuation.accessor.dot.coffee
601+
# ^^^^^^ variable.other.member.coffee
602+
# ^ - meta
586603

587-
this.key
588-
# ^^^^^^^^ meta.path.coffee
604+
this.obj.member
605+
# ^^^^^^^^^^^^^^^ meta.path.coffee
589606
# ^^^^ variable.language.this.coffee
590-
# ^ meta.path.coffee punctuation.accessor.dot.coffee
591-
# ^^^ meta.path.coffee variable.other.member.coffee
607+
# ^ punctuation.accessor.dot.coffee
608+
# ^^^ variable.other.object.coffee
609+
# ^ punctuation.accessor.dot.coffee
610+
# ^^^^^^ variable.other.member.coffee
611+
# ^ - meta
612+
613+
@member
614+
# ^^^^^^^ meta.path.coffee
615+
# ^ variable.language.this.coffee
616+
# ^^^^^^ variable.other.member.coffee
617+
# ^ - meta
592618

593-
@key
619+
@obj.member
594620
# ^^^^ meta.path.coffee
595621
# ^ variable.language.this.coffee
596-
# ^^^ variable.other.member.coffee
622+
# ^^^ variable.other.object.coffee
623+
# ^ punctuation.accessor.dot.coffee
624+
# ^^^^^^ variable.other.member.coffee
625+
# ^ - meta
626+
627+
@obj.obj.
628+
# ^^^^^^^^^ meta.path.coffee
629+
# ^ variable.language.this.coffee
630+
# ^^^ variable.other.object.coffee
631+
# ^ punctuation.accessor.dot.coffee
632+
# ^^^ variable.other.object.coffee
633+
# ^ punctuation.accessor.dot.coffee
634+
# ^ - meta
597635

598636
obj.Object
599637
# ^^^^^^^^^^ meta.path.coffee

0 commit comments

Comments
 (0)