This PR upstreams the Verso parser and adds preliminary support for Verso in docstrings. This will allow the compiler to check examples and cross-references in documentation. After a `stage0` update, a follow-up PR will add the appropriate attributes that allow the feature to be used. The parser tests from Verso also remain to be upstreamed, and user-facing documentation will be added once the feature has been used on more internals.
15 lines
No EOL
586 B
Text
15 lines
No EOL
586 B
Text
* `structure` and `inductive` commands
|
|
* [#5842](https://github.com/leanprover/lean4/pull/5842) and [#5783](https://github.com/leanprover/lean4/pull/5783) implement a feature where the `structure` command can now define recursive inductive types:
|
|
```lean
|
|
structure Tree where
|
|
n : Nat
|
|
children : Fin n → Tree
|
|
|
|
def Tree.size : Tree → Nat
|
|
| {n, children} => Id.run do
|
|
let mut s := 0
|
|
for h : i in [0 : n] do
|
|
s := s + (children ⟨i, h.2⟩).size
|
|
pure s
|
|
```
|
|
* [#5814](https://github.com/leanprover/lean4/pull/5814) |