chore: move ParserKind to LeanExt
This commit is contained in:
parent
607749e263
commit
45075c135d
2 changed files with 6 additions and 6 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue