Compare commits

..
3 Commits
Author SHA1 Message Date
HEL 1b078b832c chore: add some operations in the example 2026-05-28 18:32:35 +02:00
HEL 7515716864 feat(checker): add diagnostics 2026-05-28 18:32:35 +02:00
HEL 218b0c5b78 fix(parser): add location in all AST nodes 2026-05-28 18:32:34 +02:00
2 changed files with 10 additions and 2 deletions

No files matched your search

@@ -2,3 +2,10 @@ a: int = 3
b: int = 4
c = a + b # -> int
c = "invalid" # -> can't assign str to int variable
d = True
e = d + d
f: float = a
+3 -2
View File
@@ -335,13 +335,14 @@ class PythonParser:
def parse_compare(self, node: ast.Compare) -> Expr:
ops: list[ast.cmpop] = node.ops
left: Expr = self.parse_expr(node.left)
rights: list[Expr] = [self.parse_expr(expr) for expr in node.comparators]
expr: Expr = CompareExpr(
location=Location.span(
left.location,
rights[0].location,
rights[1].location,
),
left=self.parse_expr(node.left),
left=left,
operator=ops[0],
right=rights[0],
)