@@ -13,7 +13,7 @@ import Data.Tuple (Tuple(..))
13
13
import Effect (Effect )
14
14
import Effect.Console (logShow )
15
15
import 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 )
17
17
import Text.Parsing.Parser.Combinators (endBy1 , sepBy1 , optionMaybe , try , chainl , between )
18
18
import Text.Parsing.Parser.Expr (Assoc (..), Operator (..), buildExprParser )
19
19
import Text.Parsing.Parser.Language (javaStyle , haskellStyle , haskellDef )
@@ -500,11 +500,12 @@ main = do
500
500
case runParser " aa" p of
501
501
Right _ -> assert' " error: ParseError expected!" false
502
502
Left (ParseError message pos) -> do
503
- let messageExpected = " context1context2Expected \" b\" "
503
+ let messageExpected = " context1 context2 Expected \" b\" "
504
504
assert' (" expected message: " <> messageExpected <> " , message: " <> message) (message == messageExpected)
505
505
logShow messageExpected
506
506
where
507
- p = label " context1" $ do
507
+ prependContext m' (ParseError m pos) = ParseError (m' <> m) pos
508
+ p = region (prependContext " context1 " ) $ do
508
509
_ <- string " a"
509
- label " context2" $ do
510
+ region (prependContext " context2 " ) $ do
510
511
string " b"
0 commit comments