epstein 1.0.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.
epstein-1.0.0/PKG-INFO ADDED
@@ -0,0 +1,8 @@
1
+ Metadata-Version: 2.4
2
+ Name: epstein
3
+ Version: 1.0.0
4
+ Summary: Epstein - programing language
5
+ Author: blobycz
6
+ License: MIT
7
+ Requires-Python: >=3.8
8
+ Description-Content-Type: text/markdown
File without changes
@@ -0,0 +1,8 @@
1
+ Metadata-Version: 2.4
2
+ Name: epstein
3
+ Version: 1.0.0
4
+ Summary: Epstein - programing language
5
+ Author: blobycz
6
+ License: MIT
7
+ Requires-Python: >=3.8
8
+ Description-Content-Type: text/markdown
@@ -0,0 +1,7 @@
1
+ README.md
2
+ main.py
3
+ pyproject.toml
4
+ epstein.egg-info/PKG-INFO
5
+ epstein.egg-info/SOURCES.txt
6
+ epstein.egg-info/dependency_links.txt
7
+ epstein.egg-info/top_level.txt
@@ -0,0 +1 @@
1
+ main
epstein-1.0.0/main.py ADDED
@@ -0,0 +1,219 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ EPSTEIN Programming Language Interpreter
4
+ A conspiracy-themed programming language with custom syntax
5
+
6
+ Usage:
7
+ python epstein.py <file.epc>
8
+ python epstein.py --help
9
+ """
10
+
11
+ import os
12
+ import sys
13
+ from pathlib import Path
14
+
15
+ # Add src to path
16
+ sys.path.insert(0, str(Path(__file__).parent))
17
+
18
+ from python.lexer import Lexer
19
+ from python.parser import Parser
20
+ from python.interpreter import Interpreter
21
+
22
+
23
+ BANNER = """
24
+ ╔══════════════════════════════════════════════════════════╗
25
+ ║ ║
26
+ ║ ███████╗██████╗ ███████╗████████╗███████╗██╗███╗ ██╗ ║
27
+ ║ ██╔════╝██╔══██╗██╔════╝╚══██╔══╝██╔════╝██║████╗ ██║ ║
28
+ ║ █████╗ ██████╔╝███████╗ ██║ █████╗ ██║██╔██╗ ██║ ║
29
+ ║ ██╔══╝ ██╔═══╝ ╚════██║ ██║ ██╔══╝ ██║██║╚██╗██║ ║
30
+ ║ ███████╗██║ ███████║ ██║ ███████╗██║██║ ╚████║ ║
31
+ ║ ╚══════╝╚═╝ ╚══════╝ ╚═╝ ╚══════╝╚═╝╚═╝ ╚═══╝ ║
32
+ ║ ║
33
+ ║ Programming Language v1.0.0 ║
34
+ ║ Conspiracy-Themed Interpreted Language ║
35
+ ║ ║
36
+ ╚══════════════════════════════════════════════════════════╝
37
+ """
38
+
39
+ HELP_TEXT = """
40
+ EPSTEIN Programming Language
41
+
42
+ Usage:
43
+ epstein <file.epc> Execute an EPSTEIN program
44
+ epstein --help Show this help message
45
+ epstein --version Show version information
46
+
47
+ Examples:
48
+ epstein examples/mission.epc
49
+ epstein my_program.epc
50
+
51
+ EPSTEIN Syntax Quick Reference:
52
+
53
+ Variables:
54
+ deal = "Classified"
55
+ power = 9000
56
+ truth = truth
57
+ lie = lie
58
+
59
+ Output:
60
+ files("Mission started")
61
+ files(deal)
62
+
63
+ Arrays:
64
+ crew = ["Alice", "Bob", "Charlie"]
65
+
66
+ Conditionals:
67
+ if truth:
68
+ files("Authenticated")
69
+ else:
70
+ files("Denied")
71
+
72
+ Loops:
73
+ loop crew:
74
+ files(item)
75
+
76
+ Functions:
77
+ plot infiltration():
78
+ files("Entering base")
79
+
80
+ plan extraction():
81
+ files("Collecting data")
82
+
83
+ For more information, see README.md
84
+ """
85
+
86
+
87
+ class EpsteinCLI:
88
+ """Command-line interface for EPSTEIN"""
89
+
90
+ def __init__(self):
91
+ self.debug = os.getenv('DEBUG', 'false').lower() == 'true'
92
+
93
+ def run(self, args: list):
94
+ """Run CLI with arguments"""
95
+
96
+ if len(args) == 0:
97
+ self.show_usage()
98
+ return
99
+
100
+ command = args[0]
101
+
102
+ # Handle flags
103
+ if command in ('--help', '-h', 'help'):
104
+ self.show_help()
105
+ return
106
+
107
+ if command in ('--version', '-v', 'version'):
108
+ self.show_version()
109
+ return
110
+
111
+ # Execute file
112
+ if command.endswith('.epc'):
113
+ self.execute_file(command)
114
+ else:
115
+ print(f"❌ Error: Unknown command or invalid file: {command}")
116
+ print(f" EPSTEIN files must have .epc extension")
117
+ print()
118
+ self.show_usage()
119
+ sys.exit(1)
120
+
121
+ def execute_file(self, filepath: str):
122
+ """Execute an EPSTEIN program file"""
123
+ try:
124
+ # Check if file exists
125
+ if not os.path.exists(filepath):
126
+ print(f"❌ Error: File not found: {filepath}")
127
+ sys.exit(1)
128
+
129
+ # Read source code
130
+ with open(filepath, 'r', encoding='utf-8') as f:
131
+ code = f.read()
132
+
133
+ # Show banner
134
+ print(BANNER)
135
+ print(f"📁 Executing: {os.path.basename(filepath)}")
136
+ print('━' * 63)
137
+ print()
138
+
139
+ # Lex
140
+ if self.debug:
141
+ print("=== LEXING ===")
142
+ lexer = Lexer(code)
143
+ tokens = lexer.tokenize()
144
+
145
+ if self.debug:
146
+ print(f"Generated {len(tokens)} tokens")
147
+ for token in tokens[:20]: # Show first 20
148
+ print(f" {token}")
149
+ if len(tokens) > 20:
150
+ print(f" ... and {len(tokens) - 20} more")
151
+ print()
152
+
153
+ # Parse
154
+ if self.debug:
155
+ print("=== PARSING ===")
156
+ parser = Parser(tokens)
157
+ ast = parser.parse()
158
+
159
+ if self.debug:
160
+ print(f"Generated AST with {len(ast.statements)} statements")
161
+ print()
162
+
163
+ # Interpret
164
+ if self.debug:
165
+ print("=== EXECUTING ===")
166
+ interpreter = Interpreter()
167
+ interpreter.execute(ast)
168
+
169
+ except SyntaxError as e:
170
+ print(f"\n❌ SYNTAX ERROR")
171
+ print('━' * 63)
172
+ print(f" {e}")
173
+ print('━' * 63)
174
+ sys.exit(1)
175
+
176
+ except RuntimeError as e:
177
+ print(f"\n❌ RUNTIME ERROR")
178
+ print('━' * 63)
179
+ print(f" {e}")
180
+ print('━' * 63)
181
+ sys.exit(1)
182
+
183
+ except Exception as e:
184
+ print(f"\n❌ UNEXPECTED ERROR")
185
+ print('━' * 63)
186
+ print(f" {type(e).__name__}: {e}")
187
+
188
+ if self.debug:
189
+ import traceback
190
+ print()
191
+ traceback.print_exc()
192
+
193
+ print('━' * 63)
194
+ sys.exit(1)
195
+
196
+ def show_usage(self):
197
+ """Show brief usage"""
198
+ print(BANNER)
199
+ print("Usage: epstein <file.epc> | --help | --version")
200
+ print(" epstein --help")
201
+ print()
202
+
203
+ def show_help(self):
204
+ """Show full help"""
205
+ print(HELP_TEXT)
206
+
207
+ def show_version(self):
208
+ """Show version"""
209
+ print("EPSTEIN Programming Language v1.0.0")
210
+
211
+
212
+ def main():
213
+ """Main entry point"""
214
+ cli = EpsteinCLI()
215
+ cli.run(sys.argv[1:])
216
+
217
+
218
+ if __name__ == '__main__':
219
+ main()
@@ -0,0 +1,14 @@
1
+ [project]
2
+ name = "epstein"
3
+ version = "1.0.0"
4
+ description = "Epstein - programing language"
5
+ authors = [
6
+ { name = "blobycz" }
7
+ ]
8
+ readme = "README.md"
9
+ license = { text = "MIT" }
10
+ requires-python = ">=3.8"
11
+
12
+ [build-system]
13
+ requires = ["setuptools>=42", "wheel"]
14
+ build-backend = "setuptools.build_meta"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+