Skip to content

Commit 0f3f5ac

Browse files
committed
fix from code review
1 parent 4cf6652 commit 0f3f5ac

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

lib/coffeescript/lexer.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/lexer.coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1277,7 +1277,7 @@ LINE_CONTINUER = /// ^ \s* (?: , | \??\.(?![.\d]) | \??:: ) ///
12771277
12781278
# When appearing at the beginning of an indented line, causes a TERMINATOR token
12791279
# to be generated rather than an INDENT
1280-
INDENT_SUPPRESSOR = /// ^ \s* (?: and\s+(?!:)\S | or\s+(?!:)\S | && | \|\| ) ///
1280+
INDENT_SUPPRESSOR = /// ^ \s* (?: and\s+(?!:[^:])\S | or\s+(?!:[^:])\S | && | \|\| ) ///
12811281
12821282
STRING_INVALID_ESCAPE = ///
12831283
( (?:^|[^\\]) (?:\\\\)* ) # Make sure the escape isn’t escaped.

test/error_messages.coffee

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1946,3 +1946,13 @@ test "`new.target` cannot be assigned", ->
19461946
new.target = b
19471947
^
19481948
'''
1949+
1950+
test 'leading logical followed by :: should parse as continuation', ->
1951+
assertErrorFormat '''
1952+
a
1953+
and ::b
1954+
''','''
1955+
[stdin]:2:7: error: unexpected ::
1956+
and ::b
1957+
^^
1958+
'''

0 commit comments

Comments
 (0)