forked from luna/jorts
Luna
a7034db0eb
the AST is very ugly as it is rn. had to remove the cleanups or else its all [[None], [None], ...] ok im startnig to give up on doing handwritten lmao help - add TokenType.string - add read_value, read_statement, fix block reading
45 lines
478 B
Python
45 lines
478 B
Python
from dataclasses import dataclass
|
|
|
|
@dataclass
|
|
class TypedVar:
|
|
type_: str
|
|
name: str
|
|
|
|
|
|
@dataclass
|
|
class ReturnType:
|
|
type_: str
|
|
|
|
|
|
@dataclass
|
|
class Function:
|
|
name: str
|
|
arguments: str
|
|
ret_type: ReturnType
|
|
block: list
|
|
|
|
|
|
@dataclass
|
|
class Identifier:
|
|
name: str
|
|
|
|
|
|
@dataclass
|
|
class Import:
|
|
module: str
|
|
|
|
|
|
@dataclass
|
|
class String:
|
|
value: str
|
|
|
|
|
|
@dataclass
|
|
class Number:
|
|
value: str
|
|
|
|
|
|
@dataclass
|
|
class FunctionCall:
|
|
function: str
|
|
args: list
|