@@ -36,7 +36,7 @@ import Effect.Console (log, logShow)
36
36
import Effect.Unsafe (unsafePerformEffect )
37
37
import Node.Process (lookupEnv )
38
38
import Parsing (ParseError (..), ParseState (..), Parser , ParserT , Position (..), consume , fail , getParserT , initialPos , parseErrorPosition , position , region , runParser )
39
- import Parsing.Combinators (advance , between , chainl , chainl1 , chainr , chainr1 , choice , empty , endBy , endBy1 , lookAhead , many , many1 , many1Till , many1Till_ , manyIndex , manyTill , manyTill_ , notFollowedBy , optionMaybe , replicateA , sepBy , sepBy1 , sepEndBy , sepEndBy1 , skipMany , skipMany1 , try , tryRethrow , (<?>), (<??>), (<~?>))
39
+ import Parsing.Combinators (advance , between , chainl , chainl1 , chainr , chainr1 , choice , empty , endBy , endBy1 , lookAhead , many , many1 , many1Till , many1Till_ , manyIndex , manyTill , manyTill_ , notFollowedBy , optional , optionMaybe , replicateA , sepBy , sepBy1 , sepEndBy , sepEndBy1 , skipMany , skipMany1 , try , tryRethrow , (<?>), (<??>), (<~?>))
40
40
import Parsing.Combinators.Array as Combinators.Array
41
41
import Parsing.Expr (Assoc (..), Operator (..), buildExprParser )
42
42
import Parsing.Language (haskellDef , haskellStyle , javaStyle )
@@ -572,6 +572,13 @@ javaStyleTest = do
572
572
" hello {- comment\n -} foo"
573
573
(mkPos 7 )
574
574
575
+ takeWhilePropagatFail :: TestM
576
+ takeWhilePropagatFail = do
577
+ parseErrorTestPosition
578
+ (optional $ (char ' f' <* takeWhile CodePoint.Unicode .isSpace <* fail " test failure" ))
579
+ " f"
580
+ (Position { index: 1 , line: 1 , column: 2 })
581
+
575
582
main :: Effect Unit
576
583
main = do
577
584
@@ -734,6 +741,8 @@ main = do
734
741
, expected: Left $ ParseError " Expected letter" (Position { index: 0 , line: 1 , column: 1 })
735
742
}
736
743
744
+ takeWhilePropagatFail
745
+
737
746
log " \n TESTS number\n "
738
747
739
748
-- assert' "Number.fromString" $ Just infinity == Data.Number.fromString "Infinity"
0 commit comments