Lean 4 fork for HoTT-compatible kernel extensions (Path types, transport, HITs). Maintained against upstream leanprover/lean4.
We use `nullKind` for the `group` parser combinator. When pattern matching `nullKind` nodes, we check their arities. So, error recovery often fails for parsers that use the `group` combinator. For example, we have the parser ``` def whereDecls := leading_parser "where " >> many1Indent (group (letRecDecl >> optional ";")) ``` If there is syntax error at `letRecDecl`, the node corresponding to ``` group (letRecDecl >> optional ";") ``` will contain only one child, and the pattern matching at ``` def expandWhereDecls (whereDecls : Syntax) (body : Syntax) : MacroM Syntax := match whereDecls with | `(whereDecls|where $[$decls:letRecDecl $[;]?]*) => `(let rec $decls:letRecDecl,*; $body) | _ => Macro.throwUnsupported ``` fails, and we can't elaborate the partial syntax tree for `letRecDecl`, and auto-completion will not work there. We address this issue by using a new kind for the `group` combinator. The idea is to pattern match `group` as we pattern match `node`s with proper syntax node kinds. This change is consistent with the way we use `group` where it mainly a convenience for saving us the trouble of defining a new parser definition that is used only once. |
||
|---|---|---|
| .github | ||
| doc | ||
| images | ||
| lean4-mode | ||
| nix | ||
| script | ||
| src | ||
| stage0 | ||
| tests | ||
| tmp | ||
| .gitattributes | ||
| .gitignore | ||
| CMakeLists.txt | ||
| CONTRIBUTING.md | ||
| default.nix | ||
| flake.lock | ||
| flake.nix | ||
| LICENSE | ||
| README.md | ||
| shell.nix | ||
This is the repository for Lean 4, which is currently being released as milestone releases towards a first stable release. Lean 3 is still the latest stable release.
About
Installation
See Setting Up Lean.
Contributing
Please read our Contribution Guidelines first.
Building from Source
See Building Lean.