From fd90e7cc9e2a3a792e3256b0604ea8c03176a889 Mon Sep 17 00:00:00 2001 From: Jed Barber Date: Sat, 10 May 2014 22:46:15 +1000 Subject: Allowed parser to handle blank lines in amongst the rule listings --- src/Thue/Parser.hs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') 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" -- cgit