easypy-lang 1.0.2__tar.gz → 2.0.1__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: easypy-lang
3
- Version: 1.0.2
3
+ Version: 2.0.1
4
4
  Summary: A simple, powerful language for AI, ML, and apps - No coding experience needed!
5
5
  Home-page: https://github.com/VadikGoel/easypy-lang
6
6
  Author: Vadik Goel
@@ -41,12 +41,24 @@ Whether you want to build websites, analyze data, or create AI chatbots, Easypy
41
41
 
42
42
  ## 📦 Installation
43
43
 
44
- To get started, simply install the package via pip:
44
+ ### Option 1: Install via Pip (Recommended)
45
+ Simply install the package via pip:
45
46
 
46
47
  ```bash
47
48
  pip install easypy-lang
48
49
  ```
49
50
 
51
+ ### Option 2: Run via Docker (No Install Needed)
52
+ Don't want to install Python? Run Easypy directly in a container:
53
+
54
+ ```bash
55
+ # Pull the image
56
+ docker pull vadikgoel/easypy-lang
57
+
58
+ # Run interactive mode
59
+ docker run -it vadikgoel/easypy-lang
60
+ ```
61
+
50
62
  ## ✨ Features
51
63
 
52
64
  - **English-like Syntax**: Write code that reads like a story.
@@ -80,7 +92,7 @@ easypy hello.easy
80
92
 
81
93
  ## 📚 Documentation
82
94
 
83
- For full documentation, tutorials, and the interactive playground, please check the `docs/` folder included in the repository or visit our [GitHub Repository](https://github.com/VadikGoel/easypy-lang).
95
+ For full documentation, tutorials, and the interactive playground, please check the `docs/` folder included in the repository or visit our [Documentation](https://vadikgoel.github.io/easypy-lang/).
84
96
 
85
97
  ## 🤝 Contributing
86
98
 
@@ -8,12 +8,24 @@ Whether you want to build websites, analyze data, or create AI chatbots, Easypy
8
8
 
9
9
  ## 📦 Installation
10
10
 
11
- To get started, simply install the package via pip:
11
+ ### Option 1: Install via Pip (Recommended)
12
+ Simply install the package via pip:
12
13
 
13
14
  ```bash
14
15
  pip install easypy-lang
15
16
  ```
16
17
 
18
+ ### Option 2: Run via Docker (No Install Needed)
19
+ Don't want to install Python? Run Easypy directly in a container:
20
+
21
+ ```bash
22
+ # Pull the image
23
+ docker pull vadikgoel/easypy-lang
24
+
25
+ # Run interactive mode
26
+ docker run -it vadikgoel/easypy-lang
27
+ ```
28
+
17
29
  ## ✨ Features
18
30
 
19
31
  - **English-like Syntax**: Write code that reads like a story.
@@ -47,7 +59,7 @@ easypy hello.easy
47
59
 
48
60
  ## 📚 Documentation
49
61
 
50
- For full documentation, tutorials, and the interactive playground, please check the `docs/` folder included in the repository or visit our [GitHub Repository](https://github.com/VadikGoel/easypy-lang).
62
+ For full documentation, tutorials, and the interactive playground, please check the `docs/` folder included in the repository or visit our [Documentation](https://vadikgoel.github.io/easypy-lang/).
51
63
 
52
64
  ## 🤝 Contributing
53
65
 
@@ -8,6 +8,7 @@ import re
8
8
  class EasypyTranspiler:
9
9
  def __init__(self):
10
10
  self.indent_level = 0
11
+ self.context_stack = [] # Stack to track [class, func, other]
11
12
  self.in_block = False
12
13
  self.source_map = {} # Maps generated python line -> original ep line
13
14
 
@@ -160,6 +161,7 @@ class EasypyTranspiler:
160
161
  while raw_line.startswith("}"):
161
162
  self.indent_level -= 1
162
163
  if self.indent_level < 0: self.indent_level = 0
164
+ if self.context_stack: self.context_stack.pop()
163
165
  raw_line = raw_line[1:].strip()
164
166
 
165
167
  # If line was just "}", it is now empty. Return None to skip outputting a blank/garbage line.
@@ -212,19 +214,34 @@ class EasypyTranspiler:
212
214
  # 3. Functions
213
215
  if raw_line.startswith("func ") and raw_line.endswith("{"):
214
216
  defn = raw_line[5:-1].strip()
217
+
218
+ # Auto-inject 'self' if inside a class
219
+ if self.context_stack and self.context_stack[-1] == 'class':
220
+ parts = defn.split("(", 1)
221
+ name = parts[0]
222
+ args = parts[1][:-1] if len(parts) > 1 else ""
223
+
224
+ if args.strip():
225
+ defn = f"{name}(self, {args})"
226
+ else:
227
+ defn = f"{name}(self)"
228
+
215
229
  self.indent_level += 1
230
+ self.context_stack.append('func')
216
231
  return f"{indent}def {defn}:"
217
232
 
218
233
  # 3b. Async Functions
219
234
  if raw_line.startswith("async func ") and raw_line.endswith("{"):
220
235
  defn = raw_line[11:-1].strip()
221
236
  self.indent_level += 1
237
+ self.context_stack.append('func')
222
238
  return f"{indent}async def {defn}:"
223
239
 
224
240
  # 4. Classes
225
241
  if raw_line.startswith("class ") and raw_line.endswith("{"):
226
242
  defn = raw_line[6:-1].strip()
227
243
  self.indent_level += 1
244
+ self.context_stack.append('class')
228
245
  return f"{indent}class {defn}:"
229
246
 
230
247
  # 5. Logic
@@ -233,15 +250,18 @@ class EasypyTranspiler:
233
250
  # Handle if(x) vs if x
234
251
  if condition.startswith("(") and condition.endswith(")"): condition = condition
235
252
  self.indent_level += 1
253
+ self.context_stack.append('block')
236
254
  return f"{indent}if {condition}:"
237
255
 
238
256
  if raw_line.startswith("elif") and raw_line.endswith("{"):
239
257
  condition = raw_line[4:-1].strip()
240
258
  self.indent_level += 1
259
+ self.context_stack.append('block')
241
260
  return f"{indent}elif {condition}:"
242
261
 
243
262
  if raw_line.startswith("else") and raw_line.endswith("{"):
244
263
  self.indent_level += 1
264
+ self.context_stack.append('block')
245
265
  return f"{indent}else:"
246
266
 
247
267
  # 6. Loops
@@ -249,22 +269,26 @@ class EasypyTranspiler:
249
269
  if loop_match:
250
270
  count = loop_match.group(1)
251
271
  self.indent_level += 1
272
+ self.context_stack.append('block')
252
273
  return f"{indent}for _ in range({count}):"
253
274
 
254
275
  if raw_line.startswith("while") and raw_line.endswith("{"):
255
276
  condition = raw_line[5:-1].strip()
256
277
  self.indent_level += 1
278
+ self.context_stack.append('block')
257
279
  return f"{indent}while {condition}:"
258
280
 
259
281
  if raw_line.startswith("for ") and raw_line.endswith("{"):
260
282
  condition = raw_line[3:-1].strip()
261
283
  self.indent_level += 1
284
+ self.context_stack.append('block')
262
285
  return f"{indent}for {condition}:"
263
286
 
264
287
  # 7. Generic Block
265
288
  if raw_line.endswith("{"):
266
289
  clean_line = raw_line[:-1].strip()
267
290
  self.indent_level += 1
291
+ self.context_stack.append('block')
268
292
  return f"{indent}{clean_line}:"
269
293
 
270
294
  # 8. Standard Line
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: easypy-lang
3
- Version: 1.0.2
3
+ Version: 2.0.1
4
4
  Summary: A simple, powerful language for AI, ML, and apps - No coding experience needed!
5
5
  Home-page: https://github.com/VadikGoel/easypy-lang
6
6
  Author: Vadik Goel
@@ -41,12 +41,24 @@ Whether you want to build websites, analyze data, or create AI chatbots, Easypy
41
41
 
42
42
  ## 📦 Installation
43
43
 
44
- To get started, simply install the package via pip:
44
+ ### Option 1: Install via Pip (Recommended)
45
+ Simply install the package via pip:
45
46
 
46
47
  ```bash
47
48
  pip install easypy-lang
48
49
  ```
49
50
 
51
+ ### Option 2: Run via Docker (No Install Needed)
52
+ Don't want to install Python? Run Easypy directly in a container:
53
+
54
+ ```bash
55
+ # Pull the image
56
+ docker pull vadikgoel/easypy-lang
57
+
58
+ # Run interactive mode
59
+ docker run -it vadikgoel/easypy-lang
60
+ ```
61
+
50
62
  ## ✨ Features
51
63
 
52
64
  - **English-like Syntax**: Write code that reads like a story.
@@ -80,7 +92,7 @@ easypy hello.easy
80
92
 
81
93
  ## 📚 Documentation
82
94
 
83
- For full documentation, tutorials, and the interactive playground, please check the `docs/` folder included in the repository or visit our [GitHub Repository](https://github.com/VadikGoel/easypy-lang).
95
+ For full documentation, tutorials, and the interactive playground, please check the `docs/` folder included in the repository or visit our [Documentation](https://vadikgoel.github.io/easypy-lang/).
84
96
 
85
97
  ## 🤝 Contributing
86
98
 
@@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
5
5
 
6
6
  setup(
7
7
  name="easypy-lang",
8
- version="1.0.2",
8
+ version="2.0.1",
9
9
  author="Vadik Goel",
10
10
  author_email="vadikgoel1@gmail.com",
11
11
  description="A simple, powerful language for AI, ML, and apps - No coding experience needed!",
File without changes