For lists of size 0, 1 and 2, it avoids the overhead of creating temporary lists of closures. I measure the overhead with `test1.lean` and there is no overhead in this case. `test1.lean` has a test for length = 4, and the overhead is 7%. We only use longestMatch to implement the Pratt Parser. The lists should be small. So, the overhead is acceptable. If it is not. We can add back the `longestMatch` specific for `TermParser`. cc @kha |
||
|---|---|---|
| .. | ||
| compiler | ||
| ir | ||
| lean | ||
| playground | ||