easycoder 251104.1__py2.py3-none-any.whl → 251215.2__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.
- easycoder/__init__.py +4 -2
- easycoder/debugger/__init__.py +5 -0
- easycoder/debugger/ec_dbg_value_display copy.py +195 -0
- easycoder/debugger/ec_dbg_value_display.py +23 -0
- easycoder/debugger/ec_dbg_watch_list copy.py +219 -0
- easycoder/debugger/ec_dbg_watchlist.py +159 -0
- easycoder/debugger/ec_debug.py +948 -0
- easycoder/ec_border.py +15 -11
- easycoder/ec_classes.py +285 -7
- easycoder/ec_compiler.py +56 -39
- easycoder/ec_condition.py +1 -1
- easycoder/ec_core.py +848 -1016
- easycoder/ec_gclasses.py +225 -0
- easycoder/{ec_pyside.py → ec_graphics.py} +614 -492
- easycoder/ec_handler.py +16 -12
- easycoder/ec_keyboard.py +50 -50
- easycoder/ec_program.py +279 -151
- easycoder/ec_psutil.py +48 -0
- easycoder/ec_timestamp.py +2 -1
- easycoder/ec_value.py +29 -32
- easycoder/icons/exit.png +0 -0
- easycoder/icons/run.png +0 -0
- easycoder/icons/step.png +0 -0
- easycoder/icons/stop.png +0 -0
- {easycoder-251104.1.dist-info → easycoder-251215.2.dist-info}/METADATA +11 -1
- easycoder-251215.2.dist-info/RECORD +31 -0
- easycoder-251104.1.dist-info/RECORD +0 -19
- /easycoder/{close.png → icons/close.png} +0 -0
- /easycoder/{tick.png → icons/tick.png} +0 -0
- {easycoder-251104.1.dist-info → easycoder-251215.2.dist-info}/WHEEL +0 -0
- {easycoder-251104.1.dist-info → easycoder-251215.2.dist-info}/entry_points.txt +0 -0
- {easycoder-251104.1.dist-info → easycoder-251215.2.dist-info}/licenses/LICENSE +0 -0
easycoder/ec_value.py
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
from .ec_classes import FatalError
|
|
1
|
+
from .ec_classes import ECObject, FatalError, ECValue
|
|
2
2
|
|
|
3
3
|
# Create a constant
|
|
4
4
|
def getConstant(str):
|
|
5
|
-
|
|
6
|
-
value['type'] = 'text'
|
|
7
|
-
value['content'] = str
|
|
8
|
-
return value
|
|
5
|
+
return ECValue(type='str', content=str)
|
|
9
6
|
|
|
10
7
|
class Value:
|
|
11
8
|
|
|
@@ -21,23 +18,20 @@ class Value:
|
|
|
21
18
|
if not token:
|
|
22
19
|
return None
|
|
23
20
|
|
|
24
|
-
value =
|
|
21
|
+
value = ECValue()
|
|
25
22
|
|
|
26
23
|
if token == 'true':
|
|
27
|
-
value
|
|
28
|
-
value['content'] = True
|
|
24
|
+
value.setValue('boolean', True)
|
|
29
25
|
return value
|
|
30
26
|
|
|
31
27
|
if token == 'false':
|
|
32
|
-
value
|
|
33
|
-
value['content'] = False
|
|
28
|
+
value.setValue('boolean', False)
|
|
34
29
|
return value
|
|
35
30
|
|
|
36
31
|
# Check for a string constant
|
|
37
32
|
if token[0] == '`':
|
|
38
33
|
if token[len(token) - 1] == '`':
|
|
39
|
-
value
|
|
40
|
-
value['content'] = token[1 : len(token) - 1]
|
|
34
|
+
value.setValue(type='str', content=token[1 : len(token) - 1])
|
|
41
35
|
return value
|
|
42
36
|
FatalError(self.compiler, f'Unterminated string "{token}"')
|
|
43
37
|
return None
|
|
@@ -46,8 +40,7 @@ class Value:
|
|
|
46
40
|
if token.isnumeric() or (token[0] == '-' and token[1:].isnumeric):
|
|
47
41
|
val = eval(token)
|
|
48
42
|
if isinstance(val, int):
|
|
49
|
-
value
|
|
50
|
-
value['content'] = val
|
|
43
|
+
value.setValue('int', val)
|
|
51
44
|
return value
|
|
52
45
|
FatalError(self.compiler, f'{token} is not an integer')
|
|
53
46
|
|
|
@@ -55,30 +48,37 @@ class Value:
|
|
|
55
48
|
mark = self.compiler.getIndex()
|
|
56
49
|
for domain in self.compiler.program.getDomains():
|
|
57
50
|
item = domain.compileValue()
|
|
58
|
-
if item != None:
|
|
59
|
-
return item
|
|
51
|
+
if item != None: return item
|
|
60
52
|
self.compiler.rewindTo(mark)
|
|
61
53
|
# self.compiler.warning(f'I don\'t understand \'{token}\'')
|
|
62
54
|
return None
|
|
63
55
|
|
|
56
|
+
# Compile a value
|
|
64
57
|
def compileValue(self):
|
|
65
58
|
token = self.getToken()
|
|
66
59
|
item = self.getItem()
|
|
67
60
|
if item == None:
|
|
68
61
|
self.compiler.warning(f'ec_value.compileValue: Cannot get the value of "{token}"')
|
|
69
62
|
return None
|
|
63
|
+
if item.getType() == 'symbol':
|
|
64
|
+
object = self.compiler.getSymbolRecord(item.getContent())['object']
|
|
65
|
+
if not object.hasRuntimeValue(): return None
|
|
70
66
|
|
|
71
|
-
value =
|
|
67
|
+
value = ECValue()
|
|
72
68
|
if self.peek() == 'cat':
|
|
73
|
-
|
|
74
|
-
value
|
|
75
|
-
|
|
69
|
+
items = None
|
|
70
|
+
if value.getType() == 'cat': items = value.getContent()
|
|
71
|
+
else:
|
|
72
|
+
value.setType('cat')
|
|
73
|
+
items = [item]
|
|
74
|
+
value.setContent(items)
|
|
76
75
|
while self.peek() == 'cat':
|
|
77
|
-
self.nextToken()
|
|
78
|
-
self.nextToken()
|
|
79
|
-
|
|
80
|
-
if
|
|
81
|
-
|
|
76
|
+
v = self.nextToken()
|
|
77
|
+
v= self.nextToken()
|
|
78
|
+
element = self.getItem()
|
|
79
|
+
if element != None:
|
|
80
|
+
items.append(element) # pyright: ignore[reportOptionalMemberAccess]
|
|
81
|
+
value.setContent(items)
|
|
82
82
|
else:
|
|
83
83
|
value = item
|
|
84
84
|
|
|
@@ -89,17 +89,14 @@ class Value:
|
|
|
89
89
|
return value
|
|
90
90
|
|
|
91
91
|
def compileConstant(self, token):
|
|
92
|
-
value =
|
|
92
|
+
value = ECValue()
|
|
93
93
|
if type(token) == 'str':
|
|
94
94
|
token = eval(token)
|
|
95
95
|
if isinstance(token, int):
|
|
96
|
-
value
|
|
97
|
-
value['content'] = token
|
|
96
|
+
value.setValue(type='int', content=token)
|
|
98
97
|
return value
|
|
99
98
|
if isinstance(token, float):
|
|
100
|
-
value
|
|
101
|
-
value['content'] = token
|
|
99
|
+
value.setValue(type='float', content=token)
|
|
102
100
|
return value
|
|
103
|
-
value
|
|
104
|
-
value['content'] = token
|
|
101
|
+
value.setValue(type='str', content=token)
|
|
105
102
|
return value
|
easycoder/icons/exit.png
ADDED
|
Binary file
|
easycoder/icons/run.png
ADDED
|
Binary file
|
easycoder/icons/step.png
ADDED
|
Binary file
|
easycoder/icons/stop.png
ADDED
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: easycoder
|
|
3
|
-
Version:
|
|
3
|
+
Version: 251215.2
|
|
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>
|
|
@@ -108,9 +108,19 @@ Here in the repository is a folder called `scripts` containing some sample scrip
|
|
|
108
108
|
|
|
109
109
|
**_EasyCoder_** comprises a set of modules to handle tokenisation, compilation and runtime control. Syntax and grammar are defined by [packages](doc/README.md), of which there are currently two; the [core](doc/core/README.md) package, which implements a comprehensive set of command-line programming features, and and the [graphics](doc/graphics/README.md) package, which adds graphical features in a windowing environment.
|
|
110
110
|
|
|
111
|
+
See also [How it works](doc/README.md)
|
|
112
|
+
|
|
111
113
|
## Extending the language
|
|
112
114
|
|
|
113
115
|
**_EasyCoder_** can be extended to add new functionality with the use of 'plugins'. These contain compiler and runtime modules for the added language features. **_EasyCoder_** can use the added keywords, values and conditions freely; the effect is completely seamless. There is an outline example in the `plugins` directory called `example.py`, which comprises a module called `Points` with new language syntax to deal with two-valued items such as coordinates. In the `scripts` directory there is `points.ecs`, which exercises the new functionality.
|
|
114
116
|
|
|
115
117
|
A plugin can act as a wrapper around any Python functionality that has a sensible API, thereby hiding its complexity. The only challenge is to devise an unambiguous syntax that doesn't clash with anything already existing in **_EasyCoder_**.
|
|
116
118
|
|
|
119
|
+
## Contributing
|
|
120
|
+
|
|
121
|
+
We welcome contributions to EasyCoder-py! Please see our [CONTRIBUTING.md](CONTRIBUTING.md) guide for:
|
|
122
|
+
- Getting started with development
|
|
123
|
+
- How to work with Git branches and merge changes
|
|
124
|
+
- Resolving merge conflicts
|
|
125
|
+
- Testing and submitting pull requests
|
|
126
|
+
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
easycoder/__init__.py,sha256=MWdGgcAbY8UfvDL1XPHwuh_6HkKILS3mVQlXd_eGBBo,393
|
|
2
|
+
easycoder/ec_border.py,sha256=2qgGYxB-tIk_ZM0CmW3Yt7TotlUwxwrN9fL3cCvn8eE,2599
|
|
3
|
+
easycoder/ec_classes.py,sha256=wuw2cXazP_KPWpYq8qnhtobLPKSciNGjd8ch7LMxHE8,10614
|
|
4
|
+
easycoder/ec_compiler.py,sha256=x1yDX3_bB2W_FCLRqwmDqx8SDrSKNGDf6ex8WLs66xs,7104
|
|
5
|
+
easycoder/ec_condition.py,sha256=BU59phivUDEAjmhBZTVziJ510MswXAPV1kMTa2I8QoQ,785
|
|
6
|
+
easycoder/ec_core.py,sha256=asIzncTUjLmke45Bh6YYGEGMOAQsnLz6DKNQjE7aQeE,99746
|
|
7
|
+
easycoder/ec_gclasses.py,sha256=BwjsmexEgvfCZTf4C77e1PU_Pe2vsp1B-P7TLzdfcIg,6454
|
|
8
|
+
easycoder/ec_graphics.py,sha256=xY9Q52bPnrp_fp6g6bS45MPenCvCpg-EcU1twC8u21U,66364
|
|
9
|
+
easycoder/ec_handler.py,sha256=kpLquY2ztvNDV-xXDweaMg7r_HERRmlKaG6unkFggmA,2625
|
|
10
|
+
easycoder/ec_keyboard.py,sha256=R6JvgUwvgj4pJiGwXbPrFmhC-DSxJbZQnPQ9pzabrMM,19705
|
|
11
|
+
easycoder/ec_program.py,sha256=Gf2G1fafRcoIV0nihg5W_ds9KdL-cZaBbFGeCGX_CLI,15470
|
|
12
|
+
easycoder/ec_psutil.py,sha256=PpbwUD2LjwxDUmsyvfyT-M-Gw1fJVYYLIJ6OKdgNcG4,1545
|
|
13
|
+
easycoder/ec_timestamp.py,sha256=z-HonUY7BDjgVVf2W_qQynnFjwGc_dAYultFjAmrXpg,307
|
|
14
|
+
easycoder/ec_value.py,sha256=UuMosa3xz0PMPStdhKJq8PF2A696tM1MHYz_vQigGYE,2748
|
|
15
|
+
easycoder/debugger/__init__.py,sha256=qWN02-1SoiXHCn85B_AQ7NCS8sNVvnXoAZTWpDFCvcs,88
|
|
16
|
+
easycoder/debugger/ec_dbg_value_display copy.py,sha256=g0gLrzwJgxOFTljPDSdo9BUqNSPMB5wkAc2YG4EAhro,7507
|
|
17
|
+
easycoder/debugger/ec_dbg_value_display.py,sha256=Y4A9rcDXHJXEjlG4lHnrrq8Ou-DJ3rteAskzjRw6dKY,577
|
|
18
|
+
easycoder/debugger/ec_dbg_watch_list copy.py,sha256=ul294vjdApBVEWkfB3T5YZUjNAKoLXjmraklpmSRt90,10323
|
|
19
|
+
easycoder/debugger/ec_dbg_watchlist.py,sha256=Oevp0BffX1_7iTDQXSrxjEUkzMUflWow8B5-i55XRgU,5650
|
|
20
|
+
easycoder/debugger/ec_debug.py,sha256=oTnyG0gVxQORJlvJ61qWPgGiMG-WeQLoia1ciWiWECc,38629
|
|
21
|
+
easycoder/icons/close.png,sha256=3B9ueRNtEu9E4QNmZhdyC4VL6uqKvGmdfeFxIV9aO_Y,9847
|
|
22
|
+
easycoder/icons/exit.png,sha256=mVQQhMQQfboJTf4p11S0TR-8qwLgO9cFaCDxf20SsfI,3408
|
|
23
|
+
easycoder/icons/run.png,sha256=5hDyMPMlY9ypA_rR5gqM5hb4vGIg2A4_pcEmPCq0iaM,3937
|
|
24
|
+
easycoder/icons/step.png,sha256=r4XW-2GBVrYm7kb-xvth7jHMX3g9Ge-3onfpdOHyhyE,8224
|
|
25
|
+
easycoder/icons/stop.png,sha256=MoK6EbWFxDBdCH_ojTehjb7ty_Ax27n-8fKK_yBonfs,1832
|
|
26
|
+
easycoder/icons/tick.png,sha256=OedASXJJTYvnza4J6Kv5m5lz6DrBfy667zX_WGgtbmM,9127
|
|
27
|
+
easycoder-251215.2.dist-info/entry_points.txt,sha256=JXAZbenl0TnsIft2FcGJbJ-4qoztVu2FuT8PFmWFexM,44
|
|
28
|
+
easycoder-251215.2.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
29
|
+
easycoder-251215.2.dist-info/WHEEL,sha256=Dyt6SBfaasWElUrURkknVFAZDHSTwxg3PaTza7RSbkY,100
|
|
30
|
+
easycoder-251215.2.dist-info/METADATA,sha256=O1Ro2zkq9xCrNl4LBc0mh7fAAM-qCyTESy3HG96a6AE,7210
|
|
31
|
+
easycoder-251215.2.dist-info/RECORD,,
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
easycoder/__init__.py,sha256=7ZoWrgGr2R_dOw69Yis1-y0u8zR8AAQ24gN0GpfM5rc,339
|
|
2
|
-
easycoder/close.png,sha256=3B9ueRNtEu9E4QNmZhdyC4VL6uqKvGmdfeFxIV9aO_Y,9847
|
|
3
|
-
easycoder/ec_border.py,sha256=KpOy0Jq8jI_6DYGo4jaFvoBP_jTIoAYWrmuHhl-FXA4,2355
|
|
4
|
-
easycoder/ec_classes.py,sha256=YGUiKnVN6T5scoeBmmGDQAtE8xJgaTHi0Exh9A7H2Y4,1750
|
|
5
|
-
easycoder/ec_compiler.py,sha256=2bdB7Bb4Cn_Uj7g0wjDn_gO0gQivqeaFellbgbAT2Hg,6587
|
|
6
|
-
easycoder/ec_condition.py,sha256=uamZrlW3Ej3R4bPDuduGB2f00M80Z1D0qV8muDx4Qfw,784
|
|
7
|
-
easycoder/ec_core.py,sha256=K89KR1z_clnubQgq_-L3SiTTRI4qs2ue1MhuUkB9xoU,100888
|
|
8
|
-
easycoder/ec_handler.py,sha256=doGCMXBCQxvSaD3omKMlXoR_LvQODxV7dZyoWafecyg,2336
|
|
9
|
-
easycoder/ec_keyboard.py,sha256=H8DhPT8-IvAIGgRxCs4qSaF_AQLaS6lxxtDteejbktM,19010
|
|
10
|
-
easycoder/ec_program.py,sha256=aPuZOYWFqGd1jsLDl5M5YmLu5LfFAewF9EZh6zHIbyM,10308
|
|
11
|
-
easycoder/ec_pyside.py,sha256=DwHMsk5kDBXg8feSbkyUinGWPO1a4uH-rcT3F9J4Aiw,58287
|
|
12
|
-
easycoder/ec_timestamp.py,sha256=myQnnF-mT31_1dpQKv2VEAu4BCcbypvMdzq7_DUi1xc,277
|
|
13
|
-
easycoder/ec_value.py,sha256=zgDJTJhIg3yOvmnnKIfccIizmIhGbtvL_ghLTL1T5fg,2516
|
|
14
|
-
easycoder/tick.png,sha256=OedASXJJTYvnza4J6Kv5m5lz6DrBfy667zX_WGgtbmM,9127
|
|
15
|
-
easycoder-251104.1.dist-info/entry_points.txt,sha256=JXAZbenl0TnsIft2FcGJbJ-4qoztVu2FuT8PFmWFexM,44
|
|
16
|
-
easycoder-251104.1.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
17
|
-
easycoder-251104.1.dist-info/WHEEL,sha256=Dyt6SBfaasWElUrURkknVFAZDHSTwxg3PaTza7RSbkY,100
|
|
18
|
-
easycoder-251104.1.dist-info/METADATA,sha256=jWlzWZY1kVcRNkxMiIn6SGBsgK3UESTSnMhp8KlG064,6897
|
|
19
|
-
easycoder-251104.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|