Lean 4 fork for HoTT-compatible kernel extensions (Path types, transport, HITs). Maintained against upstream leanprover/lean4.
Before this commit, if we execut `longestMatch [p1, p2]` in a trailing parser where both `p1` and `p2` succeed, then an incorrect syntax tree is generated by `p2`. The issue is that before executing `p2`, the trailing stack is of the form `#[..., left, syntax-by-p1]` Then, the trailing parser `p2` incorrectly assumes that `syntax-by-p1` was the "left" syntax node. This commit fix this issue by storing the `left` node at the `ParserContext` at `trailingLoop` @Kha This bug was introduced when we unified leading and trailing parsers. I think this is the simplest solution. We can observe the bug before this commit by using ``` set_option syntaxMaxDepth 1000 set_option trace.Elab true ``` at `choiceMacroRules.lean`. It is funny the correct result was produced even with the bug. It was working because the `macro_rules` was matching the buggy syntax with the nested `syntax-by-p1` there :) |
||
|---|---|---|
| .github | ||
| doc | ||
| images | ||
| lean4-mode | ||
| nix | ||
| script | ||
| src | ||
| stage0 | ||
| tests | ||
| tmp | ||
| .clang-format | ||
| .codecov.yml | ||
| .gitattributes | ||
| .gitignore | ||
| CMakeLists.txt | ||
| default.nix | ||
| LICENSE | ||
| README.md | ||
| shell.nix | ||
We are currently developing Lean 4. Lean 3 is still the latest official release. This repository contains work in progress.
Important. Unless you are one of our collaborators
- We strongly suggest you use Lean 3.
- Pull requests are not welcome.
- New issues are not welcome, and will be closed without any feedback.