chore(library/init/lean/parser): minor
This commit is contained in:
parent
f37cd3cd11
commit
95dc2c5ade
2 changed files with 9 additions and 4 deletions
|
|
@ -15,8 +15,11 @@ constant builtinLevelParsingTable : IO.Ref ParsingTables := default _
|
|||
@[init] def regBuiltinLevelParserAttr : IO Unit :=
|
||||
registerBuiltinParserAttribute `builtinLevelParser `Lean.Parser.builtinLevelParsingTable
|
||||
|
||||
def levelParser {k : ParserKind} (rbp : Nat := 0) : Parser k :=
|
||||
{ fn := fun _ => runBuiltinParser "universe level" builtinLevelParsingTable rbp }
|
||||
def levelParserFn {k : ParserKind} (rbp : Nat) : ParserFn k :=
|
||||
fun _ => runBuiltinParser "universe level" builtinLevelParsingTable rbp
|
||||
|
||||
@[inline] def levelParser {k : ParserKind} (rbp : Nat := 0) : Parser k :=
|
||||
{ fn := levelParserFn rbp }
|
||||
|
||||
namespace Level
|
||||
|
||||
|
|
|
|||
|
|
@ -16,9 +16,11 @@ constant builtinTermParsingTable : IO.Ref ParsingTables := default _
|
|||
@[init] def regBuiltinTermParserAttr : IO Unit :=
|
||||
registerBuiltinParserAttribute `builtinTermParser `Lean.Parser.builtinTermParsingTable
|
||||
|
||||
def termParser {k : ParserKind} (rbp : Nat := 0) : Parser k :=
|
||||
{ fn := fun _ => runBuiltinParser "term" builtinTermParsingTable rbp }
|
||||
def termParserFn {k : ParserKind} (rbp : Nat) : ParserFn k :=
|
||||
fun _ => runBuiltinParser "term" builtinTermParsingTable rbp
|
||||
|
||||
@[inline] def termParser {k : ParserKind} (rbp : Nat := 0) : Parser k :=
|
||||
{ fn := termParserFn rbp }
|
||||
|
||||
namespace Term
|
||||
/- Helper functions for defining simple parsers -/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue