From 7dc396c2620b8cace1748d836da7e14434de0d64 Mon Sep 17 00:00:00 2001 From: deathaxe Date: Mon, 5 Jan 2026 18:26:40 +0100 Subject: [PATCH] Fix missing bailout from incomplete member terms Fixes #261 --- CoffeeScript.sublime-syntax | 1 + tests/syntax_test_scope.coffee | 58 ++++++++++++++++++++++++++++------ 2 files changed, 49 insertions(+), 10 deletions(-) diff --git a/CoffeeScript.sublime-syntax b/CoffeeScript.sublime-syntax index 6d86095..485692d 100644 --- a/CoffeeScript.sublime-syntax +++ b/CoffeeScript.sublime-syntax @@ -911,6 +911,7 @@ contexts: - member-function - member-variable pop: 1 + - include: immediately-pop member-function: - meta_include_prototype: false diff --git a/tests/syntax_test_scope.coffee b/tests/syntax_test_scope.coffee index dbee03c..255486b 100644 --- a/tests/syntax_test_scope.coffee +++ b/tests/syntax_test_scope.coffee @@ -562,10 +562,19 @@ class # ^ meta.function-call.identifier.coffee variable.function.coffee # ^^^^ meta.function-call.arguments.coffee - @name() + @name(@, obj.obj.) # ^ variable.language.this.coffee # ^^^^ meta.function-call.identifier.coffee variable.function.coffee -# ^^ meta.function-call.arguments.coffee +# ^^^^^^^^^^^^^ meta.function-call.arguments.coffee +# ^ punctuation.section.group.begin.coffee +# ^ variable.language.this.coffee +# ^ punctuation.separator.sequence.coffee +# ^^^^^^^^ meta.path.coffee +# ^^^ variable.other.object.coffee +# ^ punctuation.accessor.dot.coffee +# ^^^ variable.other.object.coffee +# ^ punctuation.accessor.dot.coffee +# ^ punctuation.section.group.end.coffee @$('#notification') # ^ variable.language.this.coffee @@ -581,19 +590,48 @@ class super.key # ^^^^^^^^^ meta.path.coffee # ^^^^^ variable.language.super.coffee -# ^ meta.path.coffee punctuation.accessor.dot.coffee -# ^^^ meta.path.coffee variable.other.member.coffee +# ^ punctuation.accessor.dot.coffee +# ^^^ variable.other.member.coffee +# ^ - meta + + this.member +# ^^^^^^^^^^^ meta.path.coffee +# ^^^^ variable.language.this.coffee +# ^ punctuation.accessor.dot.coffee +# ^^^^^^ variable.other.member.coffee +# ^ - meta - this.key -# ^^^^^^^^ meta.path.coffee + this.obj.member +# ^^^^^^^^^^^^^^^ meta.path.coffee # ^^^^ variable.language.this.coffee -# ^ meta.path.coffee punctuation.accessor.dot.coffee -# ^^^ meta.path.coffee variable.other.member.coffee +# ^ punctuation.accessor.dot.coffee +# ^^^ variable.other.object.coffee +# ^ punctuation.accessor.dot.coffee +# ^^^^^^ variable.other.member.coffee +# ^ - meta + + @member +# ^^^^^^^ meta.path.coffee +# ^ variable.language.this.coffee +# ^^^^^^ variable.other.member.coffee +# ^ - meta - @key + @obj.member # ^^^^ meta.path.coffee # ^ variable.language.this.coffee -# ^^^ variable.other.member.coffee +# ^^^ variable.other.object.coffee +# ^ punctuation.accessor.dot.coffee +# ^^^^^^ variable.other.member.coffee +# ^ - meta + + @obj.obj. +# ^^^^^^^^^ meta.path.coffee +# ^ variable.language.this.coffee +# ^^^ variable.other.object.coffee +# ^ punctuation.accessor.dot.coffee +# ^^^ variable.other.object.coffee +# ^ punctuation.accessor.dot.coffee +# ^ - meta obj.Object # ^^^^^^^^^^ meta.path.coffee