@Kha The structural recursion is working :)
It is so much more powerful than the one in Lean3.
I added examples with `let rec`, nested and multiple
`match`-expressions.
I will keep testing and adding missing features tomorrow, and
will hopefully start porting stdlib to new frontend before the end of
the week.
Now, the following example produces a syntax error.
```lean
macro "foo!" x:term : term => `($x + 1)
check id foo! 10
```
@Kha, I think the heuristic is simple and defensible.
If the new syntax starts and ends with token, than the precedence is
`maxPrec`. Otherwise, it is `leadPrec`.
see #180
@Kha Before this commit, we were producing the error "expected command" at the `let` token
```lean
check id let x := 1; x
```
The new error is "expected command, but found term; this error may be
due to parsing precedence levels, consider parenthesizing the term".
The example above looks artificial, but it will happen all the time as
users start to define their own notation.
@Kha I am working on issue
https://github.com/leanprover/lean4/issues/175
I am using solution 2 described there. The hooks will be at `AttrM`
instead of `CoreM`.
AFAICT code deleted by this commit is not necessary.
@Kha I suspect the memory leaks reported at the CI are due to
an exception produced by the compiler.
The compiler is currently a mix of Lean and C++ code.
I think the exception was thrown from C++ code, crossed Lean code (producing
memory leaks), and was caught by the old frontend written in C++.
We will eventually replace the compiler C++ code with Lean code.
So, I think this is a low priority issue.
The motivation is to prevent users from tinkering with its internal
implementation details that rely on unsafe features.
The new test crashed before this commit.