Skip to content

Commit cb733eb

Browse files
committed
Adds Item protocol
1 parent 02f1cf7 commit cb733eb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/syntactes/_item.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
from typing import Optional
1+
from typing import Optional, Protocol
22

33
from syntactes.rule import Rule
44
from syntactes.token import Token
55

66

7+
class Item(Protocol):
8+
rule: Rule
9+
position: int
10+
11+
712
class LR0Item:
813
"""
914
Item of LR0 parser. Contains rule and current position in rule.

0 commit comments

Comments
 (0)