easycoder 251105.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/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
- value = {}
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['type'] = 'boolean'
28
- value['content'] = True
24
+ value.setValue('boolean', True)
29
25
  return value
30
26
 
31
27
  if token == 'false':
32
- value['type'] = 'boolean'
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['type'] = 'text'
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['type'] = 'int'
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
- value['type'] = 'cat'
74
- value['numeric'] = False
75
- value['value'] = [item]
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
- item = self.getItem()
80
- if item != None:
81
- value['value'].append(item)
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['type'] = 'int'
97
- value['content'] = token
96
+ value.setValue(type='int', content=token)
98
97
  return value
99
98
  if isinstance(token, float):
100
- value['type'] = 'float'
101
- value['content'] = token
99
+ value.setValue(type='float', content=token)
102
100
  return value
103
- value['type'] = 'text'
104
- value['content'] = token
101
+ value.setValue(type='str', content=token)
105
102
  return value
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: easycoder
3
- Version: 251105.1
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,24 +0,0 @@
1
- easycoder/__init__.py,sha256=J24CvAOLaN6hXFU-dc1p6uzIScRoi-d26Fz4wHGfPrI,339
2
- easycoder/ec_border.py,sha256=2qgGYxB-tIk_ZM0CmW3Yt7TotlUwxwrN9fL3cCvn8eE,2599
3
- easycoder/ec_classes.py,sha256=EWpB3Wta_jvKZ8SNIWua_ElIbw1FzKMyM3_IiXBn-lg,1995
4
- easycoder/ec_compiler.py,sha256=Q6a9nMmZogJzHu8OB4VeMzmBBarVEl3-RkqH2gW4LiU,6599
5
- easycoder/ec_condition.py,sha256=uamZrlW3Ej3R4bPDuduGB2f00M80Z1D0qV8muDx4Qfw,784
6
- easycoder/ec_core.py,sha256=TocIp8uyhT210OyF4Nj5nOswXywO0zl3mkh5HT2AmXk,100499
7
- easycoder/ec_debug.py,sha256=nzcFxzFSbFkmCR6etGeSOAR7YeVkjGfk3rsY-3tPY2U,31877
8
- easycoder/ec_handler.py,sha256=WRuvnUtaz71eiRHR5LTJHqUW8CcKjlLKDUcDp_Gtdyc,2351
9
- easycoder/ec_keyboard.py,sha256=R6JvgUwvgj4pJiGwXbPrFmhC-DSxJbZQnPQ9pzabrMM,19705
10
- easycoder/ec_program.py,sha256=jBTMaHab3k-3w9nLRNiT3tWdYx2psLcsNOKf0I1AC04,11422
11
- easycoder/ec_pyside.py,sha256=sWGDtOInd0471M5ZpQpXPLTZPRNpmINa7KmiYD8e55I,59119
12
- easycoder/ec_timestamp.py,sha256=z-HonUY7BDjgVVf2W_qQynnFjwGc_dAYultFjAmrXpg,307
13
- easycoder/ec_value.py,sha256=zgDJTJhIg3yOvmnnKIfccIizmIhGbtvL_ghLTL1T5fg,2516
14
- easycoder/icons/close.png,sha256=3B9ueRNtEu9E4QNmZhdyC4VL6uqKvGmdfeFxIV9aO_Y,9847
15
- easycoder/icons/exit.png,sha256=mVQQhMQQfboJTf4p11S0TR-8qwLgO9cFaCDxf20SsfI,3408
16
- easycoder/icons/run.png,sha256=5hDyMPMlY9ypA_rR5gqM5hb4vGIg2A4_pcEmPCq0iaM,3937
17
- easycoder/icons/step.png,sha256=r4XW-2GBVrYm7kb-xvth7jHMX3g9Ge-3onfpdOHyhyE,8224
18
- easycoder/icons/stop.png,sha256=MoK6EbWFxDBdCH_ojTehjb7ty_Ax27n-8fKK_yBonfs,1832
19
- easycoder/icons/tick.png,sha256=OedASXJJTYvnza4J6Kv5m5lz6DrBfy667zX_WGgtbmM,9127
20
- easycoder-251105.1.dist-info/entry_points.txt,sha256=JXAZbenl0TnsIft2FcGJbJ-4qoztVu2FuT8PFmWFexM,44
21
- easycoder-251105.1.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
22
- easycoder-251105.1.dist-info/WHEEL,sha256=Dyt6SBfaasWElUrURkknVFAZDHSTwxg3PaTza7RSbkY,100
23
- easycoder-251105.1.dist-info/METADATA,sha256=bdVSksUKoHrEQCtq6NDDC4KMD08pzWe2JHi4TiuMBfs,6897
24
- easycoder-251105.1.dist-info/RECORD,,