Recursion in parser rules
Đang mở
- Ngôn ngữ chính
- Python
- Star
- 391
- Fork
- 62
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
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]:`
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Đánh giá
Issue này chưa được đánh giá.