@@ -14,7 +14,7 @@ import Data.Tuple (Tuple(..))
1414import Effect (Effect )
1515import Effect.Console (logShow )
1616import Test.Assert (assert' )
17- import Text.Parsing.Parser (Parser , ParserT , ParseError (..), runParser , parseErrorPosition , label )
17+ import Text.Parsing.Parser (Parser , ParserT , ParseError (..), runParser , parseErrorPosition , region )
1818import Text.Parsing.Parser.Combinators (endBy1 , sepBy1 , optionMaybe , try , chainl , between )
1919import Text.Parsing.Parser.Expr (Assoc (..), Operator (..), buildExprParser )
2020import Text.Parsing.Parser.Language (javaStyle , haskellStyle , haskellDef )
@@ -501,11 +501,12 @@ main = do
501501 case runParser " aa" p of
502502 Right _ -> assert' " error: ParseError expected!" false
503503 Left (ParseError message pos) -> do
504- let messageExpected = " context1context2Expected \" b\" "
504+ let messageExpected = " context1 context2 Expected \" b\" "
505505 assert' (" expected message: " <> messageExpected <> " , message: " <> message) (message == messageExpected)
506506 logShow messageExpected
507507 where
508- p = label " context1" $ do
508+ prependContext m' (ParseError m pos) = ParseError (m' <> m) pos
509+ p = region (prependContext " context1 " ) $ do
509510 _ <- string " a"
510- label " context2" $ do
511+ region (prependContext " context2 " ) $ do
511512 string " b"
0 commit comments