Skip to content

Commit 5f9524e

Browse files
committed
fix issue with multiline comments
1 parent c8d2280 commit 5f9524e

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

whilelang/parse.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,15 @@
55
pad = regex(r'[^\S\r\n]')
66

77
Newline = regex(r"\n")
8-
Next = (Newline.at_least(1)
9-
| eof).desc("at least one newline or the end of file")
8+
_Next = (Newline.at_least(1)
9+
| eof).desc("at least one newline or the end of file")
10+
11+
12+
@generate
13+
def Next():
14+
yield Comment | _Next >> Comment | _Next
15+
16+
1017
Comment = string("#") >> (regex(r'[\S]') | pad).many().concat() >> Next
1118

1219
woc = whitespace << Comment.optional() << whitespace

0 commit comments

Comments
 (0)