easycoder 250102.1__tar.gz → 250103.2__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.
- {easycoder-250102.1 → easycoder-250103.2}/PKG-INFO +1 -1
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/README.md +3 -1
- easycoder-250103.2/doc/core/conditions/boolean.md +16 -0
- easycoder-250103.2/doc/core/conditions/empty.md +15 -0
- easycoder-250103.2/doc/core/conditions/ends.md +15 -0
- easycoder-250103.2/doc/core/conditions/even.md +15 -0
- easycoder-250103.2/doc/core/conditions/exists.md +15 -0
- easycoder-250103.2/doc/core/conditions/greater.md +16 -0
- easycoder-250103.2/doc/core/conditions/hasProperty.md +15 -0
- easycoder-250103.2/doc/core/conditions/includes.md +15 -0
- easycoder-250103.2/doc/core/conditions/is.md +15 -0
- easycoder-250103.2/doc/core/conditions/less.md +16 -0
- easycoder-250103.2/doc/core/conditions/list.md +15 -0
- easycoder-250103.2/doc/core/conditions/none.md +15 -0
- easycoder-250103.2/doc/core/conditions/not.md +15 -0
- easycoder-250103.2/doc/core/conditions/numeric.md +15 -0
- easycoder-250103.2/doc/core/conditions/object.md +15 -0
- easycoder-250103.2/doc/core/conditions/odd.md +15 -0
- easycoder-250103.2/doc/core/conditions/starts.md +15 -0
- easycoder-250103.2/doc/core/conditions/string.md +15 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/keywords/input.md +1 -1
- easycoder-250103.2/doc/core/keywords/load.md +16 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/keywords/multiply.md +1 -1
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/keywords/return.md +1 -1
- easycoder-250103.2/doc/core/keywords/save.md +16 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/keywords/script.md +1 -1
- {easycoder-250102.1 → easycoder-250103.2}/easycoder/__init__.py +1 -1
- {easycoder-250102.1 → easycoder-250103.2}/easycoder/ec_core.py +91 -59
- {easycoder-250102.1 → easycoder-250103.2}/json/graphics-demo.json +2 -2
- {easycoder-250102.1 → easycoder-250103.2}/scripts/graphics-demo.ecg +1 -4
- {easycoder-250102.1 → easycoder-250103.2}/LICENSE +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/README.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/README.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/keywords/add.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/keywords/append.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/keywords/assert.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/keywords/begin.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/keywords/clear.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/keywords/close.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/keywords/create.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/keywords/debug.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/keywords/decrement.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/keywords/delete.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/keywords/divide.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/keywords/exit.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/keywords/file.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/keywords/fork.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/keywords/get.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/keywords/go.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/keywords/gosub.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/keywords/if.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/keywords/import.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/keywords/increment.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/keywords/index.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/keywords/init.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/keywords/negate.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/keywords/open.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/keywords/pop.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/keywords/post.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/keywords/print.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/keywords/push.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/keywords/put.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/keywords/read.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/keywords/replace.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/keywords/set.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/keywords/split.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/keywords/stack.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/keywords/stop.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/keywords/system.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/keywords/take.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/keywords/toggle.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/keywords/truncate.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/keywords/variable.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/keywords/wait.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/keywords/while.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/keywords/write.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/values/arg.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/values/args.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/values/cos.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/values/datime.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/values/decode.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/values/element.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/values/elements.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/values/empty.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/values/encode.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/values/error.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/values/files.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/values/float.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/values/from.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/values/hash.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/values/index.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/values/integer.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/values/json.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/values/keys.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/values/left.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/values/length.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/values/lowercase.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/values/memory.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/values/modification.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/values/modulo.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/values/newline.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/values/now.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/values/position.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/values/property.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/values/random.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/values/right.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/values/sin.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/values/stringify.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/values/tab.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/values/tan.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/values/timestamp.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/values/today.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/values/trim.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/values/type.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/values/uppercase.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/values/value.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/core/values/weekday.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/doc/graphics/README.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/easycoder/README.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/easycoder/ec.py +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/easycoder/ec_classes.py +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/easycoder/ec_compiler.py +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/easycoder/ec_condition.py +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/easycoder/ec_graphics.py +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/easycoder/ec_handler.py +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/easycoder/ec_program.py +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/easycoder/ec_renderer.py +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/easycoder/ec_screenspec.py +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/easycoder/ec_timestamp.py +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/easycoder/ec_value.py +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/images/Semoigo Dawn.jpg +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/plugins/ec_p100.py +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/plugins/example.py +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/pyproject.toml +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/scripts/README.md +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/scripts/benchmark.ecs +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/scripts/fizzbuzz.ecs +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/scripts/hello.ecs +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/scripts/points.ecs +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/scripts/tests.ecs +0 -0
- {easycoder-250102.1 → easycoder-250103.2}/scripts/wave.ecg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: easycoder
|
|
3
|
-
Version:
|
|
3
|
+
Version: 250103.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>
|
|
@@ -10,7 +10,7 @@ There are three primary components to the language:
|
|
|
10
10
|
|
|
11
11
|
The core keywords are:
|
|
12
12
|
|
|
13
|
-
[add](keywords/add.md) [append](keywords/append.md) [assert](keywords/assert.md) [begin](keywords/begin.md) [clear](keywords/clear.md) [close](keywords/close.md) [create](keywords/create.md) [debug](keywords/debug.md) [decrement](keywords/decrement.md) [delete](keywords/delete.md) [divide](keywords/divide.md) [exit](keywords/exit.md) [file](keywords/file.md) [fork](keywords/fork.md) [get](keywords/get.md) [go](keywords/go.md) [gosub](keywords/gosub.md) [if](keywords/if.md) [import](keywords/import.md) [increment](keywords/increment.md) [index](keywords/index.md) [init](keywords/init.md) [input](keywords/input.md) [multiply](keywords/multiply.md) [negate](keywords/negate.md) [open](keywords/open.md) [pop](keywords/pop.md) [post](keywords/post.md) [print](keywords/print.md) [push](keywords/push.md) [put](keywords/put.md) [read](keywords/read.md) [replace](keywords/replace.md) [return](keywords/return.md) [script](keywords/script.md) [set](keywords/set.md) [split](keywords/split.md) [stack](keywords/stack.md) [stop](keywords/stop.md) [system](keywords/system.md) [take](keywords/take.md) [toggle](keywords/toggle.md) [truncate](keywords/truncate.md) [variable](keywords/variable.md) [wait](keywords/wait.md) [while](keywords/while.md) [write](keywords/write.md)
|
|
13
|
+
[add](keywords/add.md) [append](keywords/append.md) [assert](keywords/assert.md) [begin](keywords/begin.md) [clear](keywords/clear.md) [close](keywords/close.md) [create](keywords/create.md) [debug](keywords/debug.md) [decrement](keywords/decrement.md) [delete](keywords/delete.md) [divide](keywords/divide.md) [exit](keywords/exit.md) [file](keywords/file.md) [fork](keywords/fork.md) [get](keywords/get.md) [go](keywords/go.md) [gosub](keywords/gosub.md) [if](keywords/if.md) [import](keywords/import.md) [increment](keywords/increment.md) [index](keywords/index.md) [init](keywords/init.md) [input](keywords/input.md) [load](keywords/load.md) [multiply](keywords/multiply.md) [negate](keywords/negate.md) [open](keywords/open.md) [pop](keywords/pop.md) [post](keywords/post.md) [print](keywords/print.md) [push](keywords/push.md) [put](keywords/put.md) [read](keywords/read.md) [replace](keywords/replace.md) [return](keywords/return.md) [save](keywords/save.md) [script](keywords/script.md) [set](keywords/set.md) [split](keywords/split.md) [stack](keywords/stack.md) [stop](keywords/stop.md) [system](keywords/system.md) [take](keywords/take.md) [toggle](keywords/toggle.md) [truncate](keywords/truncate.md) [variable](keywords/variable.md) [wait](keywords/wait.md) [while](keywords/while.md) [write](keywords/write.md)
|
|
14
14
|
|
|
15
15
|
The core values are:
|
|
16
16
|
|
|
@@ -18,4 +18,6 @@ The core values are:
|
|
|
18
18
|
|
|
19
19
|
The core conditions are:
|
|
20
20
|
|
|
21
|
+
[boolean](conditions/boolean.md) [empty](conditions/empty.md) [ends](conditions/ends.md) [even](conditions/even.md) [exists](conditions/exists.md) [greater](conditions/greater.md) [has property](conditions/hasProperty.md) [includes](conditions/includes.md) [is](conditions/is.md) [less](conditions/less.md) [list](conditions/list.md) [numeric](conditions/numeric.md) [none](conditions/none.md) [not](conditions/not.md) [object](conditions/object.md) [odd](conditions/odd.md) [starts](conditions/starts.md) [string](conditions/string.md)
|
|
22
|
+
|
|
21
23
|
[Back](../README.md)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# boolean
|
|
2
|
+
|
|
3
|
+
## Syntax:
|
|
4
|
+
`{value} is [not] boolean`
|
|
5
|
+
|
|
6
|
+
## Examples:
|
|
7
|
+
`if MyVariable is boolean stop`
|
|
8
|
+
``if `true` is boolean stop` ``
|
|
9
|
+
|
|
10
|
+
## Description:
|
|
11
|
+
Tests if the given value is boolean. The inclusion of `[not]` negates the test.
|
|
12
|
+
|
|
13
|
+
Next: [empty](empty.md)
|
|
14
|
+
Prev: [string](string.md)
|
|
15
|
+
|
|
16
|
+
[Back](../../README.md)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# empty
|
|
2
|
+
|
|
3
|
+
## Syntax:
|
|
4
|
+
`{value} is [not] empty`
|
|
5
|
+
|
|
6
|
+
## Examples:
|
|
7
|
+
`if MyVariable is empty stop`
|
|
8
|
+
|
|
9
|
+
## Description:
|
|
10
|
+
Tests if the given value is an empty string. The inclusion of `[not]` negates the test.
|
|
11
|
+
|
|
12
|
+
Next: [ends](ends.md)
|
|
13
|
+
Prev: [boolean](boolean.md)
|
|
14
|
+
|
|
15
|
+
[Back](../../README.md)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# ends
|
|
2
|
+
|
|
3
|
+
## Syntax:
|
|
4
|
+
`{value} ends with {text}`
|
|
5
|
+
|
|
6
|
+
## Examples:
|
|
7
|
+
``if MyVariable ends with `#` stop` ``
|
|
8
|
+
|
|
9
|
+
## Description:
|
|
10
|
+
Tests if the given value ends with a given string.
|
|
11
|
+
|
|
12
|
+
Next: [even](even.md)
|
|
13
|
+
Prev: [empty](empty.md)
|
|
14
|
+
|
|
15
|
+
[Back](../../README.md)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# even
|
|
2
|
+
|
|
3
|
+
## Syntax:
|
|
4
|
+
`{value} ends with {text}`
|
|
5
|
+
|
|
6
|
+
## Examples:
|
|
7
|
+
``if MyVariable ends with `#` stop` ``
|
|
8
|
+
|
|
9
|
+
## Description:
|
|
10
|
+
Tests if the given number is even. The inclusion of `[not]` negates the test, or you can use [odd](odd.md).
|
|
11
|
+
|
|
12
|
+
Next: [exists](exists.md)
|
|
13
|
+
Prev: [ends](ends.md)
|
|
14
|
+
|
|
15
|
+
[Back](../../README.md)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# greater
|
|
2
|
+
|
|
3
|
+
## Syntax:
|
|
4
|
+
`{value} is [not] greater than {other value}`
|
|
5
|
+
|
|
6
|
+
## Examples:
|
|
7
|
+
`if 10 is greater than 5 stop`
|
|
8
|
+
`if Value is not greater than 100 stop`
|
|
9
|
+
|
|
10
|
+
## Description:
|
|
11
|
+
Tests if the value is greater than the second value. The inclusion of `[not]` negates the test.
|
|
12
|
+
|
|
13
|
+
Next: [has property](hasProperty.md)
|
|
14
|
+
Prev: [exists](exists.md)
|
|
15
|
+
|
|
16
|
+
[Back](../../README.md)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# has property
|
|
2
|
+
|
|
3
|
+
## Syntax:
|
|
4
|
+
`{value} has property {property}`
|
|
5
|
+
|
|
6
|
+
## Examples:
|
|
7
|
+
``if Users has property `Andrew` stop` ``
|
|
8
|
+
|
|
9
|
+
## Description:
|
|
10
|
+
Tests if the value - usually a variable - has the named property as one of its attributes.
|
|
11
|
+
|
|
12
|
+
Next: [includes](includes.md)
|
|
13
|
+
Prev: [greater](greater.md)
|
|
14
|
+
|
|
15
|
+
[Back](../../README.md)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# includes
|
|
2
|
+
|
|
3
|
+
## Syntax:
|
|
4
|
+
`{value} includes {element}`
|
|
5
|
+
|
|
6
|
+
## Examples:
|
|
7
|
+
``if Animals includes `cat` stop` ``
|
|
8
|
+
|
|
9
|
+
## Description:
|
|
10
|
+
Tests if the array - usually a variable - has the named element as one of its members.
|
|
11
|
+
|
|
12
|
+
Next: [is](is.md)
|
|
13
|
+
Prev: [has property](hasProperty.md)
|
|
14
|
+
|
|
15
|
+
[Back](../../README.md)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# is
|
|
2
|
+
|
|
3
|
+
## Syntax:
|
|
4
|
+
`{value} is {second value}`
|
|
5
|
+
|
|
6
|
+
## Examples:
|
|
7
|
+
``if Animal is `cat` stop` ``
|
|
8
|
+
|
|
9
|
+
## Description:
|
|
10
|
+
Tests if the value is identical to the second value.
|
|
11
|
+
|
|
12
|
+
Next: [less](less.md)
|
|
13
|
+
Prev: [includes](includes.md)
|
|
14
|
+
|
|
15
|
+
[Back](../../README.md)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# less
|
|
2
|
+
|
|
3
|
+
## Syntax:
|
|
4
|
+
`{value} is [not] less than {other value}`
|
|
5
|
+
|
|
6
|
+
## Examples:
|
|
7
|
+
`if 10 is less than 5 stop`
|
|
8
|
+
`if Value is not less than 100 stop`
|
|
9
|
+
|
|
10
|
+
## Description:
|
|
11
|
+
Tests if the value is less than the second value. The inclusion of `[not]` negates the test.
|
|
12
|
+
|
|
13
|
+
Next: [list](less.md)
|
|
14
|
+
Prev: [is](is.md)
|
|
15
|
+
|
|
16
|
+
[Back](../../README.md)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# list
|
|
2
|
+
|
|
3
|
+
## Syntax:
|
|
4
|
+
`{value} is [not] list`
|
|
5
|
+
|
|
6
|
+
## Examples:
|
|
7
|
+
`if MyData is not list stop`
|
|
8
|
+
|
|
9
|
+
## Description:
|
|
10
|
+
Tests if the value is a list. The inclusion of `[not]` negates the test.
|
|
11
|
+
|
|
12
|
+
Next: [numeric](numeric.md)
|
|
13
|
+
Prev: [less](less.md)
|
|
14
|
+
|
|
15
|
+
[Back](../../README.md)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# none
|
|
2
|
+
|
|
3
|
+
## Syntax:
|
|
4
|
+
`{value} is [not] none`
|
|
5
|
+
|
|
6
|
+
## Examples:
|
|
7
|
+
`if MyData is not none stop`
|
|
8
|
+
|
|
9
|
+
## Description:
|
|
10
|
+
Tests if the value has the Python value `None`. The inclusion of `[not]` negates the test.
|
|
11
|
+
|
|
12
|
+
Next: [not](not.md)
|
|
13
|
+
Prev: [numeric](list.md)
|
|
14
|
+
|
|
15
|
+
[Back](../../README.md)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# not
|
|
2
|
+
|
|
3
|
+
## Syntax:
|
|
4
|
+
`{value} is not {second value}`
|
|
5
|
+
|
|
6
|
+
## Examples:
|
|
7
|
+
`if Value is not 100 stop`
|
|
8
|
+
|
|
9
|
+
## Description:
|
|
10
|
+
Tests if the value is not the same as the second value.
|
|
11
|
+
|
|
12
|
+
Next: [object](obect.md)
|
|
13
|
+
Prev: [none](none.md)
|
|
14
|
+
|
|
15
|
+
[Back](../../README.md)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# numeric
|
|
2
|
+
|
|
3
|
+
## Syntax:
|
|
4
|
+
`{value} is [not] numeric`
|
|
5
|
+
|
|
6
|
+
## Examples:
|
|
7
|
+
`if MyData is not numeric stop`
|
|
8
|
+
|
|
9
|
+
## Description:
|
|
10
|
+
Tests if the value is a numeric value. The inclusion of `[not]` negates the test.
|
|
11
|
+
|
|
12
|
+
Next: [none](none.md)
|
|
13
|
+
Prev: [list](list.md)
|
|
14
|
+
|
|
15
|
+
[Back](../../README.md)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# object
|
|
2
|
+
|
|
3
|
+
## Syntax:
|
|
4
|
+
`{value} is [not] object`
|
|
5
|
+
|
|
6
|
+
## Examples:
|
|
7
|
+
`if Value is object stop`
|
|
8
|
+
|
|
9
|
+
## Description:
|
|
10
|
+
Tests if the value is an object. The inclusion of `[not]` negates the test.
|
|
11
|
+
|
|
12
|
+
Next: [odd](odd.md)
|
|
13
|
+
Prev: [not](not.md)
|
|
14
|
+
|
|
15
|
+
[Back](../../README.md)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# odd
|
|
2
|
+
|
|
3
|
+
## Syntax:
|
|
4
|
+
`{value} is [not] odd`
|
|
5
|
+
|
|
6
|
+
## Examples:
|
|
7
|
+
`if Value is odd stop`
|
|
8
|
+
|
|
9
|
+
## Description:
|
|
10
|
+
Tests if the value is an odd number. The inclusion of `[not]` negates the test, or you can use [even](even.md).
|
|
11
|
+
|
|
12
|
+
Next: [starts](starts.md)
|
|
13
|
+
Prev: [object](object.md)
|
|
14
|
+
|
|
15
|
+
[Back](../../README.md)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# starts
|
|
2
|
+
|
|
3
|
+
## Syntax:
|
|
4
|
+
`{value} starts with {text}`
|
|
5
|
+
|
|
6
|
+
## Examples:
|
|
7
|
+
``if Value starts with `!` stop` ``
|
|
8
|
+
|
|
9
|
+
## Description:
|
|
10
|
+
Tests if the value starts with the given text.
|
|
11
|
+
|
|
12
|
+
Next: [string](string.md)
|
|
13
|
+
Prev: [odd](odd.md)
|
|
14
|
+
|
|
15
|
+
[Back](../../README.md)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# load
|
|
2
|
+
|
|
3
|
+
## Syntax:
|
|
4
|
+
`load {variable} from {path}`
|
|
5
|
+
|
|
6
|
+
## Examples:
|
|
7
|
+
``load Data from `mydata.txt` ``
|
|
8
|
+
`load Data from Path`
|
|
9
|
+
|
|
10
|
+
## Description:
|
|
11
|
+
Loads the contents of a file into a variable. See also [save](save.md).
|
|
12
|
+
|
|
13
|
+
Next: [multiply](multiply.md)
|
|
14
|
+
Prev: [init](init.md)
|
|
15
|
+
|
|
16
|
+
[Back](../../README.md)
|
|
@@ -11,6 +11,6 @@
|
|
|
11
11
|
Multiplies a numeric variable by a numeric value or multiplies one value by another and puts the result into a variable. See elsewhere in this documentation for an explanation of what is meant by a value. If you multiply a variable it must already hold a numeric value, and if you assign a variable to hold the result of a multiplication it will lose whatever value it previously held.
|
|
12
12
|
|
|
13
13
|
Next: [negate](negate.md)
|
|
14
|
-
Prev: [
|
|
14
|
+
Prev: [load](load.md)
|
|
15
15
|
|
|
16
16
|
[Back](../../README.md)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# save
|
|
2
|
+
|
|
3
|
+
## Syntax:
|
|
4
|
+
`save {value} to {filename}`
|
|
5
|
+
|
|
6
|
+
## Examples:
|
|
7
|
+
``save Data to `mydata.txt` ``
|
|
8
|
+
`save Data to FileName`
|
|
9
|
+
|
|
10
|
+
## Description:
|
|
11
|
+
Saves data to a file. See also [load](load.md).
|
|
12
|
+
|
|
13
|
+
Next: [set](set.md)
|
|
14
|
+
Prev: [return](return.md)
|
|
15
|
+
|
|
16
|
+
[Back](../../README.md)
|
|
@@ -646,6 +646,28 @@ class Core(Handler):
|
|
|
646
646
|
self.putSymbolValue(symbolRecord, value)
|
|
647
647
|
return self.nextPC()
|
|
648
648
|
|
|
649
|
+
# Load a variable from a file
|
|
650
|
+
def k_load(self, command):
|
|
651
|
+
if self.nextIsSymbol():
|
|
652
|
+
command['target'] = self.getToken()
|
|
653
|
+
if self.nextIs('from'):
|
|
654
|
+
command['file'] = self.nextValue()
|
|
655
|
+
self.add(command)
|
|
656
|
+
return True
|
|
657
|
+
return False
|
|
658
|
+
|
|
659
|
+
def r_load(self, command):
|
|
660
|
+
target = self.getVariable(command['target'])
|
|
661
|
+
file = self.getRuntimeValue(command['file'])
|
|
662
|
+
f = open(file, 'r')
|
|
663
|
+
content = f.read()
|
|
664
|
+
f.close()
|
|
665
|
+
value = {}
|
|
666
|
+
value['type'] = 'text'
|
|
667
|
+
value['content'] = content
|
|
668
|
+
self.putSymbolValue(target, value)
|
|
669
|
+
return self.nextPC()
|
|
670
|
+
|
|
649
671
|
# Arithmetic multiply
|
|
650
672
|
# multiply {variable} by {value}[ giving {variable}]}
|
|
651
673
|
def k_multiply(self, command):
|
|
@@ -1021,6 +1043,23 @@ class Core(Handler):
|
|
|
1021
1043
|
self.program.name = self.nextToken()
|
|
1022
1044
|
return True
|
|
1023
1045
|
|
|
1046
|
+
# Save a value to a file
|
|
1047
|
+
def k_save(self, command):
|
|
1048
|
+
command['content'] = self.nextValue()
|
|
1049
|
+
if self.nextIs('to'):
|
|
1050
|
+
command['file'] = self.nextValue()
|
|
1051
|
+
self.add(command)
|
|
1052
|
+
return True
|
|
1053
|
+
return False
|
|
1054
|
+
|
|
1055
|
+
def r_save(self, command):
|
|
1056
|
+
content = self.getRuntimeValue(command['content'])
|
|
1057
|
+
file = self.getRuntimeValue(command['file'])
|
|
1058
|
+
f = open(file, 'w')
|
|
1059
|
+
f.write(content)
|
|
1060
|
+
f.close()
|
|
1061
|
+
return self.nextPC()
|
|
1062
|
+
|
|
1024
1063
|
# Set a value
|
|
1025
1064
|
# set {variable}
|
|
1026
1065
|
# set the elements of {variable} to {value}
|
|
@@ -2021,19 +2060,12 @@ class Core(Handler):
|
|
|
2021
2060
|
value['content'] = json.dumps(item)
|
|
2022
2061
|
return value
|
|
2023
2062
|
|
|
2063
|
+
# This is used by the expression evaluator to get the value of a symbol
|
|
2024
2064
|
def v_symbol(self, symbolRecord):
|
|
2025
2065
|
result = {}
|
|
2026
2066
|
if symbolRecord['keyword'] == 'variable':
|
|
2027
2067
|
symbolValue = self.getSymbolValue(symbolRecord)
|
|
2028
2068
|
return symbolValue
|
|
2029
|
-
# if symbolValue == None:
|
|
2030
|
-
# return None
|
|
2031
|
-
# result['type'] = symbolValue['type']
|
|
2032
|
-
# content = symbolValue['content']
|
|
2033
|
-
# if content == None:
|
|
2034
|
-
# return ''
|
|
2035
|
-
# result['content'] = content
|
|
2036
|
-
# return result
|
|
2037
2069
|
else:
|
|
2038
2070
|
return None
|
|
2039
2071
|
|
|
@@ -2211,20 +2243,59 @@ class Core(Handler):
|
|
|
2211
2243
|
return True if condition.negate else False
|
|
2212
2244
|
return False
|
|
2213
2245
|
|
|
2214
|
-
def
|
|
2215
|
-
|
|
2246
|
+
def c_empty(self, condition):
|
|
2247
|
+
value = self.getRuntimeValue(condition.value1)
|
|
2248
|
+
if value == None:
|
|
2249
|
+
comparison = True
|
|
2250
|
+
else:
|
|
2251
|
+
comparison = len(value) == 0
|
|
2216
2252
|
return not comparison if condition.negate else comparison
|
|
2217
2253
|
|
|
2218
|
-
def
|
|
2219
|
-
|
|
2220
|
-
|
|
2254
|
+
def c_ends(self, condition):
|
|
2255
|
+
value1 = self.getRuntimeValue(condition.value1)
|
|
2256
|
+
value2 = self.getRuntimeValue(condition.value2)
|
|
2257
|
+
return value1.endswith(value2)
|
|
2258
|
+
|
|
2259
|
+
def c_even(self, condition):
|
|
2260
|
+
return self.getRuntimeValue(condition.value1) % 2 == 0
|
|
2261
|
+
|
|
2262
|
+
def c_exists(self, condition):
|
|
2263
|
+
path = self.getRuntimeValue(condition.path)
|
|
2264
|
+
return os.path.exists(path)
|
|
2265
|
+
|
|
2266
|
+
def c_greater(self, condition):
|
|
2267
|
+
comparison = self.program.compare(condition.value1, condition.value2)
|
|
2268
|
+
return comparison <= 0 if condition.negate else comparison > 0
|
|
2269
|
+
|
|
2270
|
+
def c_hasProperty(self, condition):
|
|
2271
|
+
value = self.getRuntimeValue(condition.value1)
|
|
2272
|
+
prop = self.getRuntimeValue(condition.property)
|
|
2273
|
+
try:
|
|
2274
|
+
value[prop]
|
|
2275
|
+
hasProp = True
|
|
2276
|
+
except:
|
|
2277
|
+
hasProp = False
|
|
2278
|
+
return hasProp
|
|
2279
|
+
|
|
2280
|
+
def c_includes(self, condition):
|
|
2281
|
+
value1 = self.getRuntimeValue(condition.value1)
|
|
2282
|
+
value2 = self.getRuntimeValue(condition.value2)
|
|
2283
|
+
return value2 in value1
|
|
2284
|
+
|
|
2285
|
+
def c_is(self, condition):
|
|
2286
|
+
comparison = self.program.compare(condition.value1, condition.value2)
|
|
2287
|
+
return comparison != 0 if condition.negate else comparison == 0
|
|
2288
|
+
|
|
2289
|
+
def c_less(self, condition):
|
|
2290
|
+
comparison = self.program.compare(condition.value1, condition.value2)
|
|
2291
|
+
return comparison >= 0 if condition.negate else comparison < 0
|
|
2221
2292
|
|
|
2222
2293
|
def c_list(self, condition):
|
|
2223
2294
|
comparison = type(self.getRuntimeValue(condition.value1)) is list
|
|
2224
2295
|
return not comparison if condition.negate else comparison
|
|
2225
2296
|
|
|
2226
|
-
def
|
|
2227
|
-
comparison = type(self.getRuntimeValue(condition.value1)) is
|
|
2297
|
+
def c_numeric(self, condition):
|
|
2298
|
+
comparison = type(self.getRuntimeValue(condition.value1)) is int
|
|
2228
2299
|
return not comparison if condition.negate else comparison
|
|
2229
2300
|
|
|
2230
2301
|
def c_none(self, condition):
|
|
@@ -2234,58 +2305,19 @@ class Core(Handler):
|
|
|
2234
2305
|
def c_not(self, condition):
|
|
2235
2306
|
return not self.getRuntimeValue(condition.value1)
|
|
2236
2307
|
|
|
2237
|
-
def
|
|
2238
|
-
|
|
2308
|
+
def c_object(self, condition):
|
|
2309
|
+
comparison = type(self.getRuntimeValue(condition.value1)) is dict
|
|
2310
|
+
return not comparison if condition.negate else comparison
|
|
2239
2311
|
|
|
2240
2312
|
def c_odd(self, condition):
|
|
2241
2313
|
return self.getRuntimeValue(condition.value1) % 2 == 1
|
|
2242
2314
|
|
|
2243
|
-
def c_is(self, condition):
|
|
2244
|
-
comparison = self.program.compare(condition.value1, condition.value2)
|
|
2245
|
-
return comparison != 0 if condition.negate else comparison == 0
|
|
2246
|
-
|
|
2247
|
-
def c_greater(self, condition):
|
|
2248
|
-
comparison = self.program.compare(condition.value1, condition.value2)
|
|
2249
|
-
return comparison <= 0 if condition.negate else comparison > 0
|
|
2250
|
-
|
|
2251
|
-
def c_less(self, condition):
|
|
2252
|
-
comparison = self.program.compare(condition.value1, condition.value2)
|
|
2253
|
-
return comparison >= 0 if condition.negate else comparison < 0
|
|
2254
|
-
|
|
2255
2315
|
def c_starts(self, condition):
|
|
2256
2316
|
value1 = self.getRuntimeValue(condition.value1)
|
|
2257
2317
|
value2 = self.getRuntimeValue(condition.value2)
|
|
2258
2318
|
return value1.startswith(value2)
|
|
2259
2319
|
|
|
2260
|
-
def
|
|
2261
|
-
|
|
2262
|
-
value2 = self.getRuntimeValue(condition.value2)
|
|
2263
|
-
return value1.endswith(value2)
|
|
2264
|
-
|
|
2265
|
-
def c_includes(self, condition):
|
|
2266
|
-
value1 = self.getRuntimeValue(condition.value1)
|
|
2267
|
-
value2 = self.getRuntimeValue(condition.value2)
|
|
2268
|
-
return value2 in value1
|
|
2269
|
-
|
|
2270
|
-
def c_empty(self, condition):
|
|
2271
|
-
value = self.getRuntimeValue(condition.value1)
|
|
2272
|
-
if value == None:
|
|
2273
|
-
comparison = True
|
|
2274
|
-
else:
|
|
2275
|
-
comparison = len(value) == 0
|
|
2320
|
+
def c_string(self, condition):
|
|
2321
|
+
comparison = type(self.getRuntimeValue(condition.value1)) is str
|
|
2276
2322
|
return not comparison if condition.negate else comparison
|
|
2277
|
-
|
|
2278
|
-
def c_exists(self, condition):
|
|
2279
|
-
path = self.getRuntimeValue(condition.path)
|
|
2280
|
-
return os.path.exists(path)
|
|
2281
|
-
|
|
2282
|
-
def c_hasProperty(self, condition):
|
|
2283
|
-
value = self.getRuntimeValue(condition.value1)
|
|
2284
|
-
prop = self.getRuntimeValue(condition.property)
|
|
2285
|
-
try:
|
|
2286
|
-
value[prop]
|
|
2287
|
-
hasProp = True
|
|
2288
|
-
except:
|
|
2289
|
-
hasProp = False
|
|
2290
|
-
return hasProp
|
|
2291
2323
|
# xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
ellipse RedEllipse
|
|
7
7
|
ellipse GreenCircle
|
|
8
8
|
image Image
|
|
9
|
-
file File
|
|
10
9
|
variable Spec
|
|
11
10
|
variable UpDown
|
|
12
11
|
variable Steps
|
|
@@ -26,9 +25,7 @@
|
|
|
26
25
|
create window title `Learning Kivy` at 300 300 size 640 480 fill color 255 255 200
|
|
27
26
|
run graphics
|
|
28
27
|
|
|
29
|
-
|
|
30
|
-
read Spec from File
|
|
31
|
-
close File
|
|
28
|
+
load Spec from `json/graphics-demo.json`
|
|
32
29
|
render Spec
|
|
33
30
|
|
|
34
31
|
attach BlueRect to `bluerect`
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|