From 2ace9429d8fbdefb98b671cb8e838c35c776f28c Mon Sep 17 00:00:00 2001 From: deathaxe Date: Fri, 6 Mar 2026 17:26:34 +0100 Subject: [PATCH] Fix of keyword in for loops --- CoffeeScript.sublime-syntax | 3 +++ tests/syntax_test_scope.coffee | 31 +++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/CoffeeScript.sublime-syntax b/CoffeeScript.sublime-syntax index 485692d..26d50f6 100644 --- a/CoffeeScript.sublime-syntax +++ b/CoffeeScript.sublime-syntax @@ -423,6 +423,9 @@ contexts: - match: in{{break}} scope: keyword.control.loop.in.coffee pop: 1 + - match: of{{break}} + scope: keyword.control.loop.of.coffee + pop: 1 - match: ',' scope: punctuation.separator.sequence.coffee - include: variables diff --git a/tests/syntax_test_scope.coffee b/tests/syntax_test_scope.coffee index 255486b..afd7f55 100644 --- a/tests/syntax_test_scope.coffee +++ b/tests/syntax_test_scope.coffee @@ -347,6 +347,37 @@ class # ^ variable.other.readwrite.coffee # ^^ keyword.operator.word.coffee keyword.operator.comparison.coffee # ^^^^^^^^ variable.other.readwrite.coffee +# ^ punctuation.section.group.end.coffee + + for a, b of @links +# ^^^ keyword.control.loop.for.coffee +# ^ variable.other.readwrite.coffee +# ^ punctuation.separator.sequence.coffee +# ^ variable.other.readwrite.coffee +# ^^ keyword.control.loop.of.coffee +# ^ variable.language.this.coffee +# ^^^^^ variable.other.member.coffee + + @links = ($(a) for a of @$links unless a of filtered) +# ^ variable.language.this.coffee +# ^^^^^ variable.other.member.coffee +# ^ keyword.operator.assignment.coffee +# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.group.coffee +# ^ punctuation.section.group.begin.coffee +# ^ meta.function-call.identifier.coffee variable.function.coffee +# ^^^ meta.function-call.arguments.coffee +# ^ punctuation.section.group.begin.coffee +# ^ variable.other.readwrite.coffee +# ^ punctuation.section.group.end.coffee +# ^^^ keyword.control.loop.for.coffee +# ^ variable.other.readwrite.coffee +# ^^ keyword.control.loop.of.coffee +# ^ variable.language.this.coffee +# ^^^^^^ variable.other.member.coffee +# ^^^^^^ keyword.control.conditional.unless.coffee +# ^ variable.other.readwrite.coffee +# ^^ keyword.operator.word.coffee keyword.operator.comparison.coffee +# ^^^^^^^^ variable.other.readwrite.coffee # ^ punctuation.section.group.end.coffee ###[ KEYWORDS ]################################################################