solpl 2.5.8__tar.gz → 2.6.0__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.5.8/solpl.egg-info → solpl-2.6.0}/PKG-INFO +1 -1
- {solpl-2.5.8 → solpl-2.6.0}/interpreter/sol.py +9 -14
- {solpl-2.5.8 → solpl-2.6.0}/pyproject.toml +1 -1
- {solpl-2.5.8 → solpl-2.6.0/solpl.egg-info}/PKG-INFO +1 -1
- {solpl-2.5.8 → solpl-2.6.0}/LICENSE +0 -0
- {solpl-2.5.8 → solpl-2.6.0}/README.md +0 -0
- {solpl-2.5.8 → solpl-2.6.0}/setup.cfg +0 -0
- {solpl-2.5.8 → solpl-2.6.0}/solpl.egg-info/SOURCES.txt +0 -0
- {solpl-2.5.8 → solpl-2.6.0}/solpl.egg-info/dependency_links.txt +0 -0
- {solpl-2.5.8 → solpl-2.6.0}/solpl.egg-info/entry_points.txt +0 -0
- {solpl-2.5.8 → solpl-2.6.0}/solpl.egg-info/top_level.txt +0 -0
|
@@ -33,8 +33,7 @@ class SolInterpreter:
|
|
|
33
33
|
with open(filename, "r") as f:
|
|
34
34
|
code = f.read()
|
|
35
35
|
module_name = os.path.splitext(os.path.basename(filename))[0]
|
|
36
|
-
|
|
37
|
-
# FIX: Properly strip comments from imported library files
|
|
36
|
+
|
|
38
37
|
lines = []
|
|
39
38
|
for l in code.split('\n'):
|
|
40
39
|
l = l.strip()
|
|
@@ -55,7 +54,6 @@ class SolInterpreter:
|
|
|
55
54
|
def _compute(self, expr):
|
|
56
55
|
expr = str(expr).strip()
|
|
57
56
|
|
|
58
|
-
# FIX: Critical helper to split expressions ONLY outside of literal quotes
|
|
59
57
|
def split_outside_quotes(string, op):
|
|
60
58
|
parts = []
|
|
61
59
|
current = []
|
|
@@ -78,7 +76,6 @@ class SolInterpreter:
|
|
|
78
76
|
parts.append("".join(current))
|
|
79
77
|
return parts
|
|
80
78
|
|
|
81
|
-
# FIX: Use quote-aware splitting for string concatenation
|
|
82
79
|
plus_parts = split_outside_quotes(expr, '+')
|
|
83
80
|
if len(plus_parts) > 1:
|
|
84
81
|
if any(any(c.isalpha() or c in ['"', "'"] for c in p) for p in plus_parts):
|
|
@@ -88,7 +85,6 @@ class SolInterpreter:
|
|
|
88
85
|
result += str(val) if val is not None else ""
|
|
89
86
|
return result
|
|
90
87
|
|
|
91
|
-
# FIX: Use quote-aware splitting for mathematical operations (ignores colons in URLs)
|
|
92
88
|
ops = ['+', '-', '*', ':']
|
|
93
89
|
for op in ops:
|
|
94
90
|
op_parts = split_outside_quotes(expr, op)
|
|
@@ -141,15 +137,15 @@ class SolInterpreter:
|
|
|
141
137
|
obj_name, prop = val.split(".", 1)
|
|
142
138
|
obj = self._lookup(obj_name)
|
|
143
139
|
if isinstance(obj, dict): return obj.get(prop, 0)
|
|
144
|
-
|
|
145
|
-
# FIX: Avoid failing on variables explicitly assigned to a None value
|
|
140
|
+
|
|
146
141
|
for scope in reversed(self.scope_stack):
|
|
147
142
|
if val in scope: return scope[val]
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
143
|
+
|
|
144
|
+
# FIX: Only try to parse as number if it looks like one
|
|
145
|
+
if val.replace('.', '', 1).isdigit() or (val.startswith('-') and val[1:].replace('.', '', 1).isdigit()):
|
|
146
|
+
return float(val) if '.' in val else int(val)
|
|
147
|
+
|
|
148
|
+
return None
|
|
153
149
|
|
|
154
150
|
def _async_worker(self, expr, action):
|
|
155
151
|
result = self._compute(expr)
|
|
@@ -224,8 +220,7 @@ class SolInterpreter:
|
|
|
224
220
|
line = self.lines[pc]
|
|
225
221
|
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")):
|
|
226
222
|
parts = line.split("(")
|
|
227
|
-
self.functions[parts[0].strip()] = {"start_pc": pc + 1, "params": [p.strip() for p in parts[1].replace(")", "").split(",")] if parts[1].replace(")", "").strip()
|
|
228
|
-
continue
|
|
223
|
+
self.functions[parts[0].strip()] = {"start_pc": pc + 1, "params": [p.strip() for p in parts[1].replace(")", "").split(",")] if parts[1].replace(")", "").strip() else []}
|
|
229
224
|
elif "{" in line: pc = self._parse_struct(pc)
|
|
230
225
|
pc += 1
|
|
231
226
|
for i, line in enumerate(self.lines):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|