Skip to content

Commit 0578ec7

Browse files
committed
Update memory/segment definition in README
1 parent 3d2937a commit 0578ec7

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

ml-proto/README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -187,22 +187,22 @@ case:
187187
( case <value> <expr>* fallthrough? ) ;; = (case <int> (block <expr>*) fallthrough?)
188188
( case <value> ) ;; = (case <int> (nop) fallthrough)
189189
190-
func: ( func <name>? <param>* <result>? <local>* <expr>* )
191-
param: ( param <type>* ) | ( param <name> <type> )
192-
result: ( result <type> )
193-
local: ( local <type>* ) | ( local <name> <type> )
194-
195-
module: ( module <func>* <global>* <export>* <table>* <memory>? <data>* )
196-
export: ( export "<char>*" <var> )
197-
global: ( global <type>* ) | ( global <name> <type> )
198-
table: ( table <var>* )
199-
memory: ( memory <int> <int>? )
200-
data: ( data "<char>*" )
190+
func: ( func <name>? <param>* <result>? <local>* <expr>* )
191+
param: ( param <type>* ) | ( param <name> <type> )
192+
result: ( result <type> )
193+
local: ( local <type>* ) | ( local <name> <type> )
194+
195+
module: ( module <func>* <global>* <export>* <table>* <memory>? )
196+
export: ( export "<char>*" <var> )
197+
global: ( global <type>* ) | ( global <name> <type> )
198+
table: ( table <var>* )
199+
memory: ( memory <int> <int>? <segment>* )
200+
segment: ( segment <int> "<char>*" )
201201
```
202202

203203
Here, productions marked with respective comments are abbreviation forms for equivalent expansions.
204204

205-
The data string is used to initialise the lower end of the memory. It is an ASCII string, that can have the usual escape sequences, or hex escapes of the form `\xx` to denote a single byte.
205+
The segment string is used to initialise the memory at the given offset. It is an ASCII string, but also can contain escape sequences. The supported escape codes are `\n` (newline), '\t' (tab), `\\` (backslash), `\'` (single quote) or `\"` (double quote). To denote an arbitrary byte, use a hex escape of the form `\xx`.
206206

207207
Comments can be written in one of two ways:
208208

0 commit comments

Comments
 (0)