Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ readme = "README.md"
requires-python = ">=3.14"
dependencies = [
"libcst>=1.8.6",
"libcst-dfa>=0.0.1",
"libcst-mypy>=0.1.0",
"mypy>=1.19.1",
]
Expand Down
730 changes: 0 additions & 730 deletions src/styx_compiler/control_flow.py

This file was deleted.

2 changes: 1 addition & 1 deletion src/styx_compiler/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
import libcst.matchers as m
import mypy.api
from libcst import CSTNode, FlattenSentinel, FunctionDef, Module, RemovalSentinel
from libcst_dfa.live_variables import LiveVariablesProvider
from libcst_mypy import MypyTypeInferenceProvider
from libcst_mypy.utils import MypyType

from styx_compiler.comprehension_expander import ComprehensionExpander
from styx_compiler.config import N_PARTITIONS
from styx_compiler.live_variables import LiveVariablesProvider
from styx_compiler.processor import FunctionProcessor
from styx_compiler.transformers import (
EntityTypeReplacer,
Expand Down
194 changes: 0 additions & 194 deletions src/styx_compiler/data_flow.py

This file was deleted.

140 changes: 0 additions & 140 deletions src/styx_compiler/live_variables.py

This file was deleted.

7 changes: 4 additions & 3 deletions src/styx_compiler/liveness.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import libcst as cst
from libcst import matchers as m
from libcst_dfa.data_flow import ImmutableSet


class LivenessHelper:
Expand All @@ -22,16 +23,16 @@ def simple_name(v) -> str:
return str(v.name).split(".")[-1]
return str(v).split(".")[-1] if "." in str(v) else str(v)

def _live_set(self, node: cst.CSTNode | None, kind: str) -> frozenset | None:
def _live_set(self, node: cst.CSTNode | None, kind: str) -> ImmutableSet | None:
if not self.live_vars or node is None:
return None
data = self.live_vars.get(node)
if data is None:
return None
val = data[0] if kind == "in" else data[1]
return val if isinstance(val, frozenset) else None
return val if isinstance(val, ImmutableSet) else None

def live_out(self, stmt: cst.CSTNode) -> frozenset | None:
def live_out(self, stmt: cst.CSTNode) -> ImmutableSet | None:
"""Live-out set for a statement, or None if no liveness data."""
if isinstance(stmt, cst.SimpleStatementLine) and stmt.body:
element = stmt.body[0]
Expand Down
Loading
Loading