Skip to content

Commit 887d882

Browse files
committed
250612.1
1 parent e1abc20 commit 887d882

17 files changed

+92
-44
lines changed
Binary file not shown.

doc/core/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ There are three primary components to the language:
1010

1111
The core keywords are:
1212

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) [lock](keywords/lock.md) [module](keywords/module.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) [run](keywords/run.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) [unlock](keywords/unlock.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) [lock](keywords/lock.md) [log](keywords/log.md) [module](keywords/module.md) [multiply](keywords/multiply.md) [negate](keywords/negate.md) [on](keywords/on.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) [release](keywords/release.md) [replace](keywords/replace.md) [return](keywords/return.md) [run](keywords/run.md) [save](keywords/save.md) [script](keywords/script.md) [send](keywords/send.md) [set](keywords/set.md) [shuffle](keywords/shuffle.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) [unlock](keywords/unlock.md) [use](keywords/use.md) [variable](keywords/variable.md) [wait](keywords/wait.md) [while](keywords/while.md) [write](keywords/write.md)
1414

1515
The core values are:
1616

doc/core/keywords/negate.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
## Description:
88
Negates a numeric variable (multiplies its value by -1).
99

10-
Next: [open](open.md)
10+
Next: [on](on.md)
1111
Prev: [multiply](multiply.md)
1212

1313
[Back](../../README.md)

doc/core/keywords/on.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# on
2+
3+
## Syntax:
4+
`on message {action}`
5+
## Example:
6+
`on message go to HandleMessage`
7+
8+
## Description:
9+
When another script uses `send {message} to {module}` (see [send](send.md)) to send this module a message (a text string), the message is saved and the designated `{action}` is invoked. The message text can be retrieved using `the message`.
10+
11+
Next: [open](open.md)
12+
Prev: [negate](negate.md)
13+
14+
[Back](../../README.md)

doc/core/keywords/open.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@
2222
Opens a disk file for reading, writing or appending. Each of the [file](file.md) variables must be declared as such as in the example.
2323

2424
Next: [pop](pop.md)
25-
Prev: [negate](negate.md)
25+
Prev: [on](on.md)
2626

2727
[Back](../../README.md)

doc/core/keywords/release.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
## Description:
1010
Release the parent script. When a child module is run it blocks the parent from running until either it exits or it issues the `release parent` command. This allows it to do initialisation that cannot be interrupted but which may involve timed delays.
1111

12-
Next: [multiply](multiply.md)
13-
Prev: [lock](lock.md)
12+
Next: [replace](replace.md)
13+
Prev: [read](read.md)
1414

1515
[Back](../../README.md)

doc/core/keywords/script.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
## Description:
99
Provides a name for the script. Note that `name` is literal text, not a script variable.
1010

11-
Next: [set](set.md)
11+
Next: [send](send.md)
1212
Prev: [save](save.md)
1313

1414
[Back](../../README.md)

doc/core/keywords/send.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# send
2+
3+
## Syntax:
4+
`send {message} to {module}`
5+
## Examples:
6+
``send `No errors` to Main``
7+
8+
## Description:
9+
Sends a message to another script. See [on message](on.md).
10+
11+
Next: [set](set.md)
12+
Prev: [script](script.md)
13+
14+
[Back](../../README.md)

doc/core/keywords/set.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
-- Sets the encoding to be used by the [encode](../values/encode.md) and [decode](../values/decode.md) value handlers. The encoder options are `utf-8` and `base64`. The default is `utf-8` if none is set by the script.
2727

28-
Next: [split](split.md)
29-
Prev: [script](script.md)
28+
Next: [shuffle](shuffle.md)
29+
Prev: [send](send.md)
3030

3131
[Back](../../README.md)

doc/core/keywords/shuffle.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# shuffle
2+
3+
## Syntax:
4+
`shuffle {variable}`
5+
6+
## Example:
7+
`shuffle MyList`
8+
9+
## Description:
10+
Shuffles (reorders randomly) the contents of the named array.
11+
EasyCoder has two array mechanisms. One is to hold a single value comprising a list of items (typically expressed as a JSON list). This is the type that can be shuffled with this command.
12+
13+
The second mechanism is where any variable can have multiple elements, an internal `index` variable specifying which element is pointed to. This kind of array always acts like a single value, and cannot be shuffled. See [set the elements of](set.md).
14+
15+
Next: [split](split.md)
16+
Prev: [set](set.md)
17+
18+
[Back](../../README.md)

doc/core/keywords/split.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
Split a [variable](variable.md) containing a string into a number of parts on a given delimiter. The command sizes the variable to have as many elements as there are parts in the split string, and puts one part in each element.
1111

1212
Next: [stack](stack.md)
13-
Prev: [set](set.md)
13+
Prev: [shuffle](shuffle.md)
1414

1515
[Back](../../README.md)

doc/core/keywords/unlock.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# ulock
1+
# unlock
22

33
## Syntax:
44
`unlock {variable}`
@@ -9,7 +9,7 @@
99
## Description:
1010
Unlocks a locked variable to allow it to be modified. See also [lock](lock.md).
1111

12-
Next: [lock](lock.md)
13-
Prev: [init](init.md)
12+
Next: [use](use.md)
13+
Prev: [truncate](truncate.md)
1414

1515
[Back](../../README.md)

doc/core/keywords/use.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# use
2+
3+
## Syntax:
4+
`use {feature}`
5+
6+
## Examples:
7+
`use graphics`
8+
9+
## Description:
10+
This is a special directive that calls in special functionality that is a standard part of EasyCoder but not included in all cases. The only one currently available is `graphics`, which is not included automatically because some systems don't have a graphical interface. The new functionality extends the language to deal with the specific feature.
11+
12+
The `use` directive must always be placed at the top of a script, before any of its features have been called for.
13+
14+
Next: [variable](variable.md)
15+
Prev: [unlock](unlock.md)
16+
17+
[Back](../../README.md)

doc/core/keywords/variable.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ Declare a variable - an arbitrary storage item. Variables may hold string, numer
1212
Variables can be assigned any number of elements - see [set the elements](set.md). Each element can hold a data value of any of the 3 types above.
1313

1414
Next: [wait](wait.md)
15-
Prev: [unlock](toggle.md)
15+
Prev: [use](use.md)
1616

1717
[Back](../../README.md)

easycoder/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
from .ec_timestamp import *
1010
from .ec_value import *
1111

12-
__version__ = "250611.6"
12+
__version__ = "250612.1"

easycoder/ec_core.py

Lines changed: 15 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,6 @@ def r_append(self, command):
110110
self.putSymbolValue(target, val)
111111
return self.nextPC()
112112

113-
# Define an array
114-
def k_array(self, command):
115-
return self.compileVariable(command)
116-
117-
def r_array(self, command):
118-
return self.nextPC()
119-
120-
# Assertion
121113
#assert {condition} [with {message}]
122114
def k_assert(self, command):
123115
command['test'] = self.nextCondition()
@@ -896,13 +888,6 @@ def r_negate(self, command):
896888
self.putSymbolValue(symbolRecord, value)
897889
return self.nextPC()
898890

899-
# Define an object variable
900-
def k_object(self, command):
901-
return self.compileVariable(command)
902-
903-
def r_object(self, command):
904-
return self.nextPC()
905-
906891
# on message {action}
907892
def k_on(self, command):
908893
if self.nextIs('message'):
@@ -1187,6 +1172,16 @@ def r_read(self, command):
11871172
self.putSymbolValue(symbolRecord, value)
11881173
return self.nextPC()
11891174

1175+
# Release the parent script
1176+
def k_release(self, command):
1177+
if self.nextIs('parent'):
1178+
self.add(command)
1179+
return True
1180+
1181+
def r_release(self, command):
1182+
self.program.releaseParent()
1183+
return self.nextPC()
1184+
11901185
# Replace a substring
11911186
#replace {value} with {value} in {variable}
11921187
def k_replace(self, command):
@@ -1217,16 +1212,6 @@ def r_replace(self, command):
12171212
self.putSymbolValue(templateRecord, value)
12181213
return self.nextPC()
12191214

1220-
# Release the parent script
1221-
def k_release(self, command):
1222-
if self.nextIs('parent'):
1223-
self.add(command)
1224-
return True
1225-
1226-
def r_release(self, command):
1227-
self.program.releaseParent()
1228-
return self.nextPC()
1229-
12301215
# Return from subroutine
12311216
def k_return(self, command):
12321217
self.add(command)
@@ -1281,11 +1266,6 @@ def r_run(self, command):
12811266
p(path).start(parent, module, exports)
12821267
return 0
12831268

1284-
# Provide a name for the script
1285-
def k_script(self, command):
1286-
self.program.name = self.nextToken()
1287-
return True
1288-
12891269
# Save a value to a file
12901270
def k_save(self, command):
12911271
command['content'] = self.nextValue()
@@ -1350,6 +1330,11 @@ def r_save(self, command):
13501330
RuntimeError(self.program, f'Error: {errorReason}')
13511331
return self.nextPC()
13521332

1333+
# Provide a name for the script
1334+
def k_script(self, command):
1335+
self.program.name = self.nextToken()
1336+
return True
1337+
13531338
# Send a message to a module
13541339
def k_send(self, command):
13551340
command['message'] = self.nextValue()

0 commit comments

Comments
 (0)