From fb8e8437172f7702949e00f702ce6c2383ea9cb1 Mon Sep 17 00:00:00 2001 From: Vidar Holen Date: Mon, 5 Nov 2012 01:46:01 -0800 Subject: [PATCH] Fixed position of &; message --- Shpell/Parser.hs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Shpell/Parser.hs b/Shpell/Parser.hs index 8d3354d..b515d88 100644 --- a/Shpell/Parser.hs +++ b/Shpell/Parser.hs @@ -603,8 +603,14 @@ prop_roflol = isWarning readScript "a &; b" prop_roflol2 = isOk readScript "a & b" readSeparatorOp = do notFollowedBy (g_AND_IF <|> g_DSEMI) - f <- (try $ char '&' >> spacing >> char ';' >> parseProblem ErrorC "It's not 'foo &; bar', just 'foo & bar'. " >> return '&') - <|> char ';' <|> char '&' + f <- (try $ do + char '&' + spacing + pos <- getPosition + char ';' + parseProblemAt pos ErrorC "It's not 'foo &; bar', just 'foo & bar'. " + return '&' + ) <|> char ';' <|> char '&' spacing return f