shell-lite 0.3.3__py3-none-any.whl → 0.3.5__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/__init__.py +1 -0
- shell_lite/ast_nodes.py +15 -110
- shell_lite/cli.py +10 -0
- shell_lite/compiler.py +2 -189
- shell_lite/formatter.py +75 -0
- shell_lite/interpreter.py +35 -538
- shell_lite/js_compiler.py +3 -79
- shell_lite/lexer.py +29 -107
- shell_lite/main.py +120 -75
- shell_lite/parser.py +17 -510
- shell_lite/runtime.py +1 -76
- shell_lite-0.3.5.dist-info/LICENSE +21 -0
- shell_lite-0.3.5.dist-info/METADATA +40 -0
- shell_lite-0.3.5.dist-info/RECORD +17 -0
- {shell_lite-0.3.3.dist-info → shell_lite-0.3.5.dist-info}/WHEEL +1 -1
- shell_lite-0.3.3.dist-info/METADATA +0 -77
- shell_lite-0.3.3.dist-info/RECORD +0 -14
- {shell_lite-0.3.3.dist-info → shell_lite-0.3.5.dist-info}/entry_points.txt +0 -0
- {shell_lite-0.3.3.dist-info → shell_lite-0.3.5.dist-info}/top_level.txt +0 -0
shell_lite/runtime.py
CHANGED
|
@@ -16,73 +16,53 @@ import threading
|
|
|
16
16
|
import concurrent.futures
|
|
17
17
|
import tkinter as tk
|
|
18
18
|
from tkinter import messagebox, simpledialog
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
# --- Exceptions ---
|
|
22
19
|
class ReturnException(Exception):
|
|
23
20
|
def __init__(self, value):
|
|
24
21
|
self.value = value
|
|
25
|
-
|
|
26
22
|
class StopException(Exception):
|
|
27
23
|
pass
|
|
28
|
-
|
|
29
24
|
class SkipException(Exception):
|
|
30
25
|
pass
|
|
31
|
-
|
|
32
26
|
class ShellLiteError(Exception):
|
|
33
27
|
def __init__(self, message):
|
|
34
28
|
self.message = message
|
|
35
29
|
super().__init__(message)
|
|
36
|
-
|
|
37
|
-
# --- Data Structures ---
|
|
38
30
|
class Environment:
|
|
39
31
|
def __init__(self, parent=None):
|
|
40
32
|
self.variables: Dict[str, Any] = {}
|
|
41
33
|
self.constants: set = set()
|
|
42
34
|
self.parent = parent
|
|
43
|
-
|
|
44
35
|
def get(self, name: str) -> Any:
|
|
45
36
|
if name in self.variables:
|
|
46
37
|
return self.variables[name]
|
|
47
38
|
if self.parent:
|
|
48
39
|
return self.parent.get(name)
|
|
49
40
|
raise NameError(f"Variable '{name}' is not defined.")
|
|
50
|
-
|
|
51
41
|
def set(self, name: str, value: Any):
|
|
52
42
|
if name in self.constants:
|
|
53
43
|
raise RuntimeError(f"Cannot reassign constant '{name}'")
|
|
54
44
|
if self.parent and name in self.parent.constants:
|
|
55
45
|
raise RuntimeError(f"Cannot reassign constant '{name}'")
|
|
56
46
|
self.variables[name] = value
|
|
57
|
-
|
|
58
47
|
def set_const(self, name: str, value: Any):
|
|
59
48
|
if name in self.variables:
|
|
60
49
|
raise RuntimeError(f"Constant '{name}' already declared")
|
|
61
50
|
self.variables[name] = value
|
|
62
51
|
self.constants.add(name)
|
|
63
|
-
|
|
64
|
-
# We need ClassDef for Instance to hold reference?
|
|
65
|
-
# To avoid circular imports, we just treat class_def as Any or a simple object for now.
|
|
66
|
-
# Or we can redefine a simple RuntimeClassDef if needed, but for now we'll stick to dynamic typing.
|
|
67
|
-
|
|
68
52
|
class Instance:
|
|
69
53
|
def __init__(self, class_def: Any):
|
|
70
54
|
self.class_def = class_def
|
|
71
55
|
self.data: Dict[str, Any] = {}
|
|
72
|
-
|
|
73
56
|
class Tag:
|
|
74
|
-
"""HTML Tag Builder"""
|
|
75
57
|
def __init__(self, name: str, attrs: Dict[str, Any] = None):
|
|
76
58
|
self.name = name
|
|
77
59
|
self.attrs = attrs or {}
|
|
78
60
|
self.children: List[Any] = []
|
|
79
|
-
|
|
80
61
|
def add(self, child):
|
|
81
62
|
if isinstance(child, Tag):
|
|
82
63
|
if any(c is child for c in self.children):
|
|
83
64
|
return
|
|
84
65
|
self.children.append(child)
|
|
85
|
-
|
|
86
66
|
def __str__(self):
|
|
87
67
|
attr_str = ""
|
|
88
68
|
for k, v in self.attrs.items():
|
|
@@ -93,28 +73,20 @@ class Tag:
|
|
|
93
73
|
if self.name in ('img', 'br', 'hr', 'input', 'meta', 'link'):
|
|
94
74
|
return f"<{self.name}{attr_str} />"
|
|
95
75
|
return f"<{self.name}{attr_str}>{inner}</{self.name}>"
|
|
96
|
-
|
|
97
76
|
class WebBuilder:
|
|
98
|
-
"""Context manager for nested tags"""
|
|
99
77
|
def __init__(self, interpreter=None):
|
|
100
78
|
self.stack: List[Tag] = []
|
|
101
79
|
self.interpreter = interpreter
|
|
102
|
-
|
|
103
80
|
def push(self, tag: Tag):
|
|
104
81
|
if self.stack:
|
|
105
82
|
self.stack[-1].add(tag)
|
|
106
83
|
self.stack.append(tag)
|
|
107
|
-
|
|
108
84
|
def pop(self):
|
|
109
85
|
if not self.stack: return None
|
|
110
86
|
return self.stack.pop()
|
|
111
|
-
|
|
112
87
|
def add_text(self, text: str):
|
|
113
88
|
if self.stack:
|
|
114
89
|
self.stack[-1].add(text)
|
|
115
|
-
|
|
116
|
-
# --- Builtin Functions (Standalone) ---
|
|
117
|
-
|
|
118
90
|
def slang_run(cmd):
|
|
119
91
|
try:
|
|
120
92
|
result = subprocess.run(cmd, shell=True, capture_output=True, text=True)
|
|
@@ -123,14 +95,12 @@ def slang_run(cmd):
|
|
|
123
95
|
return result.stdout.strip()
|
|
124
96
|
except Exception as e:
|
|
125
97
|
raise RuntimeError(f"Failed to run command: {e}")
|
|
126
|
-
|
|
127
98
|
def slang_read(path):
|
|
128
99
|
try:
|
|
129
100
|
with open(path, 'r', encoding='utf-8') as f:
|
|
130
101
|
return f.read()
|
|
131
102
|
except Exception as e:
|
|
132
103
|
raise RuntimeError(f"Failed to read file '{path}': {e}")
|
|
133
|
-
|
|
134
104
|
def slang_write(path, content):
|
|
135
105
|
try:
|
|
136
106
|
with open(path, 'w', encoding='utf-8') as f:
|
|
@@ -138,13 +108,11 @@ def slang_write(path, content):
|
|
|
138
108
|
return True
|
|
139
109
|
except Exception as e:
|
|
140
110
|
raise RuntimeError(f"Failed to write file '{path}': {e}")
|
|
141
|
-
|
|
142
111
|
def slang_json_parse(json_str):
|
|
143
112
|
try:
|
|
144
113
|
return json.loads(json_str)
|
|
145
114
|
except Exception as e:
|
|
146
115
|
raise RuntimeError(f"Invalid JSON: {e}")
|
|
147
|
-
|
|
148
116
|
def slang_json_stringify(obj):
|
|
149
117
|
try:
|
|
150
118
|
if isinstance(obj, Instance):
|
|
@@ -152,14 +120,12 @@ def slang_json_stringify(obj):
|
|
|
152
120
|
return json.dumps(obj)
|
|
153
121
|
except Exception as e:
|
|
154
122
|
raise RuntimeError(f"JSON stringify failed: {e}")
|
|
155
|
-
|
|
156
123
|
def slang_http_get(url):
|
|
157
124
|
try:
|
|
158
125
|
with urllib.request.urlopen(url) as response:
|
|
159
126
|
return response.read().decode('utf-8')
|
|
160
127
|
except Exception as e:
|
|
161
128
|
raise RuntimeError(f"HTTP GET failed for '{url}': {e}")
|
|
162
|
-
|
|
163
129
|
def slang_http_post(url, data_dict):
|
|
164
130
|
try:
|
|
165
131
|
if isinstance(data_dict, Instance):
|
|
@@ -170,7 +136,6 @@ def slang_http_post(url, data_dict):
|
|
|
170
136
|
return response.read().decode('utf-8')
|
|
171
137
|
except Exception as e:
|
|
172
138
|
raise RuntimeError(f"HTTP POST failed for '{url}': {e}")
|
|
173
|
-
|
|
174
139
|
def slang_download(url):
|
|
175
140
|
filename = url.split('/')[-1] or "downloaded_file"
|
|
176
141
|
try:
|
|
@@ -180,7 +145,6 @@ def slang_download(url):
|
|
|
180
145
|
return filename
|
|
181
146
|
except Exception as e:
|
|
182
147
|
raise RuntimeError(f"Download failed: {e}")
|
|
183
|
-
|
|
184
148
|
def slang_archive(op, source, target):
|
|
185
149
|
try:
|
|
186
150
|
if op == 'compress':
|
|
@@ -194,13 +158,11 @@ def slang_archive(op, source, target):
|
|
|
194
158
|
zipf.extractall(target)
|
|
195
159
|
except Exception as e:
|
|
196
160
|
raise RuntimeError(f"Archive operation failed: {e}")
|
|
197
|
-
|
|
198
161
|
def slang_csv_load(path):
|
|
199
162
|
import csv
|
|
200
163
|
with open(path, 'r', newline='') as f:
|
|
201
164
|
reader = csv.DictReader(f)
|
|
202
165
|
return [row for row in reader]
|
|
203
|
-
|
|
204
166
|
def slang_csv_save(data, path):
|
|
205
167
|
import csv
|
|
206
168
|
if not isinstance(data, list): data = [data]
|
|
@@ -215,46 +177,39 @@ def slang_csv_save(data, path):
|
|
|
215
177
|
writer = csv.DictWriter(f, fieldnames=keys)
|
|
216
178
|
writer.writeheader()
|
|
217
179
|
writer.writerows(rows)
|
|
218
|
-
|
|
219
180
|
def slang_clipboard_copy(text):
|
|
220
181
|
try:
|
|
221
182
|
import pyperclip
|
|
222
183
|
pyperclip.copy(str(text))
|
|
223
184
|
except ImportError:
|
|
224
185
|
pass
|
|
225
|
-
|
|
226
186
|
def slang_clipboard_paste():
|
|
227
187
|
try:
|
|
228
188
|
import pyperclip
|
|
229
189
|
return pyperclip.paste()
|
|
230
190
|
except ImportError:
|
|
231
191
|
return ""
|
|
232
|
-
|
|
233
192
|
def slang_press(key):
|
|
234
193
|
try:
|
|
235
194
|
import keyboard
|
|
236
195
|
keyboard.press_and_release(key)
|
|
237
196
|
except ImportError: pass
|
|
238
|
-
|
|
239
197
|
def slang_type(text):
|
|
240
198
|
try:
|
|
241
199
|
import keyboard
|
|
242
200
|
keyboard.write(str(text))
|
|
243
201
|
except ImportError: pass
|
|
244
|
-
|
|
245
202
|
def slang_click(x, y):
|
|
246
203
|
try:
|
|
247
204
|
import mouse
|
|
248
205
|
mouse.move(x, y, absolute=True, duration=0.2)
|
|
249
206
|
mouse.click('left')
|
|
250
207
|
except ImportError: pass
|
|
251
|
-
|
|
252
208
|
def slang_notify(title, msg):
|
|
253
209
|
try:
|
|
254
210
|
from plyer import notification
|
|
255
211
|
notification.notify(title=str(title), message=str(msg))
|
|
256
212
|
except ImportError: pass
|
|
257
|
-
|
|
258
213
|
def slang_date_parse(expr):
|
|
259
214
|
from datetime import datetime, timedelta
|
|
260
215
|
today = datetime.now()
|
|
@@ -271,15 +226,12 @@ def slang_date_parse(expr):
|
|
|
271
226
|
if days_ahead <= 0: days_ahead += 7
|
|
272
227
|
return (today + timedelta(days=days_ahead)).strftime("%Y-%m-%d")
|
|
273
228
|
return s
|
|
274
|
-
|
|
275
229
|
def slang_file_write(path, content, mode):
|
|
276
230
|
with open(path, mode, encoding='utf-8') as f:
|
|
277
231
|
f.write(str(content))
|
|
278
|
-
|
|
279
232
|
def slang_file_read(path):
|
|
280
233
|
with open(path, 'r', encoding='utf-8') as f:
|
|
281
234
|
return f.read()
|
|
282
|
-
|
|
283
235
|
import sqlite3
|
|
284
236
|
_slang_db_conn = None
|
|
285
237
|
def slang_db_open(path):
|
|
@@ -287,31 +239,26 @@ def slang_db_open(path):
|
|
|
287
239
|
_slang_db_conn = sqlite3.connect(path, check_same_thread=False)
|
|
288
240
|
_slang_db_conn.row_factory = lambda c, r: {col[0]: r[idx] for idx, col in enumerate(c.description)}
|
|
289
241
|
return True
|
|
290
|
-
|
|
291
242
|
def slang_db_close():
|
|
292
243
|
global _slang_db_conn
|
|
293
244
|
if _slang_db_conn: _slang_db_conn.close(); _slang_db_conn = None
|
|
294
|
-
|
|
295
245
|
def slang_db_exec(sql, params=None):
|
|
296
246
|
if not _slang_db_conn: raise RuntimeError("DB not open")
|
|
297
247
|
if params is None: params = []
|
|
298
248
|
c = _slang_db_conn.cursor(); c.execute(sql, params); _slang_db_conn.commit()
|
|
299
249
|
return c.lastrowid
|
|
300
|
-
|
|
301
250
|
def slang_db_query(sql, params=None):
|
|
302
251
|
if not _slang_db_conn: raise RuntimeError("DB not open")
|
|
303
252
|
if params is None: params = []
|
|
304
253
|
c = _slang_db_conn.cursor(); c.execute(sql, params)
|
|
305
254
|
return c.fetchall()
|
|
306
|
-
|
|
307
255
|
def slang_json_stringify(val):
|
|
308
|
-
if isinstance(val, (Instance, dict)):
|
|
256
|
+
if isinstance(val, (Instance, dict)):
|
|
309
257
|
d = val.data if isinstance(val, Instance) else val
|
|
310
258
|
return json.dumps(d)
|
|
311
259
|
if isinstance(val, list):
|
|
312
260
|
return json.dumps([v.data if isinstance(v, Instance) else v for v in val])
|
|
313
261
|
return json.dumps(val)
|
|
314
|
-
|
|
315
262
|
def slang_color_print(val, color=None, style=None):
|
|
316
263
|
colors = {'red': '91', 'green': '92', 'yellow': '93', 'blue': '94', 'magenta': '95', 'cyan': '96'}
|
|
317
264
|
parts = []
|
|
@@ -321,14 +268,12 @@ def slang_color_print(val, color=None, style=None):
|
|
|
321
268
|
print(f"\033[{';'.join(parts)}m{val}\033[0m")
|
|
322
269
|
else:
|
|
323
270
|
print(val)
|
|
324
|
-
|
|
325
271
|
def slang_alert(msg):
|
|
326
272
|
root = tk.Tk()
|
|
327
273
|
root.withdraw()
|
|
328
274
|
root.attributes('-topmost', True)
|
|
329
275
|
messagebox.showinfo("Alert", str(msg))
|
|
330
276
|
root.destroy()
|
|
331
|
-
|
|
332
277
|
def slang_prompt(prompt):
|
|
333
278
|
root = tk.Tk()
|
|
334
279
|
root.withdraw()
|
|
@@ -336,7 +281,6 @@ def slang_prompt(prompt):
|
|
|
336
281
|
val = simpledialog.askstring("Input", str(prompt))
|
|
337
282
|
root.destroy()
|
|
338
283
|
return val if val is not None else ""
|
|
339
|
-
|
|
340
284
|
def slang_confirm(prompt):
|
|
341
285
|
root = tk.Tk()
|
|
342
286
|
root.withdraw()
|
|
@@ -344,9 +288,6 @@ def slang_confirm(prompt):
|
|
|
344
288
|
val = messagebox.askyesno("Confirm", str(prompt))
|
|
345
289
|
root.destroy()
|
|
346
290
|
return val
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
# Standard Modules Definition (Moved here for reuse)
|
|
350
291
|
def get_std_modules():
|
|
351
292
|
return {
|
|
352
293
|
'math': {
|
|
@@ -397,47 +338,37 @@ def get_std_modules():
|
|
|
397
338
|
'split': lambda p, s: re.split(p, s),
|
|
398
339
|
},
|
|
399
340
|
}
|
|
400
|
-
|
|
401
|
-
|
|
402
341
|
def slang_map(lst, func):
|
|
403
342
|
if callable(func):
|
|
404
343
|
return [func(x) for x in lst]
|
|
405
344
|
raise TypeError("map requires a callable")
|
|
406
|
-
|
|
407
345
|
def slang_filter(lst, func):
|
|
408
346
|
if callable(func):
|
|
409
347
|
return [x for x in lst if func(x)]
|
|
410
348
|
raise TypeError("filter requires a callable")
|
|
411
|
-
|
|
412
349
|
def slang_reduce(lst, func, initial=None):
|
|
413
350
|
if callable(func):
|
|
414
351
|
if initial is not None:
|
|
415
352
|
return functools.reduce(func, lst, initial)
|
|
416
353
|
return functools.reduce(func, lst)
|
|
417
354
|
raise TypeError("reduce requires a callable")
|
|
418
|
-
|
|
419
355
|
def slang_push(lst, item):
|
|
420
356
|
lst.append(item)
|
|
421
357
|
return None
|
|
422
|
-
|
|
423
|
-
# Builtin functions map for the Environment
|
|
424
358
|
def get_builtins():
|
|
425
359
|
return {
|
|
426
360
|
'str': str, 'int': int, 'float': float, 'bool': bool,
|
|
427
361
|
'list': list, 'len': len,
|
|
428
362
|
'range': lambda *args: list(range(*args)),
|
|
429
363
|
'typeof': lambda x: type(x).__name__,
|
|
430
|
-
|
|
431
364
|
'run': slang_run,
|
|
432
365
|
'read': slang_read,
|
|
433
366
|
'write': slang_write,
|
|
434
367
|
'json_parse': slang_json_parse,
|
|
435
368
|
'json_stringify': slang_json_stringify,
|
|
436
369
|
'print': print,
|
|
437
|
-
|
|
438
370
|
'abs': abs, 'min': min, 'max': max,
|
|
439
371
|
'round': round, 'pow': pow, 'sum': sum,
|
|
440
|
-
|
|
441
372
|
'split': lambda s, d=" ": s.split(d),
|
|
442
373
|
'join': lambda lst, d="": d.join(str(x) for x in lst),
|
|
443
374
|
'replace': lambda s, old, new: s.replace(old, new),
|
|
@@ -448,7 +379,6 @@ def get_builtins():
|
|
|
448
379
|
'endswith': lambda s, p: s.endswith(p),
|
|
449
380
|
'find': lambda s, sub: s.find(sub),
|
|
450
381
|
'char': chr, 'ord': ord,
|
|
451
|
-
|
|
452
382
|
'append': lambda l, x: (l.append(x), l)[1],
|
|
453
383
|
'push': slang_push,
|
|
454
384
|
'count': len,
|
|
@@ -461,21 +391,17 @@ def get_builtins():
|
|
|
461
391
|
'slice': lambda l, start, end=None: l[start:end],
|
|
462
392
|
'contains': lambda l, x: x in l,
|
|
463
393
|
'index': lambda l, x: l.index(x) if x in l else -1,
|
|
464
|
-
|
|
465
394
|
'map': slang_map,
|
|
466
395
|
'filter': slang_filter,
|
|
467
396
|
'reduce': slang_reduce,
|
|
468
|
-
|
|
469
397
|
'exists': os.path.exists,
|
|
470
398
|
'delete': os.remove,
|
|
471
399
|
'copy': shutil.copy,
|
|
472
400
|
'rename': os.rename,
|
|
473
401
|
'mkdir': lambda p: os.makedirs(p, exist_ok=True),
|
|
474
402
|
'listdir': os.listdir,
|
|
475
|
-
|
|
476
403
|
'http_get': slang_http_get,
|
|
477
404
|
'http_post': slang_http_post,
|
|
478
|
-
|
|
479
405
|
'random': random.random,
|
|
480
406
|
'randint': random.randint,
|
|
481
407
|
'sleep': time.sleep,
|
|
@@ -494,6 +420,5 @@ def get_builtins():
|
|
|
494
420
|
'confirm': slang_confirm,
|
|
495
421
|
'Set': set,
|
|
496
422
|
'show': print,
|
|
497
|
-
|
|
498
423
|
'say': print,
|
|
499
424
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Shrey Naithani
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: shell-lite
|
|
3
|
+
Version: 0.3.5
|
|
4
|
+
Summary: A lightweight, English-like scripting language.
|
|
5
|
+
Author-email: Shrey Naithani <contact@shelllite.tech>
|
|
6
|
+
License: MIT
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: Operating System :: OS Independent
|
|
9
|
+
Requires-Python: >=3.8
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
|
|
13
|
+
# ShellLite
|
|
14
|
+
|
|
15
|
+
**ShellLite** is a programming language designed to be as readable as plain English. It strips away the complex syntax of traditional languages and replaces it with natural, human-friendly commands.
|
|
16
|
+
|
|
17
|
+
## ⭐ Support Us
|
|
18
|
+
|
|
19
|
+
If you like ShellLite, please kindly **star** our repository on GitHub! It helps us grow.
|
|
20
|
+
|
|
21
|
+
👉 [**GitHub Repository**](https://github.com/Shrey-N/ShellLite)
|
|
22
|
+
|
|
23
|
+
## 📦 Installation
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
pip install shell-lite
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## 🔗 Ecosystem
|
|
30
|
+
|
|
31
|
+
- **Website & IDE**: [shelllite.tech](https://shelllite.tech)
|
|
32
|
+
- **VS Code Extension**: [Marketplace](https://marketplace.visualstudio.com/items?itemName=shelllite.shelllite-hello)
|
|
33
|
+
- **OpenVSX**: [OpenVSX Registry](https://open-vsx.org/extension/shelllite/shelllite-hello)
|
|
34
|
+
|
|
35
|
+
## 📞 Contact
|
|
36
|
+
|
|
37
|
+
To help in the development, please contact **Shrey Naithani** at [contact@shelllite.tech](mailto:contact@shelllite.tech).
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
**Made by Shrey Naithani**
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
shell_lite/__init__.py,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
|
|
2
|
+
shell_lite/ast_nodes.py,sha256=xbxIiUSduXWdq0DYQQLkWpW5TfmOFxmbpBRbe3YDyfI,5341
|
|
3
|
+
shell_lite/cli.py,sha256=14Kq1ohSXS3p-xdh0DPi7eXskUtSX81huSyGhktoOMA,250
|
|
4
|
+
shell_lite/compiler.py,sha256=nAWLyU1aLc5OJm5qpe3aHsKyVQ61JfHerOs3rl572xU,24600
|
|
5
|
+
shell_lite/formatter.py,sha256=590BfQmhsX466i5_xONXAhgVE97zfcV79q1wA3DT47A,2952
|
|
6
|
+
shell_lite/interpreter.py,sha256=yuGCdIL66SV9bwHGA2fUI6RwoJ45TheAiu_p0QZY8Z8,66858
|
|
7
|
+
shell_lite/js_compiler.py,sha256=yBAHRASGccKIe5-U_SbLO13TexhJydQ_bClDHzWhogI,8877
|
|
8
|
+
shell_lite/lexer.py,sha256=c8KpM9qtGmmUks3SlCZzEz-CdEj-Z1JC34FMr3WD9i0,12355
|
|
9
|
+
shell_lite/main.py,sha256=ubDEMXWlxT7eUyfRlnzDkc8CVCqqzYLpBHkh8EJ1-Mg,15469
|
|
10
|
+
shell_lite/parser.py,sha256=xT_CuN6Nz4Pz5sU5iM-KpnCWFde1txk1JRhhqFlckc8,64902
|
|
11
|
+
shell_lite/runtime.py,sha256=pSjBeA1dTQ-a94q3FLdv9lqZurdd6MJmfhFGHhOoQEM,16057
|
|
12
|
+
shell_lite-0.3.5.dist-info/LICENSE,sha256=33eziKLPxbqGCqdHtEHAFe1KSOgqc0-jWUQmdgKq85Q,1092
|
|
13
|
+
shell_lite-0.3.5.dist-info/METADATA,sha256=-mt7dpP-TJ93MWZEcytgaT6CG2MO7XlUnPjM00Lo4-I,1311
|
|
14
|
+
shell_lite-0.3.5.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
|
15
|
+
shell_lite-0.3.5.dist-info/entry_points.txt,sha256=tglL8tjyPIh1W85j6zFpNZjMpQe_xC-k-7BOhHLWfxc,45
|
|
16
|
+
shell_lite-0.3.5.dist-info/top_level.txt,sha256=hIln5ltrok_Mn3ijlQeqMFF6hHBHCyhzqCO7KL358cg,11
|
|
17
|
+
shell_lite-0.3.5.dist-info/RECORD,,
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: shell-lite
|
|
3
|
-
Version: 0.3.3
|
|
4
|
-
Summary: A lightweight, English-like scripting language.
|
|
5
|
-
Author-email: Shrey Naithani <shrey@example.com>
|
|
6
|
-
License: MIT
|
|
7
|
-
Classifier: Programming Language :: Python :: 3
|
|
8
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
9
|
-
Classifier: Operating System :: OS Independent
|
|
10
|
-
Requires-Python: >=3.8
|
|
11
|
-
Description-Content-Type: text/markdown
|
|
12
|
-
|
|
13
|
-
# ShellLite: The English-Like Programming Language
|
|
14
|
-
### By Shrey Naithani
|
|
15
|
-
|
|
16
|
-
**ShellLite** is a programming language designed to be as readable as plain English. It strips away the complex syntax of traditional languages and replaces it with natural, human-friendly commands.
|
|
17
|
-
|
|
18
|
-
Whether you are automating your desktop, building a website, or just learning to code, ShellLite makes it simple.
|
|
19
|
-
|
|
20
|
-
## Quick Start
|
|
21
|
-
|
|
22
|
-
### Installation
|
|
23
|
-
ShellLite is easiest to install globally on Windows.
|
|
24
|
-
|
|
25
|
-
1. **Download & Install**:
|
|
26
|
-
Run the `shl.exe` file. It will automatically set itself up in your system PATH.
|
|
27
|
-
|
|
28
|
-
2. **Verify**:
|
|
29
|
-
Open a new terminal and type:
|
|
30
|
-
```bash
|
|
31
|
-
shl
|
|
32
|
-
```
|
|
33
|
-
If you see the `>>>` prompt, you are ready to go!
|
|
34
|
-
|
|
35
|
-
### Your First Program
|
|
36
|
-
Create a file named `hello.shl`:
|
|
37
|
-
|
|
38
|
-
```javascript
|
|
39
|
-
say "Hello, World!"
|
|
40
|
-
name = ask "What is your name? "
|
|
41
|
-
say "Nice to meet you, " + name
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
Run it:
|
|
45
|
-
```bash
|
|
46
|
-
shl hello.shl
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
### Package Manager (New!)
|
|
51
|
-
You can install packages from GitHub using `shl get`:
|
|
52
|
-
|
|
53
|
-
```bash
|
|
54
|
-
shl get "shreyn/math-plus"
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
Then use it in your code:
|
|
58
|
-
```javascript
|
|
59
|
-
use "math-plus" as mp
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
---
|
|
63
|
-
|
|
64
|
-
## Documentation
|
|
65
|
-
We have a comprehensive guide to help you master ShellLite:
|
|
66
|
-
|
|
67
|
-
1. [**Getting Started**](docs/01_Getting_Started.md) - Installation, VS Code setup, and running code.
|
|
68
|
-
2. [**Language Basics**](docs/02_Language_Basics.md) - Variables, types, and basic input/output.
|
|
69
|
-
3. [**Control Flow**](docs/03_Control_Flow.md) - Making decisions with `if`, `when`, and loops.
|
|
70
|
-
4. [**Data Structures**](docs/04_Data_Structures.md) - Lists, dictionaries, and sets.
|
|
71
|
-
5. [**Functions & OOP**](docs/05_Functions_and_OOP.md) - Reusable code and Object-Oriented Programming.
|
|
72
|
-
6. [**Modules & Standard Lib**](docs/06_Modules_and_StdLib.md) - Math, Time, CSV, and more.
|
|
73
|
-
7. [**System Mastery**](docs/07_System_Mastery.md) - File manipulation and desktop automation.
|
|
74
|
-
8. [**Web Development**](docs/08_Web_Development.md) - Building websites with English syntax.
|
|
75
|
-
|
|
76
|
-
---
|
|
77
|
-
*Made by Shrey Naithani*
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
shell_lite/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
shell_lite/ast_nodes.py,sha256=66KeoMKLeSykV9KFautTrBeM-HGxTEzlWoU8o3SigrU,6894
|
|
3
|
-
shell_lite/compiler.py,sha256=nXVgYXMLEDPtMHgoyx2g3HA8kxTSYDkeh7hevI58HUI,29846
|
|
4
|
-
shell_lite/interpreter.py,sha256=xnX8WT4LU4AOpvykpTEbVz6TOzpP40Z_JckSpy-43Qk,79652
|
|
5
|
-
shell_lite/js_compiler.py,sha256=euQuQ_B0oPIXYmXNwGot5ygPPtyRxs1fcBcEzOHQUoM,10450
|
|
6
|
-
shell_lite/lexer.py,sha256=xGBlqBkBBScl2uFd47SoQz4C0HmA4dIpbCNl1BR2GWs,14899
|
|
7
|
-
shell_lite/main.py,sha256=9mw6nS7X0mrUfs40Hdqwo9XdTFcszhOoqj0Uwt0XxTQ,12345
|
|
8
|
-
shell_lite/parser.py,sha256=Qrd2GmUPqOoiKWF_dhgm_kM6Q1_tenAdmhsG58UKNws,79125
|
|
9
|
-
shell_lite/runtime.py,sha256=WwQ1GwHHBfUxS--XEcDaDhSKYQAc1Y4D05yuDq7USsw,16837
|
|
10
|
-
shell_lite-0.3.3.dist-info/METADATA,sha256=xws9vjI5MQ4MOZAqKGb4ZpjujNJkcvDIpjc2rA7ochQ,2456
|
|
11
|
-
shell_lite-0.3.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
12
|
-
shell_lite-0.3.3.dist-info/entry_points.txt,sha256=tglL8tjyPIh1W85j6zFpNZjMpQe_xC-k-7BOhHLWfxc,45
|
|
13
|
-
shell_lite-0.3.3.dist-info/top_level.txt,sha256=hIln5ltrok_Mn3ijlQeqMFF6hHBHCyhzqCO7KL358cg,11
|
|
14
|
-
shell_lite-0.3.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|