effekt-lang / effekt-lang/effekt
Rewrite the function type parser to avoid backtracking
Open
area:parser/lexer
feature
- Dominant language
- Scala
- Stars
- 469
- Forks
- 41
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 23
Description
The function type parser `functionType` (as of merging #947) uses two backtracks that are not necessary, the grammar is LL(2) [?] and can be therefore parsed without backtracking.
The biggest annoyances are that:
1. the function can also produce an atomic type (`atomicType`)
2. the vparams of a function can be:
a. missing completely (like in `=> String`)
b. `()` (see `isUnitLiteral`)
c. a single atomic type `Int` [<- this is the one we want to return in 1.]
d. k-tuple of types `(Int)`, `(Int, Bool)`, ...
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.