@@ -1,5 +1,7 @@
1module Text.Lexer
1module Text.Lexer
3import public Control.Delayed
5import public Control.Delayed
5%default total
7%default total
@@ -61,6 +63,14 @@ export
61reject : Recognise c -> Recognise False
63reject : Recognise c -> Recognise False
62reject = Lookahead False
64reject = Lookahead False
66+||| Sequence a list of recognisers.
68+concat : {c : Bool} -> (xs : List (Recognise c)) -> Recognise (c && isCons xs)
69+concat {c} [] = rewrite andFalseFalse c in Empty
70+concat {c} (x :: xs) = rewrite andTrueNeutral c in
71+ rewrite sym (orSameAndRightNeutral c (isCons xs)) in
72+ SeqEmpty x (concat xs)
64data StrLen : Type where
74data StrLen : Type where
65 MkStrLen : String -> Nat -> StrLen
75 MkStrLen : String -> Nat -> StrLen