shell-lite 0.4.0__py3-none-any.whl → 0.4.2__py3-none-any.whl

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.
shell_lite/interpreter.py CHANGED
@@ -825,7 +825,7 @@ class Interpreter:
825
825
  result = subprocess.run(cmd, shell=True, capture_output=True, text=True)
826
826
  if result.returncode != 0:
827
827
  print(f"Command Error: {result.stderr}")
828
- return result.stdout.strip()
828
+ return result.stdout.strip() or result.stderr.strip()
829
829
  except Exception as e:
830
830
  raise RuntimeError(f"Failed to run command: {e}")
831
831
  def builtin_read(self, path):
@@ -1069,6 +1069,7 @@ class Interpreter:
1069
1069
  result = None
1070
1070
  for stmt in statements:
1071
1071
  result = self.visit(stmt)
1072
+ self.current_env.set('__exec_result__', result)
1072
1073
  return result
1073
1074
  def visit_ImportAs(self, node: ImportAs):
1074
1075
  if node.path in self.std_modules:
@@ -1495,7 +1496,7 @@ class Interpreter:
1495
1496
  if interpreter_ref.web.stack:
1496
1497
  pass
1497
1498
  if isinstance(result, Tag): response_body = str(result)
1498
- elif result: response_body = str(result)
1499
+ elif result is not None: response_body = str(result)
1499
1500
  else: response_body = "OK"
1500
1501
  self.send_response(200)
1501
1502
  self.send_header('Content-Type', 'text/html')
@@ -1518,7 +1519,7 @@ class Interpreter:
1518
1519
  self.wfile.write(str(e).encode())
1519
1520
  except: pass
1520
1521
  server = HTTPServer(('0.0.0.0', port_val), ShellLiteHandler)
1521
- print(f"\n ShellLite Server v0.03.4 is running!")
1522
+ print(f"\n ShellLite Server v0.04.1 is running!")
1522
1523
  print(f" \u001b[1;36m➜\u001b[0m Local: \u001b[1;4;36mhttp://localhost:{port_val}/\u001b[0m\n")
1523
1524
  try: server.serve_forever()
1524
1525
  except KeyboardInterrupt:
shell_lite/lexer.py CHANGED
@@ -195,7 +195,7 @@ class Lexer:
195
195
  'copy': 'COPY', 'paste': 'PASTE', 'clipboard': 'CLIPBOARD',
196
196
  'press': 'PRESS', 'type': 'TYPE', 'click': 'CLICK', 'at': 'AT',
197
197
  'notify': 'NOTIFY',
198
- 'date': 'DATE', 'today': 'TODAY', 'after': 'AFTER', 'before': 'BEFORE',
198
+ 'date': 'ID', 'today': 'ID', 'after': 'AFTER', 'before': 'BEFORE',
199
199
  'list': 'LIST', 'set': 'SET', 'unique': 'UNIQUE', 'of': 'OF',
200
200
  'wait': 'WAIT',
201
201
  'convert': 'CONVERT', 'json': 'JSON',
@@ -223,9 +223,9 @@ class Lexer:
223
223
  'count': 'COUNT', 'many': 'MANY', 'how': 'HOW',
224
224
  'field': 'FIELD', 'submit': 'SUBMIT', 'named': 'NAMED',
225
225
  'placeholder': 'PLACEHOLDER',
226
- 'app': 'APP', 'title': 'TITLE', 'size': 'SIZE',
227
- 'column': 'COLUMN', 'row': 'ROW',
228
- 'button': 'BUTTON', 'heading': 'HEADING', 'text': 'TEXT',
226
+ 'app': 'APP', 'title': 'ID', 'size': 'ID',
227
+ 'column': 'ID', 'row': 'ID',
228
+ 'button': 'ID', 'heading': 'HEADING', 'text': 'ID',
229
229
  }
230
230
  token_type = keywords.get(value, 'ID')
231
231
  self.tokens.append(Token(token_type, value, self.line_number, current_col))
shell_lite/main.py CHANGED
@@ -61,7 +61,7 @@ def run_repl():
61
61
  print("\n" + "="*40)
62
62
  print(" ShellLite REPL - English Syntax")
63
63
  print("="*40)
64
- print("Version: v0.04.0 | Made by Shrey Naithani")
64
+ print("Version: v0.04.2 | Made by Shrey Naithani")
65
65
  print("Commands: Type 'exit' to quit, 'help' for examples.")
66
66
  print("Note: Terminal commands (like 'shl install') must be run in CMD/PowerShell, not here.")
67
67
 
@@ -192,7 +192,7 @@ def install_globally():
192
192
  ps_cmd = f'$oldPath = [Environment]::GetEnvironmentVariable("Path", "User"); if ($oldPath -notlike "*ShellLite*") {{ [Environment]::SetEnvironmentVariable("Path", "$oldPath;{install_dir}", "User") }}'
193
193
  subprocess.run(["powershell", "-Command", ps_cmd], capture_output=True)
194
194
 
195
- print(f"\n[SUCCESS] ShellLite (v0.03.6) is installed!")
195
+ print(f"\n[SUCCESS] ShellLite (v0.04.1) is installed!")
196
196
  print(f"Location: {install_dir}")
197
197
  print("\nIMPORTANT STEP REQUIRED:")
198
198
  print("1. Close ALL open terminal windows (CMD, PowerShell, VS Code).")
@@ -477,8 +477,7 @@ def format_file(filename: str):
477
477
  except Exception as e:
478
478
  print(f"Formatting failed: {e}")
479
479
  def self_install_check():
480
- res = subprocess.run(["where", "shl"], capture_output=True, text=True)
481
- if "ShellLite" not in res.stdout:
480
+ if not shutil.which("shl"):
482
481
  print("\nShellLite is not installed globally.")
483
482
  choice = input("Would you like to install it so 'shl' works everywhere? (y/n): ").lower()
484
483
  if choice == 'y':
@@ -551,6 +550,11 @@ def main():
551
550
  line = int(sys.argv[3])
552
551
  col = int(sys.argv[4])
553
552
  resolve_cursor(filename, line, col)
553
+ elif cmd == "run":
554
+ if len(sys.argv) > 2:
555
+ run_file(sys.argv[2])
556
+ else:
557
+ print("Usage: shl run <filename>")
554
558
  else:
555
559
  run_file(sys.argv[1])
556
560
  else:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: shell-lite
3
- Version: 0.4.0
3
+ Version: 0.4.2
4
4
  Summary: A lightweight, English-like scripting language.
5
5
  Author-email: Shrey Naithani <contact@shelllite.tech>
6
6
  License: MIT
@@ -11,6 +11,8 @@ Description-Content-Type: text/markdown
11
11
  License-File: LICENSE
12
12
  Requires-Dist: prompt-toolkit>=3.0.0
13
13
 
14
+ <img src="assets/logo.png" align="right" width="250" alt="ShellLite Logo" />
15
+
14
16
  # ShellLite: The English-Like Programming Language
15
17
  # By Shrey Naithani
16
18
  ShellLite is a modern, interpreted programming language designed to prioritize human readability. It replaces complex syntax with natural English commands, making software development accessible and maintainable.
@@ -3,15 +3,15 @@ shell_lite/ast_nodes.py,sha256=KGFlZmP21MJXo6uRYRJfo_R3BEspfDD8xMBtAVfUDgU,5873
3
3
  shell_lite/cli.py,sha256=14Kq1ohSXS3p-xdh0DPi7eXskUtSX81huSyGhktoOMA,250
4
4
  shell_lite/compiler.py,sha256=FcwDLbrjnMnH0VMzEeYPSqD3nIeFAwKIdvEDAT1e3GE,24984
5
5
  shell_lite/formatter.py,sha256=590BfQmhsX466i5_xONXAhgVE97zfcV79q1wA3DT47A,2952
6
- shell_lite/interpreter.py,sha256=XcVMRqhxWdVKXoD1I8GKJDa-E474PKxJCeZ62I3BRUM,74520
6
+ shell_lite/interpreter.py,sha256=az_8oe82bqQFYm8ytbNG5FgFCT8UG9IG49pHM54ewBM,74614
7
7
  shell_lite/js_compiler.py,sha256=b2-XyGqm2BYUfwU0OsphpMxLNeho1ihL7htAcg3uWII,9438
8
- shell_lite/lexer.py,sha256=Z26uJX1I_stImRsovqkgnDeOKkSloNlKOpXj5qdLEnc,12570
9
- shell_lite/main.py,sha256=nzBCAHNQTq3D2-cUeGXkgnC7oESXStT7j2orCuTFNyg,22344
8
+ shell_lite/lexer.py,sha256=UDQtFX7UW3HgMftQ3HsCu9tfImk9vsyMX5icsAI6NuE,12549
9
+ shell_lite/main.py,sha256=Fy6L2P7FEmfNIkUqNW5IcmLHcd2Ef8bqnh0PocUsPJk,22435
10
10
  shell_lite/parser.py,sha256=Eh-LjIX1AdYyuhPaL-_GPlDoSzDM0RxDNQsBWog-06k,73377
11
11
  shell_lite/runtime.py,sha256=pSjBeA1dTQ-a94q3FLdv9lqZurdd6MJmfhFGHhOoQEM,16057
12
- shell_lite-0.4.0.dist-info/LICENSE,sha256=33eziKLPxbqGCqdHtEHAFe1KSOgqc0-jWUQmdgKq85Q,1092
13
- shell_lite-0.4.0.dist-info/METADATA,sha256=AZGYOeRcbk7MGrm5IAYtFNqwUaABgoeTqMQWHFyiCTE,2395
14
- shell_lite-0.4.0.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
15
- shell_lite-0.4.0.dist-info/entry_points.txt,sha256=tglL8tjyPIh1W85j6zFpNZjMpQe_xC-k-7BOhHLWfxc,45
16
- shell_lite-0.4.0.dist-info/top_level.txt,sha256=hIln5ltrok_Mn3ijlQeqMFF6hHBHCyhzqCO7KL358cg,11
17
- shell_lite-0.4.0.dist-info/RECORD,,
12
+ shell_lite-0.4.2.dist-info/LICENSE,sha256=33eziKLPxbqGCqdHtEHAFe1KSOgqc0-jWUQmdgKq85Q,1092
13
+ shell_lite-0.4.2.dist-info/METADATA,sha256=Vmjcs4LuvQvthMSnDAx7nXA-q4WoLHELI_JuIRb_Y0Q,2475
14
+ shell_lite-0.4.2.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
15
+ shell_lite-0.4.2.dist-info/entry_points.txt,sha256=tglL8tjyPIh1W85j6zFpNZjMpQe_xC-k-7BOhHLWfxc,45
16
+ shell_lite-0.4.2.dist-info/top_level.txt,sha256=hIln5ltrok_Mn3ijlQeqMFF6hHBHCyhzqCO7KL358cg,11
17
+ shell_lite-0.4.2.dist-info/RECORD,,