summaryrefslogtreecommitdiff
path: root/Thue/Parser.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Thue/Parser.hs')
-rw-r--r--Thue/Parser.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/Thue/Parser.hs b/Thue/Parser.hs
index d7b0719..2ee41ae 100644
--- a/Thue/Parser.hs
+++ b/Thue/Parser.hs
@@ -49,7 +49,8 @@ rule = do
separatorLine = whiteSpace >> separator >> whiteSpace >> eol
-separator = string "::="
+separator = string "::="
+ <?> "rule separator"
initialState = do
@@ -62,12 +63,14 @@ ruleState = some ruleStateChar
ruleStateChar = noneOf "\n\r:"
<|> try (char ':' >> notFollowedBy (string ":=") >> return ':')
+ <?> "state character"
state = many stateChar
-stateChar = noneOf "\n\r"
+stateChar = noneOf "\n\r"
+ <?> "state character"
whiteSpace = many (oneOf "\t ")
@@ -77,4 +80,5 @@ eol = try (string "\r\n")
<|> try (string "\n\r")
<|> try (string "\r")
<|> try (string "\n")
+ <?> "end of line"