Skip to content

Commit cd108d4

Browse files
committed
Lazy fix for import/export keywords
Supersedes and closes #245
1 parent 6c40b67 commit cd108d4

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

CoffeeScript.sublime-syntax

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@ contexts:
7575
- include: embedded_comment
7676
- match: '/(?![\s=/*+{}?])(\\.|.)*?/[igmy]{0,4}(?![a-zA-Z0-9])'
7777
scope: string.regexp.coffee
78+
- match: \bas\b
79+
scope: keyword.operator.assignment.as.coffee
80+
- match: \bexport\b
81+
scope: keyword.control.export.coffee
82+
- match: \b(?:import|from)\b
83+
scope: keyword.control.import.coffee
7884
- match: |-
7985
(?x)
8086
\b(?<![\.\$])(

tests/syntax_test_scope.coffee

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# SYNTAX TEST "CoffeeScript.sublime-syntax"
22

3+
import {"foo"} from bar as baz
4+
# <- keyword.control.import.coffee
5+
#^^^^^ keyword.control.import.coffee
6+
# ^^^^ keyword.control.import.coffee
7+
# ^^ keyword.operator.assignment.as.coffee
8+
9+
export parentClass
10+
# <- keyword.control.export.coffee
11+
#^^^^^ keyword.control.export.coffee
12+
313
class extends parentClass
414
# <- meta.class.coffee storage.type.class.coffee
515
#^^^^^^^^^^^^^^^^^^^^^^^^ meta.class.coffee

0 commit comments

Comments
 (0)