diff --git a/JavaScript/JavaScript.sublime-syntax b/JavaScript/JavaScript.sublime-syntax index 408873c68a..04b9d1dc3f 100644 --- a/JavaScript/JavaScript.sublime-syntax +++ b/JavaScript/JavaScript.sublime-syntax @@ -1038,7 +1038,7 @@ contexts: scope: keyword.operator.arithmetic.js push: expression-begin - match: ',' - scope: punctuation.separator.comma.js # TODO: Change to keyword.operator.comma.js ? + scope: keyword.operator.comma.js # Comma operator, not punctuation. push: expression-begin ternary-operator: diff --git a/JavaScript/tests/syntax_test_js.js b/JavaScript/tests/syntax_test_js.js index e5bec29f51..a6e049df94 100644 --- a/JavaScript/tests/syntax_test_js.js +++ b/JavaScript/tests/syntax_test_js.js @@ -1329,6 +1329,17 @@ var re = /^\/[^/]+/; // ^ keyword.operator.arithmetic y / ((x - 1) / -2); + 1, 2; +// ^ keyword.operator.comma - punctuation + + a; + [1, 2]; +// ^ meta.sequence punctuation.separator.comma - meta.brackets - keyword + + a + [1, 2]; +// ^ meta.brackets keyword.operator.comma - meta.sequence - punctuation + define(['common'], function(common) { // ^ meta.function.declaration var namedFunc = function() {