summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2019-01-07 00:10:17 -0800
committerOri Bernstein <ori@eigenstate.org>2019-01-07 00:10:17 -0800
commitaf63c8fc4082fca2b5148cb55a6870ac926660e4 (patch)
treefbc4a1129ed7e6c6f7de4ff0005dcc43e4c11319 /doc
parenta2644d1d980e0f1c5439dce7764f0d051cf4cc41 (diff)
downloadmc-af63c8fc4082fca2b5148cb55a6870ac926660e4.tar.gz
Change indexed array literal syntax.
Diffstat (limited to 'doc')
-rw-r--r--doc/lang.txt6
1 files changed, 3 insertions, 3 deletions
diff --git a/doc/lang.txt b/doc/lang.txt
index 4b7c482..0a38c00 100644
--- a/doc/lang.txt
+++ b/doc/lang.txt
@@ -998,7 +998,7 @@ TABLE OF CONTENTS:
tuplit: "(" tuplelts ")"
structelts: ("." ident "=" expr)+
- arrayelts: (expr ":" expr | expr)*
+ arrayelts: ("." "[" expr "]" "=" expr | expr)*
tupelts: expr ("," expr)* [","]
Sequence literals are used to initialize either a structure
@@ -1026,7 +1026,7 @@ TABLE OF CONTENTS:
An unindexed initializer sequence is simply a comma separated
list of values. An indexed initializer sequence contains a
- '#number=value' comma separated sequence, which indicates the
+ '.[index]=value' comma separated sequence, which indicates the
index of the array into which the value is inserted. A named
initializer sequence contains a comma separated list of
'.name=value' pairs.
@@ -1039,7 +1039,7 @@ TABLE OF CONTENTS:
[.a = 42, .b="str"]
Example: Array literal:
- [1,2,3], [2:3, 1:2, 0:1], []
+ [1,2,3], [.[2] = 3, .[1] = 2, .[0] = 1], []
Example: Tuple literals:
(1,), (1,'b',"three")