easycoder 250104.1__tar.gz → 250106.1__tar.gz

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 (160) hide show
  1. {easycoder-250104.1 → easycoder-250106.1}/PKG-INFO +2 -2
  2. {easycoder-250104.1 → easycoder-250106.1}/README.md +1 -1
  3. {easycoder-250104.1 → easycoder-250106.1}/doc/core/keywords/import.md +3 -3
  4. {easycoder-250104.1 → easycoder-250106.1}/doc/core/keywords/run.md +2 -2
  5. {easycoder-250104.1 → easycoder-250106.1}/doc/graphics/README.md +2 -1
  6. easycoder-250106.1/doc/graphics/keywords/attach.md +18 -0
  7. easycoder-250106.1/doc/graphics/keywords/close.md +15 -0
  8. easycoder-250106.1/doc/graphics/keywords/create.md +15 -0
  9. easycoder-250106.1/doc/graphics/keywords/ellipse.md +15 -0
  10. easycoder-250106.1/doc/graphics/keywords/image.md +15 -0
  11. easycoder-250106.1/doc/graphics/keywords/move.md +17 -0
  12. easycoder-250106.1/doc/graphics/keywords/on.md +16 -0
  13. easycoder-250106.1/doc/graphics/keywords/rectangle.md +15 -0
  14. easycoder-250106.1/doc/graphics/keywords/render.md +18 -0
  15. easycoder-250106.1/doc/graphics/keywords/run.md +18 -0
  16. easycoder-250106.1/doc/graphics/keywords/set.md +15 -0
  17. easycoder-250106.1/doc/graphics/keywords/text.md +15 -0
  18. easycoder-250106.1/doc/graphics/values/attribute.md +15 -0
  19. easycoder-250106.1/doc/graphics/values/window.md +15 -0
  20. {easycoder-250104.1 → easycoder-250106.1}/easycoder/__init__.py +1 -1
  21. {easycoder-250104.1 → easycoder-250106.1}/easycoder/ec_compiler.py +1 -1
  22. {easycoder-250104.1 → easycoder-250106.1}/easycoder/ec_core.py +100 -37
  23. {easycoder-250104.1 → easycoder-250106.1}/easycoder/ec_graphics.py +12 -9
  24. {easycoder-250104.1 → easycoder-250106.1}/easycoder/ec_program.py +29 -14
  25. {easycoder-250104.1 → easycoder-250106.1}/easycoder/ec_renderer.py +2 -0
  26. {easycoder-250104.1 → easycoder-250106.1}/easycoder/ec_screenspec.py +4 -7
  27. {easycoder-250104.1 → easycoder-250106.1}/easycoder/ec_value.py +2 -2
  28. {easycoder-250104.1 → easycoder-250106.1}/scripts/benchmark.ecs +1 -0
  29. {easycoder-250104.1 → easycoder-250106.1}/scripts/fizzbuzz.ecs +1 -0
  30. {easycoder-250104.1 → easycoder-250106.1}/scripts/hello.ecs +1 -0
  31. {easycoder-250104.1 → easycoder-250106.1}/scripts/points.ecs +2 -1
  32. {easycoder-250104.1 → easycoder-250106.1}/scripts/tests.ecs +2 -0
  33. {easycoder-250104.1 → easycoder-250106.1}/scripts/wave.ecg +1 -1
  34. {easycoder-250104.1 → easycoder-250106.1}/LICENSE +0 -0
  35. {easycoder-250104.1 → easycoder-250106.1}/doc/README.md +0 -0
  36. {easycoder-250104.1 → easycoder-250106.1}/doc/core/README.md +0 -0
  37. {easycoder-250104.1 → easycoder-250106.1}/doc/core/conditions/boolean.md +0 -0
  38. {easycoder-250104.1 → easycoder-250106.1}/doc/core/conditions/empty.md +0 -0
  39. {easycoder-250104.1 → easycoder-250106.1}/doc/core/conditions/ends.md +0 -0
  40. {easycoder-250104.1 → easycoder-250106.1}/doc/core/conditions/even.md +0 -0
  41. {easycoder-250104.1 → easycoder-250106.1}/doc/core/conditions/exists.md +0 -0
  42. {easycoder-250104.1 → easycoder-250106.1}/doc/core/conditions/greater.md +0 -0
  43. {easycoder-250104.1 → easycoder-250106.1}/doc/core/conditions/hasProperty.md +0 -0
  44. {easycoder-250104.1 → easycoder-250106.1}/doc/core/conditions/includes.md +0 -0
  45. {easycoder-250104.1 → easycoder-250106.1}/doc/core/conditions/is.md +0 -0
  46. {easycoder-250104.1 → easycoder-250106.1}/doc/core/conditions/less.md +0 -0
  47. {easycoder-250104.1 → easycoder-250106.1}/doc/core/conditions/list.md +0 -0
  48. {easycoder-250104.1 → easycoder-250106.1}/doc/core/conditions/none.md +0 -0
  49. {easycoder-250104.1 → easycoder-250106.1}/doc/core/conditions/not.md +0 -0
  50. {easycoder-250104.1 → easycoder-250106.1}/doc/core/conditions/numeric.md +0 -0
  51. {easycoder-250104.1 → easycoder-250106.1}/doc/core/conditions/object.md +0 -0
  52. {easycoder-250104.1 → easycoder-250106.1}/doc/core/conditions/odd.md +0 -0
  53. {easycoder-250104.1 → easycoder-250106.1}/doc/core/conditions/starts.md +0 -0
  54. {easycoder-250104.1 → easycoder-250106.1}/doc/core/conditions/string.md +0 -0
  55. {easycoder-250104.1 → easycoder-250106.1}/doc/core/keywords/add.md +0 -0
  56. {easycoder-250104.1 → easycoder-250106.1}/doc/core/keywords/append.md +0 -0
  57. {easycoder-250104.1 → easycoder-250106.1}/doc/core/keywords/assert.md +0 -0
  58. {easycoder-250104.1 → easycoder-250106.1}/doc/core/keywords/begin.md +0 -0
  59. {easycoder-250104.1 → easycoder-250106.1}/doc/core/keywords/clear.md +0 -0
  60. {easycoder-250104.1 → easycoder-250106.1}/doc/core/keywords/close.md +0 -0
  61. {easycoder-250104.1 → easycoder-250106.1}/doc/core/keywords/create.md +0 -0
  62. {easycoder-250104.1 → easycoder-250106.1}/doc/core/keywords/debug.md +0 -0
  63. {easycoder-250104.1 → easycoder-250106.1}/doc/core/keywords/decrement.md +0 -0
  64. {easycoder-250104.1 → easycoder-250106.1}/doc/core/keywords/delete.md +0 -0
  65. {easycoder-250104.1 → easycoder-250106.1}/doc/core/keywords/divide.md +0 -0
  66. {easycoder-250104.1 → easycoder-250106.1}/doc/core/keywords/exit.md +0 -0
  67. {easycoder-250104.1 → easycoder-250106.1}/doc/core/keywords/file.md +0 -0
  68. {easycoder-250104.1 → easycoder-250106.1}/doc/core/keywords/fork.md +0 -0
  69. {easycoder-250104.1 → easycoder-250106.1}/doc/core/keywords/get.md +0 -0
  70. {easycoder-250104.1 → easycoder-250106.1}/doc/core/keywords/go.md +0 -0
  71. {easycoder-250104.1 → easycoder-250106.1}/doc/core/keywords/gosub.md +0 -0
  72. {easycoder-250104.1 → easycoder-250106.1}/doc/core/keywords/if.md +0 -0
  73. {easycoder-250104.1 → easycoder-250106.1}/doc/core/keywords/increment.md +0 -0
  74. {easycoder-250104.1 → easycoder-250106.1}/doc/core/keywords/index.md +0 -0
  75. {easycoder-250104.1 → easycoder-250106.1}/doc/core/keywords/init.md +0 -0
  76. {easycoder-250104.1 → easycoder-250106.1}/doc/core/keywords/input.md +0 -0
  77. {easycoder-250104.1 → easycoder-250106.1}/doc/core/keywords/load.md +0 -0
  78. {easycoder-250104.1 → easycoder-250106.1}/doc/core/keywords/lock.md +0 -0
  79. {easycoder-250104.1 → easycoder-250106.1}/doc/core/keywords/module.md +0 -0
  80. {easycoder-250104.1 → easycoder-250106.1}/doc/core/keywords/multiply.md +0 -0
  81. {easycoder-250104.1 → easycoder-250106.1}/doc/core/keywords/negate.md +0 -0
  82. {easycoder-250104.1 → easycoder-250106.1}/doc/core/keywords/open.md +0 -0
  83. {easycoder-250104.1 → easycoder-250106.1}/doc/core/keywords/pop.md +0 -0
  84. {easycoder-250104.1 → easycoder-250106.1}/doc/core/keywords/post.md +0 -0
  85. {easycoder-250104.1 → easycoder-250106.1}/doc/core/keywords/print.md +0 -0
  86. {easycoder-250104.1 → easycoder-250106.1}/doc/core/keywords/push.md +0 -0
  87. {easycoder-250104.1 → easycoder-250106.1}/doc/core/keywords/put.md +0 -0
  88. {easycoder-250104.1 → easycoder-250106.1}/doc/core/keywords/read.md +0 -0
  89. {easycoder-250104.1 → easycoder-250106.1}/doc/core/keywords/release.md +0 -0
  90. {easycoder-250104.1 → easycoder-250106.1}/doc/core/keywords/replace.md +0 -0
  91. {easycoder-250104.1 → easycoder-250106.1}/doc/core/keywords/return.md +0 -0
  92. {easycoder-250104.1 → easycoder-250106.1}/doc/core/keywords/save.md +0 -0
  93. {easycoder-250104.1 → easycoder-250106.1}/doc/core/keywords/script.md +0 -0
  94. {easycoder-250104.1 → easycoder-250106.1}/doc/core/keywords/set.md +0 -0
  95. {easycoder-250104.1 → easycoder-250106.1}/doc/core/keywords/split.md +0 -0
  96. {easycoder-250104.1 → easycoder-250106.1}/doc/core/keywords/stack.md +0 -0
  97. {easycoder-250104.1 → easycoder-250106.1}/doc/core/keywords/stop.md +0 -0
  98. {easycoder-250104.1 → easycoder-250106.1}/doc/core/keywords/system.md +0 -0
  99. {easycoder-250104.1 → easycoder-250106.1}/doc/core/keywords/take.md +0 -0
  100. {easycoder-250104.1 → easycoder-250106.1}/doc/core/keywords/toggle.md +0 -0
  101. {easycoder-250104.1 → easycoder-250106.1}/doc/core/keywords/truncate.md +0 -0
  102. {easycoder-250104.1 → easycoder-250106.1}/doc/core/keywords/unlock.md +0 -0
  103. {easycoder-250104.1 → easycoder-250106.1}/doc/core/keywords/variable.md +0 -0
  104. {easycoder-250104.1 → easycoder-250106.1}/doc/core/keywords/wait.md +0 -0
  105. {easycoder-250104.1 → easycoder-250106.1}/doc/core/keywords/while.md +0 -0
  106. {easycoder-250104.1 → easycoder-250106.1}/doc/core/keywords/write.md +0 -0
  107. {easycoder-250104.1 → easycoder-250106.1}/doc/core/values/arg.md +0 -0
  108. {easycoder-250104.1 → easycoder-250106.1}/doc/core/values/args.md +0 -0
  109. {easycoder-250104.1 → easycoder-250106.1}/doc/core/values/cos.md +0 -0
  110. {easycoder-250104.1 → easycoder-250106.1}/doc/core/values/datime.md +0 -0
  111. {easycoder-250104.1 → easycoder-250106.1}/doc/core/values/decode.md +0 -0
  112. {easycoder-250104.1 → easycoder-250106.1}/doc/core/values/element.md +0 -0
  113. {easycoder-250104.1 → easycoder-250106.1}/doc/core/values/elements.md +0 -0
  114. {easycoder-250104.1 → easycoder-250106.1}/doc/core/values/empty.md +0 -0
  115. {easycoder-250104.1 → easycoder-250106.1}/doc/core/values/encode.md +0 -0
  116. {easycoder-250104.1 → easycoder-250106.1}/doc/core/values/error.md +0 -0
  117. {easycoder-250104.1 → easycoder-250106.1}/doc/core/values/files.md +0 -0
  118. {easycoder-250104.1 → easycoder-250106.1}/doc/core/values/float.md +0 -0
  119. {easycoder-250104.1 → easycoder-250106.1}/doc/core/values/from.md +0 -0
  120. {easycoder-250104.1 → easycoder-250106.1}/doc/core/values/hash.md +0 -0
  121. {easycoder-250104.1 → easycoder-250106.1}/doc/core/values/index.md +0 -0
  122. {easycoder-250104.1 → easycoder-250106.1}/doc/core/values/integer.md +0 -0
  123. {easycoder-250104.1 → easycoder-250106.1}/doc/core/values/json.md +0 -0
  124. {easycoder-250104.1 → easycoder-250106.1}/doc/core/values/keys.md +0 -0
  125. {easycoder-250104.1 → easycoder-250106.1}/doc/core/values/left.md +0 -0
  126. {easycoder-250104.1 → easycoder-250106.1}/doc/core/values/length.md +0 -0
  127. {easycoder-250104.1 → easycoder-250106.1}/doc/core/values/lowercase.md +0 -0
  128. {easycoder-250104.1 → easycoder-250106.1}/doc/core/values/memory.md +0 -0
  129. {easycoder-250104.1 → easycoder-250106.1}/doc/core/values/modification.md +0 -0
  130. {easycoder-250104.1 → easycoder-250106.1}/doc/core/values/modulo.md +0 -0
  131. {easycoder-250104.1 → easycoder-250106.1}/doc/core/values/newline.md +0 -0
  132. {easycoder-250104.1 → easycoder-250106.1}/doc/core/values/now.md +0 -0
  133. {easycoder-250104.1 → easycoder-250106.1}/doc/core/values/position.md +0 -0
  134. {easycoder-250104.1 → easycoder-250106.1}/doc/core/values/property.md +0 -0
  135. {easycoder-250104.1 → easycoder-250106.1}/doc/core/values/random.md +0 -0
  136. {easycoder-250104.1 → easycoder-250106.1}/doc/core/values/right.md +0 -0
  137. {easycoder-250104.1 → easycoder-250106.1}/doc/core/values/sin.md +0 -0
  138. {easycoder-250104.1 → easycoder-250106.1}/doc/core/values/stringify.md +0 -0
  139. {easycoder-250104.1 → easycoder-250106.1}/doc/core/values/tab.md +0 -0
  140. {easycoder-250104.1 → easycoder-250106.1}/doc/core/values/tan.md +0 -0
  141. {easycoder-250104.1 → easycoder-250106.1}/doc/core/values/timestamp.md +0 -0
  142. {easycoder-250104.1 → easycoder-250106.1}/doc/core/values/today.md +0 -0
  143. {easycoder-250104.1 → easycoder-250106.1}/doc/core/values/trim.md +0 -0
  144. {easycoder-250104.1 → easycoder-250106.1}/doc/core/values/type.md +0 -0
  145. {easycoder-250104.1 → easycoder-250106.1}/doc/core/values/uppercase.md +0 -0
  146. {easycoder-250104.1 → easycoder-250106.1}/doc/core/values/value.md +0 -0
  147. {easycoder-250104.1 → easycoder-250106.1}/doc/core/values/weekday.md +0 -0
  148. {easycoder-250104.1 → easycoder-250106.1}/easycoder/README.md +0 -0
  149. {easycoder-250104.1 → easycoder-250106.1}/easycoder/ec.py +0 -0
  150. {easycoder-250104.1 → easycoder-250106.1}/easycoder/ec_classes.py +0 -0
  151. {easycoder-250104.1 → easycoder-250106.1}/easycoder/ec_condition.py +0 -0
  152. {easycoder-250104.1 → easycoder-250106.1}/easycoder/ec_handler.py +0 -0
  153. {easycoder-250104.1 → easycoder-250106.1}/easycoder/ec_timestamp.py +0 -0
  154. {easycoder-250104.1 → easycoder-250106.1}/images/Semoigo Dawn.jpg +0 -0
  155. {easycoder-250104.1 → easycoder-250106.1}/json/graphics-demo.json +0 -0
  156. {easycoder-250104.1 → easycoder-250106.1}/plugins/ec_p100.py +0 -0
  157. {easycoder-250104.1 → easycoder-250106.1}/plugins/example.py +0 -0
  158. {easycoder-250104.1 → easycoder-250106.1}/pyproject.toml +0 -0
  159. {easycoder-250104.1 → easycoder-250106.1}/scripts/README.md +0 -0
  160. {easycoder-250104.1 → easycoder-250106.1}/scripts/graphics-demo.ecg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: easycoder
3
- Version: 250104.1
3
+ Version: 250106.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>
@@ -77,7 +77,7 @@ A couple of demo graphical scripts are included in the `scripts` directory:
77
77
 
78
78
  - English-like syntax based on vocabulary rather than structure. Scripts can be read as English
79
79
  - Comprehensive feature set
80
- - Runs directly from source scripts, using a fast compiler to create efficient intermediate runtime code that is run immediately
80
+ - Runs directly from source scripts. A fast compiler creates efficient intermediate code that runs immediately after compilation
81
81
  - Low memory requirements
82
82
  - Minimim dependency on other 3rd-party packages
83
83
  - Built-in co-operative multitasking
@@ -66,7 +66,7 @@ A couple of demo graphical scripts are included in the `scripts` directory:
66
66
 
67
67
  - English-like syntax based on vocabulary rather than structure. Scripts can be read as English
68
68
  - Comprehensive feature set
69
- - Runs directly from source scripts, using a fast compiler to create efficient intermediate runtime code that is run immediately
69
+ - Runs directly from source scripts. A fast compiler creates efficient intermediate code that runs immediately after compilation
70
70
  - Low memory requirements
71
71
  - Minimim dependency on other 3rd-party packages
72
72
  - Built-in co-operative multitasking
@@ -2,15 +2,15 @@
2
2
 
3
3
  ## Syntax:
4
4
  `import {type} {variable} [and {type} {variable} ...]]`
5
- `import {classname} from {path}`
5
+ `import plugin {classname} from {path}`
6
6
 
7
7
  ## Examples:
8
8
  `import variable Name and variable Surname`
9
- `import Points from plugins/example.py`
9
+ `import plugin Points from plugins/example.py`
10
10
 
11
11
  ## Description:
12
12
  First form:
13
- This specifies which variable should be provided by a calling script
13
+ This specifies which variable should be provided by a calling script.
14
14
 
15
15
  Second form:
16
16
  As with [script](script.md), `import` is a compiler directive that should be placed at the top of the script, under the [script](script.md) directive. It's used to call in a plugin language extension where needed. The example above is provided in the repository, to be used as a starting point for your own extra functionality.
@@ -1,13 +1,13 @@
1
1
  # run
2
2
 
3
3
  ## Syntax:
4
- `run {module} as {name} [with {export} [and {export}...]]`
4
+ `run {name} {module} as [with {export} [and {export}...]]`
5
5
 
6
6
  ## Example:
7
7
  ``run Hello as `hello.ecs` with Name and Surname` ``
8
8
 
9
9
  ## Description:
10
- Run a second script, optionally passing it variables it can use. Changes to these variables will be seen by the parent script (but see [lock](lock.md)). See also [release](release.md).
10
+ Run a second script, optionally passing it variables it can use. Changes to these variables will be seen by the parent script (but see [lock](lock.md)). See also [module](module.md), [release](release.md), [send](send.md)and [on](on.md).
11
11
 
12
12
  Next: [multiply](multiply.md)
13
13
  Prev: [lock](lock.md)
@@ -10,10 +10,11 @@ There are three primary components to the language:
10
10
 
11
11
  The core keywords are:
12
12
 
13
-
13
+ [attach](attach.md) [close](close.md) [create](create.md) [ellipse](ellipse.md) [image](image.md) [move](move.md) [on](on.md) [rectangle](rectangle.md) [render](render.md) [run](run.md) [set](set.md) [text](text.md)
14
14
 
15
15
  The core values are:
16
16
 
17
+ [attribute](attribute.md) [window](window.md)
17
18
 
18
19
  The core conditions are:
19
20
 
@@ -0,0 +1,18 @@
1
+ ## attach
2
+
3
+ ## Syntax:
4
+ `attach {id} to {graphic element}`
5
+
6
+ ## Examples:
7
+ ``attach `big-circle` to Ellipse1` ``
8
+ ``attach `container` to Container` ``
9
+
10
+ ## Description:
11
+ Attaches an **_EasyCoder_** graphic variable ([ellipse](ellipse.md), [rectangle](rectangle.md), [text](text.md), [image](image.md) etc.) to the rendered graphic item with the given id.
12
+
13
+ When a graphic specification is rendered, every item in the structure is added to 1) a list of items in the order they were rendered (the z-order) and 2) a dictionary of items indexed by their ids.
14
+
15
+ Next: [close](close.md)
16
+ Prev: [text](text.md)
17
+
18
+ [Back](../../README.md)
@@ -0,0 +1,15 @@
1
+ ## close
2
+
3
+ ## Syntax:
4
+ `close window`
5
+
6
+ ## Examples:
7
+ `close window`
8
+
9
+ ## Description:
10
+ Close the window. This will also terminate the **_EasyCoder_** script.
11
+
12
+ Next: [create](create.md)
13
+ Prev: [attach](attach.md)
14
+
15
+ [Back](../../README.md)
@@ -0,0 +1,15 @@
1
+ ## create
2
+
3
+ ## Syntax:
4
+ `create window {parameters}`
5
+
6
+ ## Examples:
7
+ ``create window title `Demo` at 300 300 size 640 480 fill color 255 255 200` ``
8
+
9
+ ## Description:
10
+ Creates a window with the given parameters. There can only be one of these in a program.
11
+
12
+ Next: [ellipse](ellipse.md)
13
+ Prev: [close](close.md)
14
+
15
+ [Back](../../README.md)
@@ -0,0 +1,15 @@
1
+ ## ellipse
2
+
3
+ ## Syntax:
4
+ `ellipse {name}`
5
+
6
+ ## Examples:
7
+ `ellipse Circle`
8
+
9
+ ## Description:
10
+ Declares an ellipse variable. This will be attached to a rendered ellipse and used to pass commands to it. See also [image](image.md), [rectangle](rectangle.md) and [text](text.md).
11
+
12
+ Next: [image](image.md)
13
+ Prev: [create](create.md)
14
+
15
+ [Back](../../README.md)
@@ -0,0 +1,15 @@
1
+ ## image
2
+
3
+ ## Syntax:
4
+ `image {name}`
5
+
6
+ ## Examples:
7
+ `image House`
8
+
9
+ ## Description:
10
+ Declares an image variable. This will be attached to a rendered image and used to pass commands to it. See also [ellipse](ellipse.md), [rectangle](rectangle.md) and [text](text.md).
11
+
12
+ Next: [move](move.md)
13
+ Prev: [ellipse](ellipse.md)
14
+
15
+ [Back](../../README.md)
@@ -0,0 +1,17 @@
1
+ ## move
2
+
3
+ ## Syntax:
4
+ `move {name} by {dx} {dy}`
5
+ `move {name} to {x} {y}`
6
+
7
+ ## Examples:
8
+ `move Blob by 5 10`
9
+ `move Button to X Y`
10
+
11
+ ## Description:
12
+ Moves a graphic element in its parent container, either by a relative amount or to a specified location.
13
+
14
+ Next: [on](on.md)
15
+ Prev: [image](image.md)
16
+
17
+ [Back](../../README.md)
@@ -0,0 +1,16 @@
1
+ ## on
2
+
3
+ ## Syntax:
4
+ `on click/tap {element} {action}`
5
+
6
+ ## Examples:
7
+ `on click Button stop`
8
+ `on tap Plus increment Count`
9
+
10
+ ## Description:
11
+ Handle a graphic event. When the user clicks/taps the specified element, perform the requested action, which can be a single command or a `begin...end` block.
12
+
13
+ Next: [rectangle](rectangle.md)
14
+ Prev: [move](move.md)
15
+
16
+ [Back](../../README.md)
@@ -0,0 +1,15 @@
1
+ ## rectangle
2
+
3
+ ## Syntax:
4
+ `rectangle {name}`
5
+
6
+ ## Examples:
7
+ `rectangle BigBox`
8
+
9
+ ## Description:
10
+ Declares a rectangle variable. This will be attached to a rendered rectangle and used to pass commands to it. See also [ellipse](ellipse.md), [image](image.md) and [text](text.md).
11
+
12
+ Next: [render](render.md)
13
+ Prev: [on](on.md)
14
+
15
+ [Back](../../README.md)
@@ -0,0 +1,18 @@
1
+ ## render
2
+
3
+ ## Syntax:
4
+ `render {specification} [in {parent}]`
5
+
6
+ ## Examples:
7
+ `render Spec`
8
+ `render Spec in BigBox`
9
+
10
+ ## Description:
11
+ Render a graphic specification, optionally giving the parent container.
12
+
13
+ Specifications are JSON structures that describe the layout and the element(s) comprising the graphic. See [specification](../specification.md).
14
+
15
+ Next: [run](run.md)
16
+ Prev: [rectangle](rectangle.md)
17
+
18
+ [Back](../../README.md)
@@ -0,0 +1,18 @@
1
+ ## run
2
+
3
+ ## Syntax:
4
+ `render {specification} [in {parent}]`
5
+
6
+ ## Examples:
7
+ `render Spec`
8
+ `render Spec in BigBox`
9
+
10
+ ## Description:
11
+ Render a graphic specification, optionally giving the parent container.
12
+
13
+ Specifications are JSON structures that describe the layout and the element(s) comprising the graphic. See [specification](../specification.md).
14
+
15
+ Next: [run](run.md)
16
+ Prev: [rectangle](rectangle.md)
17
+
18
+ [Back](../../README.md)
@@ -0,0 +1,15 @@
1
+ ## set
2
+
3
+ ## Syntax:
4
+ `set attribute {name} of {element} to {value}`
5
+
6
+ ## Examples:
7
+ ``set attribute `left` of Button to Left`
8
+
9
+ ## Description:
10
+ Set an attribute of a graphic element. Valid attributes depend on the element but include such as `left`, `bottom`, `width` and `height`.
11
+
12
+ Next: [text](text.md)
13
+ Prev: [run](run.md)
14
+
15
+ [Back](../../README.md)
@@ -0,0 +1,15 @@
1
+ ## text
2
+
3
+ ## Syntax:
4
+ `text {name}`
5
+
6
+ ## Examples:
7
+ `text BigBox`
8
+
9
+ ## Description:
10
+ Declares a text variable. This will be attached to a rendered text object and used to pass commands to it. See also [ellipse](ellipse.md), [image](image.md) and [rectangle](rectangle.md).
11
+
12
+ Next: [attach](attach.md)
13
+ Prev: [set](set.md)
14
+
15
+ [Back](../../README.md)
@@ -0,0 +1,15 @@
1
+ # attribute
2
+
3
+ ## Syntax:
4
+ `attribute {key} of {element}`
5
+
6
+ ## Examples:
7
+ ``attribute `width` of BigBox` ``
8
+
9
+ ## Description:
10
+ Gets the named attribute of a graphic element.
11
+
12
+ Next: [window](window.md)
13
+ Prev: [window](window.md)
14
+
15
+ [Back](../../README.md)
@@ -0,0 +1,15 @@
1
+ # window
2
+
3
+ ## Syntax:
4
+ `[the] window left/top/width/height`
5
+
6
+ ## Examples:
7
+ `the window height`
8
+
9
+ ## Description:
10
+ Gets the specified attribute of the window.
11
+
12
+ Next: [attribute](attribute.md)
13
+ Prev: [attribute](attribute.md)
14
+
15
+ [Back](../../README.md)
@@ -10,4 +10,4 @@ from .ec_program import *
10
10
  from .ec_timestamp import *
11
11
  from .ec_value import *
12
12
 
13
- __version__ = "250104.1"
13
+ __version__ = "250106.1"
@@ -102,7 +102,7 @@ class Compiler:
102
102
 
103
103
  def showWarnings(self):
104
104
  for warning in self.warnings:
105
- print(f'Warning at line {self.getLino() + 1} from {warning}')
105
+ print(f'Warning at line {self.getLino() + 1} of {self.program.name}: {warning}')
106
106
 
107
107
  def getSymbolRecord(self):
108
108
  token = self.getToken()
@@ -552,27 +552,37 @@ class Core(Handler):
552
552
  self.program.pc += 1
553
553
  return self.program.pc
554
554
 
555
- # Import one or more variables
556
555
  def k_import(self, command):
557
- imports = []
558
- while True:
559
- keyword = self.nextToken()
560
- name = self.nextToken()
561
- item = [keyword, name]
562
- imports.append(item)
563
- self.symbols[name] = self.getPC()
564
- variable = {}
565
- variable['domain'] = None
566
- variable['name'] = name
567
- variable['keyword'] = keyword
568
- variable['import'] = None
569
- self.addCommand(variable)
570
- if self.peek() != 'and':
571
- break
556
+ if self.peek() == 'plugin':
557
+ # Import a plugin
572
558
  self.nextToken()
573
- command['imports'] = json.dumps(imports)
574
- self.add(command)
575
- return True
559
+ clazz = self.nextToken()
560
+ if self.nextIs('from'):
561
+ source = self.nextToken()
562
+ self.program.importPlugin(f'{source}:{clazz}')
563
+ return True
564
+ return False
565
+ else:
566
+ # Import one or more variables
567
+ imports = []
568
+ while True:
569
+ keyword = self.nextToken()
570
+ name = self.nextToken()
571
+ item = [keyword, name]
572
+ imports.append(item)
573
+ self.symbols[name] = self.getPC()
574
+ variable = {}
575
+ variable['domain'] = None
576
+ variable['name'] = name
577
+ variable['keyword'] = keyword
578
+ variable['import'] = None
579
+ self.addCommand(variable)
580
+ if self.peek() != 'and':
581
+ break
582
+ self.nextToken()
583
+ command['imports'] = json.dumps(imports)
584
+ self.add(command)
585
+ return True
576
586
 
577
587
  def r_import(self, command):
578
588
  exports = self.program.exports
@@ -694,11 +704,8 @@ class Core(Handler):
694
704
  return False
695
705
 
696
706
  def r_load(self, command):
697
- print(command)
698
707
  target = self.getVariable(command['target'])
699
- print(target)
700
708
  file = self.getRuntimeValue(command['file'])
701
- print(file)
702
709
  f = open(file, 'r')
703
710
  content = f.read()
704
711
  f.close()
@@ -810,6 +817,36 @@ class Core(Handler):
810
817
  def r_object(self, command):
811
818
  return self.nextPC()
812
819
 
820
+ # on message {action}
821
+ def k_on(self, command):
822
+ if self.nextIs('message'):
823
+ self.nextToken()
824
+ command['goto'] = 0
825
+ self.add(command)
826
+ cmd = {}
827
+ cmd['domain'] = 'core'
828
+ cmd['lino'] = command['lino']
829
+ cmd['keyword'] = 'gotoPC'
830
+ cmd['goto'] = 0
831
+ cmd['debug'] = False
832
+ self.addCommand(cmd)
833
+ # Add the action and a 'stop'
834
+ self.compileOne()
835
+ cmd = {}
836
+ cmd['domain'] = 'core'
837
+ cmd['lino'] = command['lino']
838
+ cmd['keyword'] = 'stop'
839
+ cmd['debug'] = False
840
+ self.addCommand(cmd)
841
+ # Fixup the link
842
+ command['goto'] = self.getPC()
843
+ return True
844
+ return False
845
+
846
+ def r_on(self, command):
847
+ self.program.onMessage(self.nextPC()+1)
848
+ return command['goto']
849
+
813
850
  # Open a file
814
851
  # open {file} for reading/writing/appending
815
852
  def k_open(self, command):
@@ -1002,13 +1039,13 @@ class Core(Handler):
1002
1039
  if self.nextIsSymbol():
1003
1040
  symbolRecord = self.getSymbolRecord()
1004
1041
  command['target'] = symbolRecord['name']
1005
- if symbolRecord['valueHolder']:
1042
+ if 'valueholder' in symbolRecord and symbolRecord['valueHolder'] == False:
1043
+ FatalError(self.program.compiler, f'Symbol {symbolRecord["name"]} is not a value holder')
1044
+ else:
1006
1045
  self.add(command)
1007
1046
  return True
1008
- else:
1009
- FatalError(self.program.compiler, f'Symbol {symbolRecord["name"]} is not a value holder')
1010
1047
  else:
1011
- FatalError(self.program.compiler, f'No such variable: "{self.getToken()}"')
1048
+ FatalError(self.program.compiler, f'Symbol {self.getToken()} is not a variable')
1012
1049
  return False
1013
1050
 
1014
1051
  def r_put(self, command):
@@ -1111,12 +1148,16 @@ class Core(Handler):
1111
1148
 
1112
1149
  # Compile and run a script
1113
1150
  def k_run(self, command):
1114
- if self.nextIsSymbol():
1115
- record = self.getSymbolRecord()
1116
- if record['keyword'] == 'module':
1117
- command['target'] = record['name']
1118
- if self.nextIs('as'):
1119
- command['path'] = self.nextValue()
1151
+ try:
1152
+ command['path'] = self.nextValue()
1153
+ except Exception as e:
1154
+ self.warning(f'Core.run: Path expected')
1155
+ return False
1156
+ if self.nextIs('as'):
1157
+ if self.nextIsSymbol():
1158
+ record = self.getSymbolRecord()
1159
+ if record['keyword'] == 'module':
1160
+ command['module'] = record['name']
1120
1161
  exports = []
1121
1162
  if self.nextIs('with'):
1122
1163
  while True:
@@ -1132,18 +1173,18 @@ class Core(Handler):
1132
1173
  return False
1133
1174
 
1134
1175
  def r_run(self, command):
1135
- target = self.getVariable(command['target'])
1176
+ module = self.getVariable(command['module'])
1136
1177
  path = self.getRuntimeValue(command['path'])
1137
1178
  exports = json.loads(command['exports'])
1138
1179
  for n in range(0, len(exports)):
1139
1180
  exports[n] = self.getVariable(exports[n])
1140
- target['path'] = path
1181
+ module['path'] = path
1141
1182
  parent = Object()
1142
1183
  parent.program = self.program
1143
1184
  parent.pc = self.nextPC()
1144
1185
  parent.waiting = True
1145
1186
  p = self.program.__class__
1146
- p(path).start(parent, exports)
1187
+ p(path).start(parent, module, exports)
1147
1188
  return 0
1148
1189
 
1149
1190
  # Provide a name for the script
@@ -1168,6 +1209,24 @@ class Core(Handler):
1168
1209
  f.close()
1169
1210
  return self.nextPC()
1170
1211
 
1212
+ # Send a message to a module
1213
+ def k_send(self, command):
1214
+ command['message'] = self.nextValue()
1215
+ if self.nextIs('to'):
1216
+ if self.nextIsSymbol():
1217
+ record = self.getSymbolRecord()
1218
+ if record['keyword'] == 'module':
1219
+ command['module'] = record['name']
1220
+ self.add(command)
1221
+ return True
1222
+ return False
1223
+
1224
+ def r_send(self, command):
1225
+ message = self.getRuntimeValue(command['message'])
1226
+ module = self.getVariable(command['module'])
1227
+ module['child'].handleMessage(message)
1228
+ return self.nextPC()
1229
+
1171
1230
  # Set a value
1172
1231
  # set {variable}
1173
1232
  # set the elements of {variable} to {value}
@@ -1791,7 +1850,6 @@ class Core(Handler):
1791
1850
  return value
1792
1851
 
1793
1852
  if token == 'message':
1794
- self.nextToken()
1795
1853
  return value
1796
1854
 
1797
1855
  if token == 'timestamp':
@@ -1842,7 +1900,6 @@ class Core(Handler):
1842
1900
  return value
1843
1901
  return None
1844
1902
 
1845
- self.warning(f'Core.compileValue: Unknown token "{token}"')
1846
1903
  return None
1847
1904
 
1848
1905
  #############################################################################
@@ -2097,6 +2154,12 @@ class Core(Handler):
2097
2154
  value['content'] = megabytes
2098
2155
  return value
2099
2156
 
2157
+ def v_message(self, v):
2158
+ value = {}
2159
+ value['type'] = 'text'
2160
+ value['content'] = self.program.message
2161
+ return value
2162
+
2100
2163
  def v_modification(self, v):
2101
2164
  fileName = self.getRuntimeValue(v['fileName'])
2102
2165
  ts = int(os.stat(fileName).st_mtime)
@@ -36,7 +36,7 @@ class Graphics(Handler):
36
36
  FatalError(self.program.compiler, f'There is no screen element with id \'{id}\'')
37
37
  return -1
38
38
  if element.getType() != keyword:
39
- FatalError(self.program.compiler, f'Mismatched element type ({element['type']} and {keyword})')
39
+ FatalError(self.program.compiler, f'Mismatched element type: \'{element['type']}\' and \'{keyword}\'')
40
40
  self.putSymbolValue(targetRecord, {'type': 'text', 'content': id})
41
41
  return self.nextPC()
42
42
 
@@ -176,7 +176,7 @@ class Graphics(Handler):
176
176
  self.windowSpec = Object()
177
177
  self.windowSpec.title = command['title']['content']
178
178
  self.windowSpec.flush = flush
179
- self.windowSpec.finish = self.program.finish
179
+ self.windowSpec.kill = self.program.kill
180
180
  self.windowSpec.pos = (self.getRuntimeValue(command['pos'][0]), self.getRuntimeValue(command['pos'][1]))
181
181
  self.windowSpec.size = (self.getRuntimeValue(command['size'][0]), self.getRuntimeValue(command['size'][1]))
182
182
  self.windowSpec.fill = (self.getRuntimeValue(command['fill'][0])/255, self.getRuntimeValue(command['fill'][1])/255, self.getRuntimeValue(command['fill'][2])/255)
@@ -301,13 +301,22 @@ class Graphics(Handler):
301
301
  # render {spec}
302
302
  def k_render(self, command):
303
303
  command['spec'] = self.nextValue()
304
+ command['parent'] = None
305
+ if self.peek() == 'in':
306
+ self.nextToken()
307
+ if self.nextIsSymbol():
308
+ command['parent'] = self.getSymbolRecord()['name']
304
309
  self.add(command)
305
310
  return True
306
311
 
307
312
  def r_render(self, command):
313
+ spec = self.getRuntimeValue(command['spec'])
314
+ parent = command['parent']
315
+ if parent !=None:
316
+ parent = self.getVariable(command['parent'])
308
317
  self.ui = self.renderer.getUI()
309
318
  try:
310
- ScreenSpec().render(self.getRuntimeValue(command['spec']), self.ui)
319
+ ScreenSpec().render(spec, parent, self.ui)
311
320
  except Exception as e:
312
321
  RuntimeError(self.program, e)
313
322
  return self.nextPC()
@@ -316,12 +325,6 @@ class Graphics(Handler):
316
325
  def k_run(self, command):
317
326
  if self.nextIs('graphics'):
318
327
  self.add(command)
319
- cmd = {}
320
- cmd['domain'] = 'graphics'
321
- cmd['lino'] = command['lino'] + 1
322
- cmd['keyword'] = 'getui'
323
- cmd['debug'] = False
324
- self.addCommand(cmd)
325
328
  return True
326
329
  return False
327
330