Signed-off-by: erick-alcachofa <erick@artichoke.dev>
Refactor the termination logic for generic parameter lists in type
parsing to correctly handle nested generics. By replacing manual peeking
with `peekExpect(TokenV::opGt)`, the parser now correctly handles cases
where two closing angle brackets appear consecutively (e.g.,
`List<List<Int>>`).
Previously, the parser manually checked for a literal `>` token. If the
lexer encountered `>>` (a right-shift operator), the parser would fail
to recognize it as two closing brackets. The transition to `peekExpect`
allows the tokenizer to "split" the `>>` token into two individual `>`
tokens when a single closing bracket is expected, resolving the classic
nested template ambiguity.
Key changes:
- Replaced manual token validation and error reporting with
`peekExpect`.
- Enabled support for nested generic types without requiring spaces
between closing brackets.
- Simplified the `keepParsing` loop state in `lib/src/Parser/Types.cpp`.