Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit b14ae08

Browse files
committed
Allow whitespaces before line commet in arrow function
1 parent f5cf767 commit b14ae08

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

grammars/javascript.cson

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@
467467
\\s*{|
468468
\\G\\(|
469469
\\G[\\w$]+|
470-
\\s*/\\*|//
470+
\\s*/\\*|\\s*//
471471
)(?=\\s*\\S))
472472
'''
473473
'patterns': [
@@ -505,7 +505,7 @@
505505
\\s*{|
506506
\\G(\\.)?[a-zA-Z_$][\\w$]*\\s*(=)\\s*\\(|
507507
\\G(\\.)?[a-zA-Z_$][\\w$]*\\s*(=)\\s*[\\w$]+|
508-
\\s*/\\*|//
508+
\\s*/\\*|\\s*//
509509
)(?=\\s*\\S))
510510
'''
511511
'patterns': [

spec/javascript-spec.coffee

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1465,13 +1465,13 @@ describe "Javascript grammar", ->
14651465

14661466
lines = grammar.tokenizeLines '''
14671467
x =>
1468-
// comment
1468+
// comment
14691469
{}
14701470
'''
14711471
expect(lines[0][0]).toEqual value: 'x', scopes: ['source.js', 'meta.function.arrow.js', 'meta.parameters.js', 'variable.parameter.function.js']
14721472
expect(lines[0][2]).toEqual value: '=>', scopes: ['source.js', 'meta.function.arrow.js', 'storage.type.function.arrow.js']
1473-
expect(lines[1][0]).toEqual value: '//', scopes: ['source.js', 'comment.line.double-slash.js', 'punctuation.definition.comment.js']
1474-
expect(lines[1][1]).toEqual value: ' comment', scopes: ['source.js', 'comment.line.double-slash.js']
1473+
expect(lines[1][1]).toEqual value: '//', scopes: ['source.js', 'comment.line.double-slash.js', 'punctuation.definition.comment.js']
1474+
expect(lines[1][2]).toEqual value: ' comment', scopes: ['source.js', 'comment.line.double-slash.js']
14751475
expect(lines[2][0]).toEqual value: '{', scopes: ['source.js', 'punctuation.definition.function.body.begin.bracket.curly.js']
14761476

14771477
it "tokenizes comments inside function parameters correctly", ->

0 commit comments

Comments
 (0)