File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change 89
89
90
90
manyTill :: forall s a m e. (Monad m) => ParserT s m a -> ParserT s m e -> ParserT s m [a]
91
91
92
+ notFollowedBy :: forall s a m. (Monad m) => ParserT s m a -> ParserT s m Unit
93
+
92
94
option :: forall m s a. (Monad m) => a -> ParserT s m a -> ParserT s m a
93
95
94
96
optionMaybe :: forall m s a. (Functor m, Monad m) => ParserT s m a -> ParserT s m (Maybe a)
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import Data.Either
7
7
8
8
import Control.Alt
9
9
import Control.Alternative
10
+ import Control.Apply
10
11
import Control.Lazy
11
12
import Control.Monad
12
13
import Control.Monad.Error.Trans
@@ -120,6 +121,9 @@ lookAhead (ParserT p) = ParserT \s -> do
120
121
state <- p s
121
122
return state{input = s, consumed = false }
122
123
124
+ notFollowedBy :: forall s a m . (Monad m ) => ParserT s m a -> ParserT s m Unit
125
+ notFollowedBy p = try $ (try p *> fail " Negated parser succeeded" ) <|> return unit
126
+
123
127
manyTill :: forall s a m e . (Monad m ) => ParserT s m a -> ParserT s m e -> ParserT s m [a ]
124
128
manyTill p end = scan
125
129
where
You can’t perform that action at this time.
0 commit comments