Skip to content

Commit

Permalink
Lazy fix for import/export keywords
Browse files Browse the repository at this point in the history
Supersedes and closes #245
  • Loading branch information
deathaxe committed Aug 24, 2024
1 parent 6c40b67 commit cd108d4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CoffeeScript.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ contexts:
- include: embedded_comment
- match: '/(?![\s=/*+{}?])(\\.|.)*?/[igmy]{0,4}(?![a-zA-Z0-9])'
scope: string.regexp.coffee
- match: \bas\b
scope: keyword.operator.assignment.as.coffee
- match: \bexport\b
scope: keyword.control.export.coffee
- match: \b(?:import|from)\b
scope: keyword.control.import.coffee
- match: |-
(?x)
\b(?<![\.\$])(
Expand Down
10 changes: 10 additions & 0 deletions tests/syntax_test_scope.coffee
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# SYNTAX TEST "CoffeeScript.sublime-syntax"

import {"foo"} from bar as baz
# <- keyword.control.import.coffee
#^^^^^ keyword.control.import.coffee
# ^^^^ keyword.control.import.coffee
# ^^ keyword.operator.assignment.as.coffee

export parentClass
# <- keyword.control.export.coffee
#^^^^^ keyword.control.export.coffee

class extends parentClass
# <- meta.class.coffee storage.type.class.coffee
#^^^^^^^^^^^^^^^^^^^^^^^^ meta.class.coffee
Expand Down

0 comments on commit cd108d4

Please sign in to comment.