Skip to content

Commit

Permalink
fix issue with multiline comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ricffb committed Jun 24, 2021
1 parent c8d2280 commit 5f9524e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions whilelang/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,15 @@
pad = regex(r'[^\S\r\n]')

Newline = regex(r"\n")
Next = (Newline.at_least(1)
| eof).desc("at least one newline or the end of file")
_Next = (Newline.at_least(1)
| eof).desc("at least one newline or the end of file")


@generate
def Next():
yield Comment | _Next >> Comment | _Next


Comment = string("#") >> (regex(r'[\S]') | pad).many().concat() >> Next

woc = whitespace << Comment.optional() << whitespace
Expand Down

0 comments on commit 5f9524e

Please sign in to comment.