shell-lite 0.4.6__py3-none-any.whl → 0.4.6.1__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 +17 -8
- shell_lite/main.py +2 -2
- shell_lite/parser.py +2 -7
- {shell_lite-0.4.6.dist-info → shell_lite-0.4.6.1.dist-info}/METADATA +1 -1
- shell_lite-0.4.6.1.dist-info/RECORD +15 -0
- shell_lite-0.4.6.dist-info/RECORD +0 -15
- {shell_lite-0.4.6.dist-info → shell_lite-0.4.6.1.dist-info}/LICENSE +0 -0
- {shell_lite-0.4.6.dist-info → shell_lite-0.4.6.1.dist-info}/WHEEL +0 -0
- {shell_lite-0.4.6.dist-info → shell_lite-0.4.6.1.dist-info}/entry_points.txt +0 -0
- {shell_lite-0.4.6.dist-info → shell_lite-0.4.6.1.dist-info}/top_level.txt +0 -0
shell_lite/interpreter.py
CHANGED
|
@@ -1457,6 +1457,10 @@ class Interpreter:
|
|
|
1457
1457
|
def visit_Listen(self, node: Listen):
|
|
1458
1458
|
port_val = self.visit(node.port)
|
|
1459
1459
|
interpreter_ref = self
|
|
1460
|
+
|
|
1461
|
+
class ReusableHTTPServer(HTTPServer):
|
|
1462
|
+
allow_reuse_address = True
|
|
1463
|
+
|
|
1460
1464
|
class ShellLiteHandler(BaseHTTPRequestHandler):
|
|
1461
1465
|
def log_message(self, format, *args): pass
|
|
1462
1466
|
def do_GET(self):
|
|
@@ -1508,7 +1512,9 @@ class Interpreter:
|
|
|
1508
1512
|
self.send_header('Content-Type', ct)
|
|
1509
1513
|
self.end_headers()
|
|
1510
1514
|
if self.command != 'HEAD':
|
|
1511
|
-
|
|
1515
|
+
try:
|
|
1516
|
+
with open(file_path, 'rb') as f: self.wfile.write(f.read())
|
|
1517
|
+
except (BrokenPipeError, ConnectionResetError): pass
|
|
1512
1518
|
return
|
|
1513
1519
|
matched_body = None
|
|
1514
1520
|
path_params = {}
|
|
@@ -1542,24 +1548,27 @@ class Interpreter:
|
|
|
1542
1548
|
self.send_header('Content-Type', 'text/html')
|
|
1543
1549
|
self.end_headers()
|
|
1544
1550
|
if self.command != 'HEAD':
|
|
1545
|
-
|
|
1551
|
+
try:
|
|
1552
|
+
self.wfile.write(response_body.encode())
|
|
1553
|
+
except (BrokenPipeError, ConnectionResetError): pass
|
|
1546
1554
|
else:
|
|
1547
1555
|
self.send_response(404)
|
|
1548
1556
|
self.end_headers()
|
|
1549
1557
|
if self.command != 'HEAD':
|
|
1550
|
-
|
|
1558
|
+
try:
|
|
1559
|
+
self.wfile.write(b'Not Found')
|
|
1560
|
+
except (BrokenPipeError, ConnectionResetError): pass
|
|
1561
|
+
except (BrokenPipeError, ConnectionResetError):
|
|
1562
|
+
pass
|
|
1551
1563
|
except Exception as e:
|
|
1552
|
-
print(f"DEBUG: Server Exception: {e}")
|
|
1553
|
-
import traceback
|
|
1554
|
-
traceback.print_exc()
|
|
1555
1564
|
try:
|
|
1556
1565
|
self.send_response(500)
|
|
1557
1566
|
self.end_headers()
|
|
1558
1567
|
if self.command != 'HEAD':
|
|
1559
1568
|
self.wfile.write(str(e).encode())
|
|
1560
1569
|
except: pass
|
|
1561
|
-
server =
|
|
1562
|
-
print(f"\n ShellLite Server v0.04.6 is running!")
|
|
1570
|
+
server = ReusableHTTPServer(('0.0.0.0', port_val), ShellLiteHandler)
|
|
1571
|
+
print(f"\n ShellLite Server v0.04.6.1 is running!")
|
|
1563
1572
|
print(f" \u001b[1;36m➜\u001b[0m Local: \u001b[1;4;36mhttp://localhost:{port_val}/\u001b[0m\n")
|
|
1564
1573
|
try: server.serve_forever()
|
|
1565
1574
|
except KeyboardInterrupt:
|
shell_lite/main.py
CHANGED
|
@@ -71,7 +71,7 @@ def run_repl():
|
|
|
71
71
|
print("\n" + "="*40)
|
|
72
72
|
print(" ShellLite REPL - English Syntax")
|
|
73
73
|
print("="*40)
|
|
74
|
-
print("Version: v0.04.6 | Made by Shrey Naithani")
|
|
74
|
+
print("Version: v0.04.6.1 | Made by Shrey Naithani")
|
|
75
75
|
print("Commands: Type 'exit' to quit, 'help' for examples.")
|
|
76
76
|
print("Note: Terminal commands (like 'shl install') must be run in CMD/PowerShell, not here.")
|
|
77
77
|
|
|
@@ -202,7 +202,7 @@ def install_globally():
|
|
|
202
202
|
ps_cmd = f'$oldPath = [Environment]::GetEnvironmentVariable("Path", "User"); if ($oldPath -notlike "*ShellLite*") {{ [Environment]::SetEnvironmentVariable("Path", "$oldPath;{install_dir}", "User") }}'
|
|
203
203
|
subprocess.run(["powershell", "-Command", ps_cmd], capture_output=True)
|
|
204
204
|
|
|
205
|
-
print(f"\n[SUCCESS] ShellLite (v0.04.6) is installed!")
|
|
205
|
+
print(f"\n[SUCCESS] ShellLite (v0.04.6.1) is installed!")
|
|
206
206
|
print(f"Location: {install_dir}")
|
|
207
207
|
print("\nIMPORTANT STEP REQUIRED:")
|
|
208
208
|
print("1. Close ALL open terminal windows (CMD, PowerShell, VS Code).")
|
shell_lite/parser.py
CHANGED
|
@@ -1469,12 +1469,7 @@ class Parser:
|
|
|
1469
1469
|
node = Spawn(right)
|
|
1470
1470
|
node.line = op.line
|
|
1471
1471
|
return node
|
|
1472
|
-
|
|
1473
|
-
op = self.consume()
|
|
1474
|
-
right = self.parse_expression()
|
|
1475
|
-
node = Call('run', [right])
|
|
1476
|
-
node.line = op.line
|
|
1477
|
-
return node
|
|
1472
|
+
|
|
1478
1473
|
elif token.type == 'COUNT' or token.type == 'HOW':
|
|
1479
1474
|
token = self.consume()
|
|
1480
1475
|
if token.type == 'HOW':
|
|
@@ -1560,7 +1555,7 @@ class Parser:
|
|
|
1560
1555
|
return self.parse_list()
|
|
1561
1556
|
elif token.type == 'LBRACE':
|
|
1562
1557
|
return self.parse_dict()
|
|
1563
|
-
elif token.type == 'ID':
|
|
1558
|
+
elif token.type == 'ID' or token.type in ('EXECUTE', 'BUTTON', 'ROW', 'COLUMN', 'SIZE', 'HEADING', 'TEXT', 'IMAGE', 'TITLE', 'START', 'SERVE', 'APP', 'PAGE', 'NAVBAR', 'FOOTER', 'SECTION', 'DIV', 'SPAN', 'LINK'):
|
|
1564
1559
|
if token.value == 'a':
|
|
1565
1560
|
if self.peek(1).type == 'LIST' and self.peek(2).type == 'OF':
|
|
1566
1561
|
return self._parse_natural_list()
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
shell_lite/__init__.py,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
|
|
2
|
+
shell_lite/ast_nodes.py,sha256=KGFlZmP21MJXo6uRYRJfo_R3BEspfDD8xMBtAVfUDgU,5873
|
|
3
|
+
shell_lite/cli.py,sha256=14Kq1ohSXS3p-xdh0DPi7eXskUtSX81huSyGhktoOMA,250
|
|
4
|
+
shell_lite/compiler.py,sha256=FcwDLbrjnMnH0VMzEeYPSqD3nIeFAwKIdvEDAT1e3GE,24984
|
|
5
|
+
shell_lite/interpreter.py,sha256=sdtuZ90ytzapGrC0H5xns0AkMMRUMf10Klh4JeBE0ek,78837
|
|
6
|
+
shell_lite/lexer.py,sha256=TdU2QIfxjZqnKDUz_SBECNC74k4ZeQBpX27xFjZImEo,13441
|
|
7
|
+
shell_lite/main.py,sha256=KbBqEX4K_20j8UDrebphQgZxk3WZxECP6uh9zsuyrR0,22795
|
|
8
|
+
shell_lite/parser.py,sha256=xuRV0yLUpTM-_ZPk6KDjAlBqPLINkNcd7QNC3rEzGcU,88225
|
|
9
|
+
shell_lite/runtime.py,sha256=pSjBeA1dTQ-a94q3FLdv9lqZurdd6MJmfhFGHhOoQEM,16057
|
|
10
|
+
shell_lite-0.4.6.1.dist-info/LICENSE,sha256=33eziKLPxbqGCqdHtEHAFe1KSOgqc0-jWUQmdgKq85Q,1092
|
|
11
|
+
shell_lite-0.4.6.1.dist-info/METADATA,sha256=KL1oPAmowIFa_czVMN2PvLhrYTAVYTLbOpuB9TkToIE,2477
|
|
12
|
+
shell_lite-0.4.6.1.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
|
13
|
+
shell_lite-0.4.6.1.dist-info/entry_points.txt,sha256=tglL8tjyPIh1W85j6zFpNZjMpQe_xC-k-7BOhHLWfxc,45
|
|
14
|
+
shell_lite-0.4.6.1.dist-info/top_level.txt,sha256=hIln5ltrok_Mn3ijlQeqMFF6hHBHCyhzqCO7KL358cg,11
|
|
15
|
+
shell_lite-0.4.6.1.dist-info/RECORD,,
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
shell_lite/__init__.py,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
|
|
2
|
-
shell_lite/ast_nodes.py,sha256=KGFlZmP21MJXo6uRYRJfo_R3BEspfDD8xMBtAVfUDgU,5873
|
|
3
|
-
shell_lite/cli.py,sha256=14Kq1ohSXS3p-xdh0DPi7eXskUtSX81huSyGhktoOMA,250
|
|
4
|
-
shell_lite/compiler.py,sha256=FcwDLbrjnMnH0VMzEeYPSqD3nIeFAwKIdvEDAT1e3GE,24984
|
|
5
|
-
shell_lite/interpreter.py,sha256=zN46kjaK60glywbKpPcfWPeGLMwvSRk2uB1m_T8F4X8,78408
|
|
6
|
-
shell_lite/lexer.py,sha256=TdU2QIfxjZqnKDUz_SBECNC74k4ZeQBpX27xFjZImEo,13441
|
|
7
|
-
shell_lite/main.py,sha256=a8toltP-LDET08v-zVzaYwe64e1KrMR40pXOqIFl7WE,22791
|
|
8
|
-
shell_lite/parser.py,sha256=PpdMy1vEXKVtPlAkpgjna7xohIvtBgiFodSPqat3omI,88251
|
|
9
|
-
shell_lite/runtime.py,sha256=pSjBeA1dTQ-a94q3FLdv9lqZurdd6MJmfhFGHhOoQEM,16057
|
|
10
|
-
shell_lite-0.4.6.dist-info/LICENSE,sha256=33eziKLPxbqGCqdHtEHAFe1KSOgqc0-jWUQmdgKq85Q,1092
|
|
11
|
-
shell_lite-0.4.6.dist-info/METADATA,sha256=NJwW6KUYTXKc5tAxN689mSGFNo5ITlIDadkVgelAjbY,2475
|
|
12
|
-
shell_lite-0.4.6.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
|
13
|
-
shell_lite-0.4.6.dist-info/entry_points.txt,sha256=tglL8tjyPIh1W85j6zFpNZjMpQe_xC-k-7BOhHLWfxc,45
|
|
14
|
-
shell_lite-0.4.6.dist-info/top_level.txt,sha256=hIln5ltrok_Mn3ijlQeqMFF6hHBHCyhzqCO7KL358cg,11
|
|
15
|
-
shell_lite-0.4.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|