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