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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: solpl
3
- Version: 2.4.5
3
+ Version: 2.5.0
4
4
  Summary: A lightweight, multi-threaded interpreter for the Sol programming language
5
5
  Author-email: stefand-0 <stefand-0@users.noreply.github.com>
6
6
  License-Expression: Apache-2.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 is_literally and any(c.isalpha() or c in ['"', "'"] for c in expr):
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 solve expression: {val}")
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 "?" not in line and not line.startswith(("if ", "while ", "for ", "elseif", "else")):
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.4.5"
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
- sol = "interpreter.sol:main"
21
+ solpl = "interpreter.sol:main"
22
22
 
23
23
  [tool.setuptools.packages]
24
24
  find = { include = ["interpreter"] }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: solpl
3
- Version: 2.4.5
3
+ Version: 2.5.0
4
4
  Summary: A lightweight, multi-threaded interpreter for the Sol programming language
5
5
  Author-email: stefand-0 <stefand-0@users.noreply.github.com>
6
6
  License-Expression: Apache-2.0
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ solpl = interpreter.sol:main
@@ -1,2 +0,0 @@
1
- [console_scripts]
2
- sol = interpreter.sol:main
File without changes
File without changes
File without changes
File without changes