solpl 2.4.5__tar.gz → 2.5.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.4.5/solpl.egg-info → solpl-2.5.0}/PKG-INFO +1 -1
- {solpl-2.4.5 → solpl-2.5.0}/interpreter/sol.py +4 -6
- {solpl-2.4.5 → solpl-2.5.0}/pyproject.toml +2 -2
- {solpl-2.4.5 → solpl-2.5.0/solpl.egg-info}/PKG-INFO +1 -1
- solpl-2.5.0/solpl.egg-info/entry_points.txt +2 -0
- solpl-2.4.5/solpl.egg-info/entry_points.txt +0 -2
- {solpl-2.4.5 → solpl-2.5.0}/LICENSE +0 -0
- {solpl-2.4.5 → solpl-2.5.0}/README.md +0 -0
- {solpl-2.4.5 → solpl-2.5.0}/setup.cfg +0 -0
- {solpl-2.4.5 → solpl-2.5.0}/solpl.egg-info/SOURCES.txt +0 -0
- {solpl-2.4.5 → solpl-2.5.0}/solpl.egg-info/dependency_links.txt +0 -0
- {solpl-2.4.5 → solpl-2.5.0}/solpl.egg-info/top_level.txt +0 -0
|
@@ -45,7 +45,7 @@ class SolInterpreter:
|
|
|
45
45
|
def _compute(self, expr):
|
|
46
46
|
is_literal = (expr.startswith('"') and expr.endswith('"')) or (expr.startswith("'") and expr.endswith("'"))
|
|
47
47
|
expr = str(expr).strip()
|
|
48
|
-
if "+" in expr and not
|
|
48
|
+
if "+" in expr and not is_literal and any(c.isalpha() or c in ['"', "'"] for c in expr):
|
|
49
49
|
parts = expr.split("+")
|
|
50
50
|
result = ""
|
|
51
51
|
for p in parts:
|
|
@@ -105,8 +105,8 @@ class SolInterpreter:
|
|
|
105
105
|
existing_val = self._lookup(val)
|
|
106
106
|
if existing_val is not None: return existing_val
|
|
107
107
|
try: return float(val) if '.' in val else int(val)
|
|
108
|
-
except:
|
|
109
|
-
print(f"Error: Failed to
|
|
108
|
+
except:
|
|
109
|
+
print(f"Error: Failed to parse: {val}")
|
|
110
110
|
return None
|
|
111
111
|
|
|
112
112
|
def _async_worker(self, expr, action):
|
|
@@ -180,7 +180,7 @@ class SolInterpreter:
|
|
|
180
180
|
pc = 0
|
|
181
181
|
while pc < len(self.lines):
|
|
182
182
|
line = self.lines[pc]
|
|
183
|
-
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 "?"
|
|
183
|
+
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 "?" in line and not line.startswith(("if ", "while ", "for ", "elseif", "else")):
|
|
184
184
|
parts = line.split("(")
|
|
185
185
|
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 []}
|
|
186
186
|
elif "{" in line: pc = self._parse_struct(pc)
|
|
@@ -346,5 +346,3 @@ def main():
|
|
|
346
346
|
|
|
347
347
|
if __name__ == "__main__":
|
|
348
348
|
main()
|
|
349
|
-
|
|
350
|
-
# do you really think I would go back and comment the code? i wrote the first version in a month.
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "solpl"
|
|
7
|
-
version = "2.
|
|
7
|
+
version = "2.5.0"
|
|
8
8
|
authors = [
|
|
9
9
|
{ name = "stefand-0", email = "stefand-0@users.noreply.github.com" }
|
|
10
10
|
]
|
|
@@ -18,7 +18,7 @@ classifiers = [
|
|
|
18
18
|
]
|
|
19
19
|
|
|
20
20
|
[project.scripts]
|
|
21
|
-
|
|
21
|
+
solpl = "interpreter.sol:main"
|
|
22
22
|
|
|
23
23
|
[tool.setuptools.packages]
|
|
24
24
|
find = { include = ["interpreter"] }
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|