Recursion in parser rules
Abierto
- Lenguaje dominante
- Python
- Estrellas
- 391
- Forks
- 62
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
I'm unsure of how recursion works in parser rules, I assumed it would be similar to `ply`, but this does not work:
```py
@self.production("struct : STRUCT IDENT (IDENT COLON IDENT (COMMA IDENT COLON IDENT)*)?")
def struct(tokens: list[Token]):
...
```
This would match the following text:
```
struct Foo {}
struct Bar {
one: String,
two: i32
}
```
This produces: `KeyError: '(IDENT'` pointing to `rply\grammar.py` line 148: `for p in self.prod_names[n]:`
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Evaluación
Este issue todavía no se ha evaluado.