Compare commits

..
2 Commits
Author SHA1 Message Date
HEL 4dd76e30cc feat(checker): add diagnostics 2026-05-28 18:19:02 +02:00
HEL 9f31ab623e fix(parser): add location in all AST nodes 2026-05-28 18:18:16 +02:00
2 changed files with 2 additions and 10 deletions

No files matched your search

@@ -2,10 +2,3 @@ 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
+2 -3
View File
@@ -335,14 +335,13 @@ 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=left,
left=self.parse_expr(node.left),
operator=ops[0],
right=rights[0],
)