easycoder 250211.1__py2.py3-none-any.whl → 250216.1__py2.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.
Potentially problematic release.
This version of easycoder might be problematic. Click here for more details.
- easycoder/__init__.py +1 -1
- easycoder/ec_compiler.py +5 -6
- easycoder/ec_condition.py +1 -0
- easycoder/ec_core.py +28 -10
- {easycoder-250211.1.dist-info → easycoder-250216.1.dist-info}/METADATA +2 -2
- {easycoder-250211.1.dist-info → easycoder-250216.1.dist-info}/RECORD +9 -9
- {easycoder-250211.1.dist-info → easycoder-250216.1.dist-info}/WHEEL +1 -1
- {easycoder-250211.1.dist-info → easycoder-250216.1.dist-info}/LICENSE +0 -0
- {easycoder-250211.1.dist-info → easycoder-250216.1.dist-info}/entry_points.txt +0 -0
easycoder/__init__.py
CHANGED
easycoder/ec_compiler.py
CHANGED
|
@@ -13,7 +13,6 @@ class Compiler:
|
|
|
13
13
|
self.tokens = self.script.tokens
|
|
14
14
|
self.symbols = self.program.symbols
|
|
15
15
|
self.code = self.program.code
|
|
16
|
-
self.warnings = []
|
|
17
16
|
self.program.compiler = self
|
|
18
17
|
self.addCommand = self.program.add
|
|
19
18
|
self.compileConstant = self.value.compileConstant
|
|
@@ -107,11 +106,10 @@ class Compiler:
|
|
|
107
106
|
def getSymbolRecord(self):
|
|
108
107
|
token = self.getToken()
|
|
109
108
|
symbol = self.symbols[token]
|
|
110
|
-
if symbol
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
return None
|
|
109
|
+
if symbol == None: return None
|
|
110
|
+
symbolRecord = self.code[symbol]
|
|
111
|
+
symbolRecord['used'] = True
|
|
112
|
+
return symbolRecord
|
|
115
113
|
|
|
116
114
|
def compileLabel(self, command):
|
|
117
115
|
return self.compileSymbol(command, self.getToken(), False)
|
|
@@ -144,6 +142,7 @@ class Compiler:
|
|
|
144
142
|
|
|
145
143
|
# Compile the current token
|
|
146
144
|
def compileToken(self):
|
|
145
|
+
self.warnings = []
|
|
147
146
|
token = self.getToken()
|
|
148
147
|
# print(f'Compile {token}')
|
|
149
148
|
if not token:
|
easycoder/ec_condition.py
CHANGED
easycoder/ec_core.py
CHANGED
|
@@ -703,14 +703,21 @@ class Core(Handler):
|
|
|
703
703
|
command['file'] = self.nextValue()
|
|
704
704
|
self.add(command)
|
|
705
705
|
return True
|
|
706
|
+
else:
|
|
707
|
+
FatalError(self.program.compiler, f'I don\'t understand \'{self.getToken()}\'')
|
|
706
708
|
return False
|
|
707
709
|
|
|
708
710
|
def r_load(self, command):
|
|
709
711
|
target = self.getVariable(command['target'])
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
712
|
+
filename = self.getRuntimeValue(command['file'])
|
|
713
|
+
try:
|
|
714
|
+
with open(filename) as f: content = f.read()
|
|
715
|
+
except:
|
|
716
|
+
RuntimeError(self.program, f'File \'{filename}\' not found')
|
|
717
|
+
try:
|
|
718
|
+
if filename.endswith('.json'): content = json.loads(content)
|
|
719
|
+
except:
|
|
720
|
+
RuntimeError(self.program, 'Bad or null JSON string')
|
|
714
721
|
value = {}
|
|
715
722
|
value['type'] = 'text'
|
|
716
723
|
value['content'] = content
|
|
@@ -1218,10 +1225,9 @@ class Core(Handler):
|
|
|
1218
1225
|
|
|
1219
1226
|
def r_save(self, command):
|
|
1220
1227
|
content = self.getRuntimeValue(command['content'])
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
f.write(content)
|
|
1224
|
-
f.close()
|
|
1228
|
+
filename = self.getRuntimeValue(command['file'])
|
|
1229
|
+
if filename.endswith('.json'): content = json.dumps(content)
|
|
1230
|
+
with open(filename, 'w') as f: f.write(content)
|
|
1225
1231
|
return self.nextPC()
|
|
1226
1232
|
|
|
1227
1233
|
# Send a message to a module
|
|
@@ -2375,6 +2381,7 @@ class Core(Handler):
|
|
|
2375
2381
|
# Compile a condition
|
|
2376
2382
|
def compileCondition(self):
|
|
2377
2383
|
condition = Condition()
|
|
2384
|
+
|
|
2378
2385
|
if self.getToken() == 'not':
|
|
2379
2386
|
condition.type = 'not'
|
|
2380
2387
|
condition.value = self.nextValue()
|
|
@@ -2406,6 +2413,18 @@ class Core(Handler):
|
|
|
2406
2413
|
return condition
|
|
2407
2414
|
return None
|
|
2408
2415
|
|
|
2416
|
+
if token == 'does':
|
|
2417
|
+
self.nextToken()
|
|
2418
|
+
if self.nextIs('not'):
|
|
2419
|
+
if self.nextIs('have'):
|
|
2420
|
+
if self.nextToken() == 'property':
|
|
2421
|
+
prop = self.nextValue()
|
|
2422
|
+
condition.type = 'hasProperty'
|
|
2423
|
+
condition.property = prop
|
|
2424
|
+
condition.negate = not condition.negate
|
|
2425
|
+
return condition
|
|
2426
|
+
return None
|
|
2427
|
+
|
|
2409
2428
|
if token in ['starts', 'ends']:
|
|
2410
2429
|
self.nextToken()
|
|
2411
2430
|
if self.nextToken() == 'with':
|
|
@@ -2498,7 +2517,7 @@ class Core(Handler):
|
|
|
2498
2517
|
hasProp = True
|
|
2499
2518
|
except:
|
|
2500
2519
|
hasProp = False
|
|
2501
|
-
return hasProp
|
|
2520
|
+
return not hasProp if condition.negate else hasProp
|
|
2502
2521
|
|
|
2503
2522
|
def c_includes(self, condition):
|
|
2504
2523
|
value1 = self.getRuntimeValue(condition.value1)
|
|
@@ -2543,4 +2562,3 @@ class Core(Handler):
|
|
|
2543
2562
|
def c_string(self, condition):
|
|
2544
2563
|
comparison = type(self.getRuntimeValue(condition.value1)) is str
|
|
2545
2564
|
return not comparison if condition.negate else comparison
|
|
2546
|
-
# xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
2
|
Name: easycoder
|
|
3
|
-
Version:
|
|
3
|
+
Version: 250216.1
|
|
4
4
|
Summary: Rapid scripting in English
|
|
5
5
|
Keywords: compiler,scripting,prototyping,programming,coding,python,low code,hypertalk,computer language,learn to code
|
|
6
6
|
Author-email: Graham Trott <gtanyware@gmail.com>
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
easycoder/README.md,sha256=BVXmYphcTJ6q6RN_9L6HtQukgCnOjSLVIsTM3lk-9aM,587
|
|
2
|
-
easycoder/__init__.py,sha256=-
|
|
2
|
+
easycoder/__init__.py,sha256=-pc2f7yBRNQSVv_vxSCGD8fzrKymQryhZ04rM0h58e0,262
|
|
3
3
|
easycoder/ec_classes.py,sha256=xnWBNak8oKydkFoxHLlq9wo3lIsB3aMnTDrqbtCfoWo,1512
|
|
4
|
-
easycoder/ec_compiler.py,sha256=
|
|
5
|
-
easycoder/ec_condition.py,sha256=
|
|
6
|
-
easycoder/ec_core.py,sha256=
|
|
4
|
+
easycoder/ec_compiler.py,sha256=rtxFEWnhW0550MtWEDvYHOw9cYkeTcR0oG3t-kmgnBk,4795
|
|
5
|
+
easycoder/ec_condition.py,sha256=YXvSBQKEzKGCcgUGo3Qp8iHolXmm2BpEm0NimSDszIM,785
|
|
6
|
+
easycoder/ec_core.py,sha256=a3MEos2gaMre263Qgh_xyrTGYji5IZa1H-9wauHxtUI,88558
|
|
7
7
|
easycoder/ec_graphics.py,sha256=K44SbPb81KBGCe4wpl6VR4lt93AAGOZysFO2tkUuilY,13380
|
|
8
8
|
easycoder/ec_gutils.py,sha256=BHDsRgXR5XTO2nYhdBbC4OQW-9xU0czyFyee0tZ595E,6096
|
|
9
9
|
easycoder/ec_handler.py,sha256=IJvxcrJJSR53d6DS_8H5qPHKhp9y5-GV4WXAjhZxu_o,2250
|
|
10
10
|
easycoder/ec_program.py,sha256=BDwU7aGHiaw6WdbQvVFDhGVaHsvwQ1CWa4wb5MPmOe8,10013
|
|
11
11
|
easycoder/ec_timestamp.py,sha256=_3QFJPzIWZ9Rzk3SQOQJ-gwmvB07pg78k23SPntoZtY,288
|
|
12
12
|
easycoder/ec_value.py,sha256=zgDJTJhIg3yOvmnnKIfccIizmIhGbtvL_ghLTL1T5fg,2516
|
|
13
|
-
easycoder-
|
|
14
|
-
easycoder-
|
|
15
|
-
easycoder-
|
|
16
|
-
easycoder-
|
|
17
|
-
easycoder-
|
|
13
|
+
easycoder-250216.1.dist-info/entry_points.txt,sha256=JXAZbenl0TnsIft2FcGJbJ-4qoztVu2FuT8PFmWFexM,44
|
|
14
|
+
easycoder-250216.1.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
15
|
+
easycoder-250216.1.dist-info/WHEEL,sha256=ssQ84EZ5gH1pCOujd3iW7HClo_O_aDaClUbX4B8bjKY,100
|
|
16
|
+
easycoder-250216.1.dist-info/METADATA,sha256=8_9eLSJjEnzrZqAFyrzIgfkA78HaLkQu2zF976W3zBY,6162
|
|
17
|
+
easycoder-250216.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|