Skip to content

Commit daa65c2

Browse files
committed
break out of get_pettern only if next line is not a pattern
1 parent 29bd96a commit daa65c2

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

fluent/syntax/parser.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,12 +349,14 @@ def get_number(self, ps):
349349
@with_span
350350
def get_pattern(self, ps):
351351
elements = []
352-
ps.skip_ws()
352+
ps.skip_inline_ws()
353353

354354
while ps.current():
355355
ch = ps.current()
356356

357-
if ch == '\n':
357+
# The end condition for get_pattern's while loop is a newline
358+
# which is not followed by a valid pattern continuation.
359+
if ch == '\n' and not ps.is_peek_next_line_pattern():
358360
break
359361

360362
if ch == '{':
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
key =
2+
Foo { bar }
3+
Baz

0 commit comments

Comments
 (0)