easycoder 251104.2__py2.py3-none-any.whl → 260110.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.

Files changed (60) hide show
  1. easycoder/__init__.py +5 -3
  2. easycoder/debugger/__init__.py +5 -0
  3. easycoder/debugger/ec_dbg_value_display copy.py +195 -0
  4. easycoder/debugger/ec_dbg_value_display.py +24 -0
  5. easycoder/debugger/ec_dbg_watch_list copy.py +219 -0
  6. easycoder/debugger/ec_dbg_watchlist.py +293 -0
  7. easycoder/debugger/ec_debug.py +1025 -0
  8. easycoder/ec_border.py +15 -11
  9. easycoder/ec_classes.py +487 -11
  10. easycoder/ec_compiler.py +81 -44
  11. easycoder/ec_condition.py +1 -1
  12. easycoder/ec_core.py +1044 -1090
  13. easycoder/ec_gclasses.py +236 -0
  14. easycoder/ec_graphics.py +1683 -0
  15. easycoder/ec_handler.py +18 -13
  16. easycoder/ec_keyboard.py +50 -50
  17. easycoder/ec_program.py +299 -156
  18. easycoder/ec_psutil.py +48 -0
  19. easycoder/ec_timestamp.py +2 -1
  20. easycoder/ec_value.py +65 -47
  21. easycoder/icons/exit.png +0 -0
  22. easycoder/icons/run.png +0 -0
  23. easycoder/icons/step.png +0 -0
  24. easycoder/icons/stop.png +0 -0
  25. easycoder/pre/README.md +3 -0
  26. easycoder/pre/__init__.py +17 -0
  27. easycoder/pre/debugger/__init__.py +5 -0
  28. easycoder/pre/debugger/ec_dbg_value_display copy.py +195 -0
  29. easycoder/pre/debugger/ec_dbg_value_display.py +24 -0
  30. easycoder/pre/debugger/ec_dbg_watch_list copy.py +219 -0
  31. easycoder/pre/debugger/ec_dbg_watchlist.py +293 -0
  32. easycoder/pre/debugger/ec_debug.py +1014 -0
  33. easycoder/pre/ec_border.py +67 -0
  34. easycoder/pre/ec_classes.py +470 -0
  35. easycoder/pre/ec_compiler.py +291 -0
  36. easycoder/pre/ec_condition.py +27 -0
  37. easycoder/pre/ec_core.py +2772 -0
  38. easycoder/pre/ec_gclasses.py +230 -0
  39. easycoder/{ec_pyside.py → pre/ec_graphics.py} +631 -496
  40. easycoder/pre/ec_handler.py +79 -0
  41. easycoder/pre/ec_keyboard.py +439 -0
  42. easycoder/pre/ec_program.py +557 -0
  43. easycoder/pre/ec_psutil.py +48 -0
  44. easycoder/pre/ec_timestamp.py +11 -0
  45. easycoder/pre/ec_value.py +124 -0
  46. easycoder/pre/icons/close.png +0 -0
  47. easycoder/pre/icons/exit.png +0 -0
  48. easycoder/pre/icons/run.png +0 -0
  49. easycoder/pre/icons/step.png +0 -0
  50. easycoder/pre/icons/stop.png +0 -0
  51. easycoder/pre/icons/tick.png +0 -0
  52. {easycoder-251104.2.dist-info → easycoder-260110.1.dist-info}/METADATA +11 -1
  53. easycoder-260110.1.dist-info/RECORD +58 -0
  54. easycoder/ec_debug.py +0 -464
  55. easycoder-251104.2.dist-info/RECORD +0 -20
  56. /easycoder/{close.png → icons/close.png} +0 -0
  57. /easycoder/{tick.png → icons/tick.png} +0 -0
  58. {easycoder-251104.2.dist-info → easycoder-260110.1.dist-info}/WHEEL +0 -0
  59. {easycoder-251104.2.dist-info → easycoder-260110.1.dist-info}/entry_points.txt +0 -0
  60. {easycoder-251104.2.dist-info → easycoder-260110.1.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,124 @@
1
+ from typing import Optional, List
2
+ from .ec_classes import ECObject, FatalError, ECValue
3
+
4
+ # Create a constant
5
+ def getConstant(str):
6
+ return ECValue(type=str, content=str)
7
+
8
+ class Value:
9
+
10
+ def __init__(self, compiler):
11
+ self.compiler = compiler
12
+ self.getToken = compiler.getToken
13
+ self.nextToken = compiler.nextToken
14
+ self.peek = compiler.peek
15
+ self.skip = compiler.skip
16
+ self.tokenIs = compiler.tokenIs
17
+
18
+ def getItem(self) -> Optional[ECValue]:
19
+ token = self.getToken()
20
+ if not token:
21
+ return None
22
+
23
+ value = ECValue()
24
+
25
+ if token == 'true':
26
+ value.setValue(bool, True)
27
+ return value
28
+
29
+ if token == 'false':
30
+ value.setValue(bool, False)
31
+ return value
32
+
33
+ # Check for a string constant
34
+ if token[0] == '`':
35
+ if token[len(token) - 1] == '`':
36
+ value.setValue(type=str, content=token[1 : len(token) - 1])
37
+ return value
38
+ FatalError(self.compiler, f'Unterminated string "{token}"')
39
+ return None
40
+
41
+ # Check for a numeric constant
42
+ if token.isnumeric() or (token[0] == '-' and token[1:].isnumeric):
43
+ val = eval(token)
44
+ if isinstance(val, int):
45
+ value.setValue(int, val)
46
+ return value
47
+ FatalError(self.compiler, f'{token} is not an integer')
48
+
49
+ # See if any of the domains can handle it
50
+ mark = self.compiler.getIndex()
51
+ for domain in self.compiler.program.getDomains():
52
+ item = domain.compileValue()
53
+ if item != None: return item
54
+ self.compiler.rewindTo(mark)
55
+ # self.compiler.warning(f'I don\'t understand \'{token}\'')
56
+ return None
57
+
58
+ # Get a list of items following 'the cat of ...'
59
+ def getCatItems(self) -> Optional[List[ECValue]]:
60
+ items: List[ECValue] = []
61
+ item = self.getItem()
62
+ if item == None: return None
63
+ items.append(item)
64
+ while self.peek() in ['cat', 'and']:
65
+ self.nextToken()
66
+ self.nextToken()
67
+ element = self.getItem()
68
+ if element != None:
69
+ items.append(element) # pyright: ignore[reportOptionalMemberAccess]
70
+ return items
71
+
72
+ # Check if any domain has something to add to the value
73
+ def checkDomainAdditions(self, value):
74
+ for domain in self.compiler.program.getDomains():
75
+ value = domain.modifyValue(value)
76
+ return value
77
+
78
+ # Compile a value
79
+ def compileValue(self) -> Optional[ECValue]:
80
+ token = self.getToken()
81
+ # Special-case the plugin-safe full form: "the cat of ..."
82
+ if token == 'the' and self.peek() == 'cat':
83
+ self.nextToken() # move to 'cat'
84
+ self.skip('of')
85
+ self.nextToken()
86
+ items = self.getCatItems()
87
+ value = ECValue(type='cat', content=items)
88
+ return self.checkDomainAdditions(value)
89
+
90
+ # Otherwise, consume any leading articles before normal parsing
91
+ self.compiler.skipArticles()
92
+ token = self.getToken()
93
+
94
+ item: ECValue|None = self.getItem()
95
+ if item == None:
96
+ self.compiler.warning(f'ec_value.compileValue: Cannot get the value of "{token}"')
97
+ return None
98
+ if item.getType() == 'symbol':
99
+ object = self.compiler.getSymbolRecord(item.getContent())['object']
100
+ if not object.hasRuntimeValue(): return None
101
+
102
+ if self.peek() == 'cat':
103
+ self.nextToken() # consume 'cat'
104
+ self.nextToken()
105
+ items = self.getCatItems()
106
+ if items != None: items.insert(0, item)
107
+ value = ECValue(type='cat', content=items)
108
+ else:
109
+ value = item
110
+
111
+ return self.checkDomainAdditions(value)
112
+
113
+ def compileConstant(self, token):
114
+ value = ECValue()
115
+ if type(token) == str:
116
+ token = eval(token)
117
+ if isinstance(token, int):
118
+ value.setValue(type=int, content=token)
119
+ return value
120
+ if isinstance(token, float):
121
+ value.setValue(type=float, content=token)
122
+ return value
123
+ value.setValue(type=str, content=token)
124
+ return value
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: easycoder
3
- Version: 251104.2
3
+ Version: 260110.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>
@@ -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,58 @@
1
+ easycoder/__init__.py,sha256=BGeDPezNlTrRuE_hKj-gFXQPiDOgUbJYjSM10Bi-7Ak,393
2
+ easycoder/ec_border.py,sha256=2qgGYxB-tIk_ZM0CmW3Yt7TotlUwxwrN9fL3cCvn8eE,2599
3
+ easycoder/ec_classes.py,sha256=LWxB8T2n8KYmVdmz9uqRJWfZ8gcwHg-UsledXz0PHTA,16869
4
+ easycoder/ec_compiler.py,sha256=nAWaWvswTZpzNB_J--UWNVP7s7i7XuUnjKw8ZQ3ZHy4,7706
5
+ easycoder/ec_condition.py,sha256=BU59phivUDEAjmhBZTVziJ510MswXAPV1kMTa2I8QoQ,785
6
+ easycoder/ec_core.py,sha256=1T8duclQVnGmQOtwstt6J3SkRjDASm1YxEGYDAGDpsg,103166
7
+ easycoder/ec_gclasses.py,sha256=MQumyaZp0WFcEXOlhKvLV-RjO2osFpZ-ja-EPw8Qsgg,6808
8
+ easycoder/ec_graphics.py,sha256=7rbn2HBAbS6r88jCnwOo9svGfMLs-pBV0Hnj2QHEDrI,67371
9
+ easycoder/ec_handler.py,sha256=K_Md0SRx3AzzDD7PEaBs9FkA4qXSTL59tzhgv8CVuHE,2659
10
+ easycoder/ec_keyboard.py,sha256=R6JvgUwvgj4pJiGwXbPrFmhC-DSxJbZQnPQ9pzabrMM,19705
11
+ easycoder/ec_program.py,sha256=0Hl3mSGBUfPVImy5dCQSWog_nel-iySpOWEfNPx2yBA,16163
12
+ easycoder/ec_psutil.py,sha256=4rs6BT4gzzNsD3VZP4-p1B55HiOVK6rASyPYylUU8bI,1543
13
+ easycoder/ec_timestamp.py,sha256=z-HonUY7BDjgVVf2W_qQynnFjwGc_dAYultFjAmrXpg,307
14
+ easycoder/ec_value.py,sha256=EbWNhvK4PNX-1rW0ky8TLS4krQS5NDkwsJ7aJ4iZxx4,3554
15
+ easycoder/debugger/__init__.py,sha256=qWN02-1SoiXHCn85B_AQ7NCS8sNVvnXoAZTWpDFCvcs,88
16
+ easycoder/debugger/ec_dbg_value_display copy.py,sha256=VrKIrO53uGPEzUOj4Wj3Ztu2aMbG7KcDIAeb_PM6riA,7505
17
+ easycoder/debugger/ec_dbg_value_display.py,sha256=obT2AYNH00BZCzWIRh91LdXTmDNa6mLkExjP8tYNBJ4,769
18
+ easycoder/debugger/ec_dbg_watch_list copy.py,sha256=ul294vjdApBVEWkfB3T5YZUjNAKoLXjmraklpmSRt90,10323
19
+ easycoder/debugger/ec_dbg_watchlist.py,sha256=wWq2Exw_5crxdo-JMIPAcsptBi7L_3rIYYqPz3ZsOgo,10813
20
+ easycoder/debugger/ec_debug.py,sha256=GStorXvJ9eypSbHnlyV7SoYu4xDzL8jE8xDDZmVa-Vo,41995
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/pre/README.md,sha256=77nlI4WkrDpBVmqrxcT97nwPPQ2HqgRSb0Vp_guxIPY,202
28
+ easycoder/pre/__init__.py,sha256=ynArzRbAS4I7DSb7NWXFP_6e21QJfljH4IFzCXEBUy0,393
29
+ easycoder/pre/ec_border.py,sha256=2qgGYxB-tIk_ZM0CmW3Yt7TotlUwxwrN9fL3cCvn8eE,2599
30
+ easycoder/pre/ec_classes.py,sha256=msSX9jCyK4xFvNjlDtiNznZG7tRntIIfW_YmMk128fQ,14693
31
+ easycoder/pre/ec_compiler.py,sha256=nAWaWvswTZpzNB_J--UWNVP7s7i7XuUnjKw8ZQ3ZHy4,7706
32
+ easycoder/pre/ec_condition.py,sha256=BU59phivUDEAjmhBZTVziJ510MswXAPV1kMTa2I8QoQ,785
33
+ easycoder/pre/ec_core.py,sha256=uA5B7_5Tj6UstGBHgBcf2uIKJN_KaBdpesLApe-68eg,101138
34
+ easycoder/pre/ec_gclasses.py,sha256=j5zBhsyUGt2lpR-G3YSXk4VRiK4w7IvoAbmBvAug7-0,6627
35
+ easycoder/pre/ec_graphics.py,sha256=XnWX0qF82V46wIt2rkYldeIa3QSmwyZyU9wq26lEIpY,67364
36
+ easycoder/pre/ec_handler.py,sha256=b0mn9UkVOTa-RwWK_HyNqCv-s16LDgClUpMHT2yLOK4,2669
37
+ easycoder/pre/ec_keyboard.py,sha256=R6JvgUwvgj4pJiGwXbPrFmhC-DSxJbZQnPQ9pzabrMM,19705
38
+ easycoder/pre/ec_program.py,sha256=mcT6ZYX5EyQBr7VUMbJ4qUxdI_sMIGQ1-PFcX7ncYlM,16187
39
+ easycoder/pre/ec_psutil.py,sha256=4rs6BT4gzzNsD3VZP4-p1B55HiOVK6rASyPYylUU8bI,1543
40
+ easycoder/pre/ec_timestamp.py,sha256=z-HonUY7BDjgVVf2W_qQynnFjwGc_dAYultFjAmrXpg,307
41
+ easycoder/pre/ec_value.py,sha256=7gQTGekp0zm67RAsk-wDigSv0w63-9Vgg2wkRyyZjSc,3544
42
+ easycoder/pre/debugger/__init__.py,sha256=qWN02-1SoiXHCn85B_AQ7NCS8sNVvnXoAZTWpDFCvcs,88
43
+ easycoder/pre/debugger/ec_dbg_value_display copy.py,sha256=VrKIrO53uGPEzUOj4Wj3Ztu2aMbG7KcDIAeb_PM6riA,7505
44
+ easycoder/pre/debugger/ec_dbg_value_display.py,sha256=obT2AYNH00BZCzWIRh91LdXTmDNa6mLkExjP8tYNBJ4,769
45
+ easycoder/pre/debugger/ec_dbg_watch_list copy.py,sha256=ul294vjdApBVEWkfB3T5YZUjNAKoLXjmraklpmSRt90,10323
46
+ easycoder/pre/debugger/ec_dbg_watchlist.py,sha256=wWq2Exw_5crxdo-JMIPAcsptBi7L_3rIYYqPz3ZsOgo,10813
47
+ easycoder/pre/debugger/ec_debug.py,sha256=BWesUUiFzbNvwMY1uz-A74kd_QS2d9QhAF60wgi8r8A,41432
48
+ easycoder/pre/icons/close.png,sha256=3B9ueRNtEu9E4QNmZhdyC4VL6uqKvGmdfeFxIV9aO_Y,9847
49
+ easycoder/pre/icons/exit.png,sha256=mVQQhMQQfboJTf4p11S0TR-8qwLgO9cFaCDxf20SsfI,3408
50
+ easycoder/pre/icons/run.png,sha256=5hDyMPMlY9ypA_rR5gqM5hb4vGIg2A4_pcEmPCq0iaM,3937
51
+ easycoder/pre/icons/step.png,sha256=r4XW-2GBVrYm7kb-xvth7jHMX3g9Ge-3onfpdOHyhyE,8224
52
+ easycoder/pre/icons/stop.png,sha256=MoK6EbWFxDBdCH_ojTehjb7ty_Ax27n-8fKK_yBonfs,1832
53
+ easycoder/pre/icons/tick.png,sha256=OedASXJJTYvnza4J6Kv5m5lz6DrBfy667zX_WGgtbmM,9127
54
+ easycoder-260110.1.dist-info/entry_points.txt,sha256=JXAZbenl0TnsIft2FcGJbJ-4qoztVu2FuT8PFmWFexM,44
55
+ easycoder-260110.1.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
56
+ easycoder-260110.1.dist-info/WHEEL,sha256=Dyt6SBfaasWElUrURkknVFAZDHSTwxg3PaTza7RSbkY,100
57
+ easycoder-260110.1.dist-info/METADATA,sha256=tBSYXvSYFniI81bT0GZ02cSpWWDjJCLn672BGvZMu-U,7210
58
+ easycoder-260110.1.dist-info/RECORD,,