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