Skip to content

Commit ff4bfed

Browse files
committed
fix from code review
1 parent c82a0c6 commit ff4bfed

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
@@ -1308,7 +1308,7 @@ LINE_CONTINUER = /// ^ \s* (?: , | \??\.(?![.\d]) | \??:: ) ///
13081308
13091309
# When appearing at the beginning of an indented line, causes a TERMINATOR token
13101310
# to be generated rather than an INDENT
1311-
INDENT_SUPPRESSOR = /// ^ \s* (?: and\s+(?!:)\S | or\s+(?!:)\S | && | \|\| ) ///
1311+
INDENT_SUPPRESSOR = /// ^ \s* (?: and\s+(?!:[^:])\S | or\s+(?!:[^:])\S | && | \|\| ) ///
13121312
13131313
STRING_INVALID_ESCAPE = ///
13141314
( (?:^|[^\\]) (?:\\\\)* ) # 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
@@ -1862,3 +1862,13 @@ test "#3933: prevent implicit calls when cotrol flow is missing `THEN`", ->
18621862
when a ->
18631863
^^
18641864
'''
1865+
1866+
test 'leading logical followed by :: should parse as continuation', ->
1867+
assertErrorFormat '''
1868+
a
1869+
and ::b
1870+
''','''
1871+
[stdin]:2:7: error: unexpected ::
1872+
and ::b
1873+
^^
1874+
'''

0 commit comments

Comments
 (0)