fix: invoke new parser from old one with maximum precedence
This commit is contained in:
parent
1a7cd0e54d
commit
ebde775671
3 changed files with 3 additions and 1 deletions
|
|
@ -390,7 +390,7 @@ let c := Parser.mkParserContextCore env input "<foo>";
|
|||
let c := c.toParserContext env;
|
||||
let s := Parser.mkParserState c.input;
|
||||
let s := s.setPos pos;
|
||||
let s := (Parser.termParser : Parser.Parser).fn (0 : Nat) c s;
|
||||
let s := (Parser.termParser Parser.appPrec : Parser.Parser).fn Parser.appPrec c s;
|
||||
let stx := s.stxStack.back;
|
||||
match s.errorMsg with
|
||||
| some errorMsg =>
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ namespace Syntax
|
|||
#eval run $ let id := Syntax.missing; `($id + 1)
|
||||
end Syntax
|
||||
#eval run `(1 + 1)
|
||||
#eval run $ `(fun a => a) >>= pure
|
||||
#eval run $ do a ← `(Nat.one); `($a)
|
||||
#eval run $ do a ← `(Nat.one); `(f $a $a)
|
||||
#eval run $ do a ← `(Nat.one); `(f $ f $a 1)
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
"(Term.add <missing> \"+\" (Term.num (numLit \"1\")))"
|
||||
"(Term.add <missing> \"+\" (Term.num (numLit \"1\")))"
|
||||
"(Term.add (Term.num (numLit \"1\")) \"+\" (Term.num (numLit \"1\")))"
|
||||
"(Term.fun \"fun\" (null (Term.id `a.0 (null))) \"=>\" (Term.id `a.0 (null)))"
|
||||
"(Term.id `Nat.one.0 (null))"
|
||||
"(Term.app (Term.app (Term.id `f.0 (null)) (Term.id `Nat.one.0 (null))) (Term.id `Nat.one.0 (null)))"
|
||||
"(Term.dollar\n (Term.id `f.0 (null))\n \"$\"\n (Term.app (Term.app (Term.id `f.0 (null)) (Term.id `Nat.one.0 (null))) (Term.num (numLit \"1\"))))"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue