Files
midas/lexer/position.py
LordBaryhobal fedc582e16 feat(parser): add base lexer class
the lexer and token structures were adapted from another project (see docstring on the Lexer class)
2026-05-13 22:40:19 +02:00

14 lines
307 B
Python

from dataclasses import dataclass
from typing import Optional
@dataclass(frozen=True)
class Position:
"""A simple structure to store the position of a token"""
file: Optional[str]
line: int
column: int
def __repr__(self):
return f"{self.file or ''}L{self.line}:{self.column}"