Skip to content

Commit 3c9dfe0

Browse files
authored
Fix of keyword in for loops (#264)
1 parent 1931434 commit 3c9dfe0

2 files changed

Lines changed: 34 additions & 0 deletions

File tree

CoffeeScript.sublime-syntax

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,9 @@ contexts:
423423
- match: in{{break}}
424424
scope: keyword.control.loop.in.coffee
425425
pop: 1
426+
- match: of{{break}}
427+
scope: keyword.control.loop.of.coffee
428+
pop: 1
426429
- match: ','
427430
scope: punctuation.separator.sequence.coffee
428431
- include: variables

tests/syntax_test_scope.coffee

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,37 @@ class
347347
# ^ variable.other.readwrite.coffee
348348
# ^^ keyword.operator.word.coffee keyword.operator.comparison.coffee
349349
# ^^^^^^^^ variable.other.readwrite.coffee
350+
# ^ punctuation.section.group.end.coffee
351+
352+
for a, b of @links
353+
# ^^^ keyword.control.loop.for.coffee
354+
# ^ variable.other.readwrite.coffee
355+
# ^ punctuation.separator.sequence.coffee
356+
# ^ variable.other.readwrite.coffee
357+
# ^^ keyword.control.loop.of.coffee
358+
# ^ variable.language.this.coffee
359+
# ^^^^^ variable.other.member.coffee
360+
361+
@links = ($(a) for a of @$links unless a of filtered)
362+
# ^ variable.language.this.coffee
363+
# ^^^^^ variable.other.member.coffee
364+
# ^ keyword.operator.assignment.coffee
365+
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.group.coffee
366+
# ^ punctuation.section.group.begin.coffee
367+
# ^ meta.function-call.identifier.coffee variable.function.coffee
368+
# ^^^ meta.function-call.arguments.coffee
369+
# ^ punctuation.section.group.begin.coffee
370+
# ^ variable.other.readwrite.coffee
371+
# ^ punctuation.section.group.end.coffee
372+
# ^^^ keyword.control.loop.for.coffee
373+
# ^ variable.other.readwrite.coffee
374+
# ^^ keyword.control.loop.of.coffee
375+
# ^ variable.language.this.coffee
376+
# ^^^^^^ variable.other.member.coffee
377+
# ^^^^^^ keyword.control.conditional.unless.coffee
378+
# ^ variable.other.readwrite.coffee
379+
# ^^ keyword.operator.word.coffee keyword.operator.comparison.coffee
380+
# ^^^^^^^^ variable.other.readwrite.coffee
350381
# ^ punctuation.section.group.end.coffee
351382

352383
###[ KEYWORDS ]################################################################

0 commit comments

Comments
 (0)