diff options
author | Jed Barber <jjbarber@y7mail.com> | 2014-05-10 22:46:15 +1000 |
---|---|---|
committer | Jed Barber <jjbarber@y7mail.com> | 2014-05-10 22:46:15 +1000 |
commit | fd90e7cc9e2a3a792e3256b0604ea8c03176a889 (patch) | |
tree | 4a0429416a09f805d1e1ff278096712bcd75d435 | |
parent | bc99eb4fbe7d89f19d6ef8be783119cc39cd14e8 (diff) |
Allowed parser to handle blank lines in amongst the rule listings
-rw-r--r-- | src/Thue/Parser.hs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Thue/Parser.hs b/src/Thue/Parser.hs index 288f770..9c52d6a 100644 --- a/src/Thue/Parser.hs +++ b/src/Thue/Parser.hs @@ -76,6 +76,7 @@ fromThueState = map tChar thue ver = do + many blankLine rs <- many (rule ver) separatorLine i <- initialState ver @@ -88,9 +89,13 @@ rule ver = do separator r <- state ver eol + many blankLine return (ThueRule o r) +blankLine = many (oneOf " \t") >> eol + + separatorLine = separator >> eol separator = string "::=" <?> "rule separator" |