@@ -327,7 +327,9 @@ spaces =
328forcedWS :: IParser String
328forcedWS :: IParser String
329forcedWS =
329forcedWS =
330− do ws <- many1 (spaces <|> newline)
331+ ws <- many1 (spaces <|> newline)
331 column <- sourceColumn <$> getPosition
333 column <- sourceColumn <$> getPosition
332 if column == 1
334 if column == 1
333 then fail badWhiteSpaceMessage
335 then fail badWhiteSpaceMessage
@@ -342,6 +344,19 @@ badWhiteSpaceMessage =
342 ++ "some spaces here:"
344 ++ "some spaces here:"
347+failIfTabFound :: IParser ()
349+ do foundTab <- option False (lookAhead (char '\t') >> return True)
351+ then fail tabsErrorMessage
355+tabsErrorMessage :: String
357+ "A tab character was found, but all whitespace (including indentation) must be spaces not tabs."
345-- Just eats whitespace until the next meaningful character.
360-- Just eats whitespace until the next meaningful character.
346dumbWhitespace :: IParser String
361dumbWhitespace :: IParser String
347dumbWhitespace =
362dumbWhitespace =