Skip to content

Commit

Permalink
[JavaScript] Add support for unicode identifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
wbond committed Feb 24, 2016
1 parent d3baaed commit d6362b6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions JavaScript/JavaScript.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ file_extensions:
first_line_match: ^#!/.*\b(node|js)$\n?
scope: source.js
variables:
identifier: '[_$a-zA-Z][$\w]*'
identifier: '[_$[:alpha:]][_$[:alnum:]]*'
func_lookahead: '\s*\b(async\s+)?function\b'
arrow_func_lookahead: '\s*(\basync\s*)?([_$a-zA-Z][$\w]*|\(.*?\))\s*=>'
arrow_func_lookahead: '\s*(\basync\s*)?([_$[:alpha:]][_$[:alnum:]]*|\(.*?\))\s*=>'

contexts:
main:
Expand Down
3 changes: 3 additions & 0 deletions JavaScript/syntax_test_js.js
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,9 @@ var result = 200 / 400 + 500 /
// ^ keyword.operator.arithmetic
100;

var π = 3.141592653
// ^ variable.other.readwrite

var angle = 2*π / count // angle between circles
// ^ keyword.operator.arithmetic

Expand Down

0 comments on commit d6362b6

Please sign in to comment.