chore: move ParserKind to LeanExt

This commit is contained in:
Leonardo de Moura 2019-12-30 19:47:44 -08:00
parent 607749e263
commit 45075c135d
2 changed files with 6 additions and 6 deletions

View file

@ -192,15 +192,12 @@ match s with
end ParserState
inductive ParserKind
| leading | trailing
export ParserKind (leading trailing)
def ParserArg : ParserKind → Type
| ParserKind.leading => Nat
| ParserKind.trailing => Syntax
export ParserKind (leading trailing)
def BasicParserFn := ParserContext → ParserState → ParserState
def ParserFn (k : ParserKind) := ParserArg k → BasicParserFn

View file

@ -23,10 +23,13 @@ inductive Name
| str : Name → String → USize → Name
| num : Name → Nat → USize → Name
inductive ParserKind
| leading | trailing
/-
Small DSL for describing parsers. We implement an interpreter for it
at `Parser.lean` -/
inductive ParserDescr
inductive ParserDescr (kind : ParserKind := ParserKind.leading)
| andthen : ParserDescr → ParserDescr → ParserDescr
| orelse : ParserDescr → ParserDescr → ParserDescr
| optional : ParserDescr → ParserDescr