solpl 2.3.0__tar.gz → 2.3.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {solpl-2.3.0/solpl.egg-info → solpl-2.3.6}/PKG-INFO +1 -1
- {solpl-2.3.0 → solpl-2.3.6}/interpreter/sol.py +9 -4
- {solpl-2.3.0 → solpl-2.3.6}/pyproject.toml +1 -1
- {solpl-2.3.0 → solpl-2.3.6/solpl.egg-info}/PKG-INFO +1 -1
- {solpl-2.3.0 → solpl-2.3.6}/LICENSE +0 -0
- {solpl-2.3.0 → solpl-2.3.6}/README.md +0 -0
- {solpl-2.3.0 → solpl-2.3.6}/setup.cfg +0 -0
- {solpl-2.3.0 → solpl-2.3.6}/solpl.egg-info/SOURCES.txt +0 -0
- {solpl-2.3.0 → solpl-2.3.6}/solpl.egg-info/dependency_links.txt +0 -0
- {solpl-2.3.0 → solpl-2.3.6}/solpl.egg-info/entry_points.txt +0 -0
- {solpl-2.3.0 → solpl-2.3.6}/solpl.egg-info/top_level.txt +0 -0
|
@@ -32,7 +32,8 @@ class SolInterpreter:
|
|
|
32
32
|
|
|
33
33
|
with open(filename, "r") as f:
|
|
34
34
|
code = f.read()
|
|
35
|
-
|
|
35
|
+
base_name = os.path.basename(filename)
|
|
36
|
+
module_name = base_name.replace(".sol", "")
|
|
36
37
|
lines = [l.strip() for l in code.split('\n') if l.strip()]
|
|
37
38
|
for pc, line in enumerate(lines):
|
|
38
39
|
if "(" in line and ")" in line and "main" not in line and "end" not in line and "->" not in line and ">>" not in line and "?" not in line and not line.startswith(("if ", "while ", "for ", "elseif", "else")):
|
|
@@ -144,15 +145,19 @@ class SolInterpreter:
|
|
|
144
145
|
self.threads.append(t)
|
|
145
146
|
|
|
146
147
|
def _evaluate_condition(self, cond):
|
|
148
|
+
def get_val(expr):
|
|
149
|
+
val = self._compute(expr.strip())
|
|
150
|
+
return val if val is not None else 0
|
|
151
|
+
|
|
147
152
|
if "=" in cond:
|
|
148
153
|
left, right = cond.split("=")
|
|
149
|
-
return
|
|
154
|
+
return get_val(left) == get_val(right)
|
|
150
155
|
elif "<" in cond:
|
|
151
156
|
left, right = cond.split("<")
|
|
152
|
-
return
|
|
157
|
+
return get_val(left) < get_val(right)
|
|
153
158
|
elif ">" in cond:
|
|
154
159
|
left, right = cond.split(">")
|
|
155
|
-
return
|
|
160
|
+
return get_val(left) > get_val(right)
|
|
156
161
|
return False
|
|
157
162
|
|
|
158
163
|
def _get_block_end(self, start_pc):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|