Skip to content

Commit d8d21fd

Browse files
committed
upd: lazily push (date: Thu May 7 18:52:18 UTC 2026)
1 parent 7e3d4a1 commit d8d21fd

47 files changed

Lines changed: 2763 additions & 721 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
__pycache__/
1+
__pycache__/
2+
*.so

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,7 @@
88

99
<h3 align="left">
1010
<i>Simplify low level programming</i>.
11-
</h3>
11+
</h3>
12+
13+
> [!WARNING]
14+
> This project currently only supports the Linux operating system. Support for Windows and macOS is coming shortly after base compilation is finished.

src/frontend/ast/__init__.py

Lines changed: 36 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,41 @@
11
from .base import ASTNode, Expression, Statement
2-
from .statements import AssignmentStmt, FunctionDefStmt, IfStmt, ReturnStmt, ExpressionStmt, PassStmt
3-
from .expressions import IdentifierExpr, LiteralExpr, UnaryExpr, BinaryExpr, CallExpr, InterpolationExpr
2+
from .statements import (
3+
AssignmentStmt,
4+
FunctionDefStmt,
5+
IfStmt,
6+
ReturnStmt,
7+
ExpressionStmt,
8+
PassStmt,
9+
)
10+
from .expressions import (
11+
IdentifierExpr,
12+
LiteralExpr,
13+
UnaryExpr,
14+
BinaryExpr,
15+
CallExpr,
16+
InterpolationExpr,
17+
)
418
from .literals import NumberLiteral, StringLiteral, BoolLiteral, NoneLiteral, NilLiteral
519

620
__all__ = [
7-
"ASTNode",
8-
"Expression",
9-
"Statement",
10-
"AssignmentStmt",
11-
"FunctionDefStmt",
12-
"IfStmt",
13-
"ReturnStmt",
14-
"ExpressionStmt",
15-
"PassStmt",
16-
"IdentifierExpr",
17-
"LiteralExpr",
18-
"UnaryExpr",
19-
"BinaryExpr",
20-
"CallExpr",
21-
"InterpolationExpr",
22-
"NumberLiteral",
23-
"StringLiteral",
24-
"BoolLiteral",
25-
"NoneLiteral",
26-
"NilLiteral",
21+
"ASTNode",
22+
"Expression",
23+
"Statement",
24+
"AssignmentStmt",
25+
"FunctionDefStmt",
26+
"IfStmt",
27+
"ReturnStmt",
28+
"ExpressionStmt",
29+
"PassStmt",
30+
"IdentifierExpr",
31+
"LiteralExpr",
32+
"UnaryExpr",
33+
"BinaryExpr",
34+
"CallExpr",
35+
"InterpolationExpr",
36+
"NumberLiteral",
37+
"StringLiteral",
38+
"BoolLiteral",
39+
"NoneLiteral",
40+
"NilLiteral",
2741
]

src/frontend/ast/base.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
class ASTNode():
2-
def __init__(self, Line: int = None, Column: int = None):
3-
self.Line = Line
4-
self.Column = Column
1+
class ASTNode:
2+
def __init__(self, Line: int = None, Column: int = None):
3+
self.Line = Line
4+
self.Column = Column
55

6-
def __repr__(self) -> str:
7-
return f"{self.__class__.__name__}({self.__dict__})"
6+
def __repr__(self) -> str:
7+
return f"{self.__class__.__name__}({self.__dict__})"
88

99

1010
class Expression(ASTNode):
11-
def __init__(self, Line: int = None, Column: int = None):
12-
super().__init__(Line, Column)
11+
def __init__(self, Line: int = None, Column: int = None):
12+
super().__init__(Line, Column)
1313

1414

1515
class Statement(ASTNode):
16-
def __init__(self, Line: int = None, Column: int = None):
17-
super().__init__(Line, Column)
16+
def __init__(self, Line: int = None, Column: int = None):
17+
super().__init__(Line, Column)

src/frontend/ast/expressions.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,34 @@
22

33

44
class IdentifierExpr(Expression):
5-
def __init__(self):
6-
self.Name = None
5+
def __init__(self):
6+
self.Name = None
77

88

99
class LiteralExpr(Expression):
10-
def __init__(self):
11-
self.Value = None
10+
def __init__(self):
11+
self.Value = None
1212

1313

1414
class UnaryExpr(Expression):
15-
def __init__(self):
16-
self.Operator = None
17-
self.Operand = None
15+
def __init__(self):
16+
self.Operator = None
17+
self.Operand = None
1818

1919

2020
class BinaryExpr(Expression):
21-
def __init__(self):
22-
self.Left = None
23-
self.Operator = None
24-
self.Right = None
21+
def __init__(self):
22+
self.Left = None
23+
self.Operator = None
24+
self.Right = None
2525

2626

2727
class CallExpr(Expression):
28-
def __init__(self):
29-
self.Callee = None
30-
self.Arguments = []
28+
def __init__(self):
29+
self.Callee = None
30+
self.Arguments = []
3131

3232

3333
class InterpolationExpr(Expression):
34-
def __init__(self):
35-
self.Value = None
34+
def __init__(self):
35+
self.Value = None

src/frontend/ast/literals.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,25 @@
22

33

44
class NumberLiteral(Expression):
5-
def __init__(self, Value=None):
6-
self.Value = Value
5+
def __init__(self, Value=None):
6+
self.Value = Value
77

88

99
class StringLiteral(Expression):
10-
def __init__(self, Value=None):
11-
self.Value = Value
10+
def __init__(self, Value=None):
11+
self.Value = Value
1212

1313

1414
class BoolLiteral(Expression):
15-
def __init__(self, Value=None):
16-
self.Value = Value
15+
def __init__(self, Value=None):
16+
self.Value = Value
1717

1818

1919
class NoneLiteral(Expression):
20-
def __init__(self):
21-
self.Value = None
20+
def __init__(self):
21+
self.Value = None
2222

2323

2424
class NilLiteral(Expression):
25-
def __init__(self):
26-
self.Value = None
25+
def __init__(self):
26+
self.Value = None

src/frontend/ast/statements.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,38 @@
22

33

44
class AssignmentStmt(Statement):
5-
def __init__(self):
6-
self.Name = None
7-
self.Value = None
5+
def __init__(self):
6+
self.Name = None
7+
self.Value = None
88

99

1010
class FunctionDefStmt(Statement):
11-
def __init__(self):
12-
self.Name = None
13-
self.Parameters = []
14-
self.ReturnTypes = []
15-
self.Body = []
16-
self.ReturnExpr = None
17-
self.InferredReturnType = None
11+
def __init__(self):
12+
self.Name = None
13+
self.Parameters = []
14+
self.ReturnTypes = []
15+
self.Body = []
16+
self.ReturnExpr = None
17+
self.InferredReturnType = None
1818

1919

2020
class IfStmt(Statement):
21-
def __init__(self):
22-
self.Condition = None
23-
self.ThenBranch = []
24-
self.ElseBranch = None
21+
def __init__(self):
22+
self.Condition = None
23+
self.ThenBranch = []
24+
self.ElseBranch = None
2525

2626

2727
class ReturnStmt(Statement):
28-
def __init__(self):
29-
self.Expression = None
28+
def __init__(self):
29+
self.Expression = None
3030

3131

3232
class ExpressionStmt(Statement):
33-
def __init__(self):
34-
self.Expression = None
33+
def __init__(self):
34+
self.Expression = None
3535

3636

3737
class PassStmt(Statement):
38-
def __init__(self):
39-
pass
38+
def __init__(self):
39+
pass

src/frontend/parser/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
from .parser import Parser
66

77
__all__ = [
8-
"Parser",
9-
"ParseExpression",
10-
"ParseFunctionDef",
11-
"ParseIfStatement",
12-
"ParseReturnStmt",
8+
"Parser",
9+
"ParseExpression",
10+
"ParseFunctionDef",
11+
"ParseIfStatement",
12+
"ParseReturnStmt",
1313
]

0 commit comments

Comments
 (0)