diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2018-07-14 14:52:28 -0700 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2018-07-14 14:53:03 -0700 |
| commit | c9ff0ff04b2d1922bcfe5b1106b9979c29b167a2 (patch) | |
| tree | 76616ba5dddc1d4b11c88fa16460ae673e2969a0 /nomsu.peg | |
| parent | d535dc57940f6c9558d3b588d53b44a87b2a8ed2 (diff) | |
Fixed up some edge cases with parsing and comments.
Diffstat (limited to 'nomsu.peg')
| -rw-r--r-- | nomsu.peg | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -4,7 +4,7 @@ file (File): comment? blank_lines? (chunk (nl_nodent chunk_delimeter nl_nodent chunk)*)? blank_lines? - (!! .+ -> "Parse error" !!)? + %ws* (!! .+ -> "Parse error" !!)? nodent: =curr_indent !(" ") indent: =curr_indent " " @@ -45,7 +45,7 @@ indented_expression: indented_text / indented_nomsu / indented_list / indented_dict / ({| ("(..)")? nl_indent (block / action / expression) (nl_nodent comment)* - (!! [^%nl]+ -> "Unexpected character while parsing indented expression" !!)? + (eol / (!! [^%nl]+ -> "Unexpected character while parsing indented expression" !!)) |} -> unpack) expression: inline_expression @@ -121,7 +121,7 @@ inline_list (List): (inline_list_item (%ws* ',' %ws* inline_list_item)* (%ws* ',')?)? %ws* ("]" / (","? ( (!! eol -> "Line ended before finding a closing ]-bracket" !!) - /(!! [^%nl]+ -> "Unexpected character while parsing List" !!)? + /(!! [^%nl]+ -> "Unexpected character while parsing List" !!) ))) indented_list (List): "[..]" eol nl_indent |
