summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJed Barber <jjbarber@y7mail.com>2014-05-10 22:46:15 +1000
committerJed Barber <jjbarber@y7mail.com>2014-05-10 22:46:15 +1000
commitfd90e7cc9e2a3a792e3256b0604ea8c03176a889 (patch)
tree4a0429416a09f805d1e1ff278096712bcd75d435 /src
parentbc99eb4fbe7d89f19d6ef8be783119cc39cd14e8 (diff)
Allowed parser to handle blank lines in amongst the rule listings
Diffstat (limited to 'src')
-rw-r--r--src/Thue/Parser.hs5
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"