easycoder 241211.3__py2.py3-none-any.whl → 250116.3__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/README.md +6 -0
- easycoder/__init__.py +1 -1
- easycoder/ec_classes.py +3 -0
- easycoder/ec_compiler.py +11 -7
- easycoder/ec_core.py +493 -208
- easycoder/ec_graphics.py +274 -0
- easycoder/ec_gutils.py +52 -0
- easycoder/ec_handler.py +1 -0
- easycoder/ec_program.py +156 -79
- easycoder/ec_value.py +21 -14
- easycoder-250116.3.dist-info/METADATA +116 -0
- easycoder-250116.3.dist-info/RECORD +17 -0
- {easycoder-241211.3.dist-info → easycoder-250116.3.dist-info}/WHEEL +1 -1
- easycoder-241211.3.dist-info/METADATA +0 -72
- easycoder-241211.3.dist-info/RECORD +0 -14
- {easycoder-241211.3.dist-info → easycoder-250116.3.dist-info}/LICENSE +0 -0
- {easycoder-241211.3.dist-info → easycoder-250116.3.dist-info}/entry_points.txt +0 -0
easycoder/README.md
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# EasyCode source code
|
|
2
|
+
These are the Python files that comprise **_EasyCoder_**.
|
|
3
|
+
|
|
4
|
+
**_EasyCoder_** has a small number of third-party dependencies. A minor one is `pytz`, which handles timezones. The biggest one by far is `kivy`, a comprehensive Python graphics library.
|
|
5
|
+
|
|
6
|
+
If an **_EasyCoder_** script filename ends with `.ecs` it's a command-line script. If it ends with `.ecg` it's a script for a graphical application and will cause `kivy` to be imported. Obviously this will only work on a GUI-based system, whereas command-line scripts will run anywhere there is Python.
|
easycoder/__init__.py
CHANGED
easycoder/ec_classes.py
CHANGED
easycoder/ec_compiler.py
CHANGED
|
@@ -16,6 +16,7 @@ class Compiler:
|
|
|
16
16
|
self.warnings = []
|
|
17
17
|
self.program.compiler = self
|
|
18
18
|
self.addCommand = self.program.add
|
|
19
|
+
self.compileConstant = self.value.compileConstant
|
|
19
20
|
|
|
20
21
|
def getPC(self):
|
|
21
22
|
return len(self.program.code)
|
|
@@ -44,6 +45,11 @@ class Compiler:
|
|
|
44
45
|
except:
|
|
45
46
|
return None
|
|
46
47
|
|
|
48
|
+
# Get a constant
|
|
49
|
+
def getConstant(self, token):
|
|
50
|
+
self.index += 1
|
|
51
|
+
return self.compileConstant(token)
|
|
52
|
+
|
|
47
53
|
# Get a value
|
|
48
54
|
def getValue(self):
|
|
49
55
|
return self.value.compileValue()
|
|
@@ -53,11 +59,6 @@ class Compiler:
|
|
|
53
59
|
self.index += 1
|
|
54
60
|
return self.value.compileValue()
|
|
55
61
|
|
|
56
|
-
# Get a constant
|
|
57
|
-
def getConstant(self, token):
|
|
58
|
-
self.index += 1
|
|
59
|
-
return self.value.compileConstant(token)
|
|
60
|
-
|
|
61
62
|
# Get a condition
|
|
62
63
|
def getCondition(self):
|
|
63
64
|
return self.condition.compileCondition()
|
|
@@ -97,11 +98,11 @@ class Compiler:
|
|
|
97
98
|
return self.tokens[self.index].lino
|
|
98
99
|
|
|
99
100
|
def warning(self, message):
|
|
100
|
-
self.warnings.append(message)
|
|
101
|
+
self.warnings.append(f'Warning at line {self.getLino() + 1} of {self.program.name}: {message}')
|
|
101
102
|
|
|
102
103
|
def showWarnings(self):
|
|
103
104
|
for warning in self.warnings:
|
|
104
|
-
print(
|
|
105
|
+
print(warning)
|
|
105
106
|
|
|
106
107
|
def getSymbolRecord(self):
|
|
107
108
|
token = self.getToken()
|
|
@@ -127,6 +128,7 @@ class Compiler:
|
|
|
127
128
|
FatalError(self, f'Duplicate symbol name "{name}"')
|
|
128
129
|
return False
|
|
129
130
|
self.symbols[name] = self.getPC()
|
|
131
|
+
command['program'] = self.program
|
|
130
132
|
command['type'] = 'symbol'
|
|
131
133
|
command['valueHolder'] = valueHolder
|
|
132
134
|
command['name'] = name
|
|
@@ -135,6 +137,8 @@ class Compiler:
|
|
|
135
137
|
command['value'] = [None]
|
|
136
138
|
command['used'] = False
|
|
137
139
|
command['debug'] = False
|
|
140
|
+
command['import'] = None
|
|
141
|
+
command['locked'] = False
|
|
138
142
|
self.addCommand(command)
|
|
139
143
|
return True
|
|
140
144
|
|