Skip to content

Commit ddccef9

Browse files
rvolosatovslukewagner
authored andcommitted
ensure char it utf8-encoded
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
1 parent 733ac4c commit ddccef9

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

design/mvp/Binary.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ val(f32) ::= v:<core:f32> => (f32 v
370370
| 0x00 0x00 0xC0 0x7F => (f32 nan)
371371
val(f64) ::= v:<core:f64> => (f64 v) (if !isnan(v))
372372
| 0x00 0x00 0x00 0x00 0x00 0x00 0xF8 0x7F => (f64 nan)
373-
val(char) ::= v:<core:u32> => v (if v < 0xD800 or 0xE000 <= v <= 0x10FFFF)
373+
val(char) ::= b*:<core:byte>* => c (where b* = core:utf8(c))
374374
val(string) ::= v:<core:name> => v
375375
val(i:<typeidx>) ::= v:<val(type-index-space[i])> => v
376376
val((record (field l t)+)) ::= v+:<val(t)>+ => (record v+)
@@ -392,7 +392,7 @@ val((result t (error u))) ::= 0x00 v:<val(t)> => (ok v)
392392
```
393393

394394
Notes:
395-
* Reused Core binary rules:
395+
* Reused Core binary rules and functions:
396396
- [`core:name`]
397397
- [`core:s8`]
398398
- [`core:s16`]
@@ -405,6 +405,7 @@ Notes:
405405
- [`core:uN`]
406406
- [`core:f32`]
407407
- [`core:f64`]
408+
- [`core:utf8`]
408409
* `&` operator is used to denote bitwise AND operation, which performs AND on every bit of two numbers in their binary form
409410
* `isnan` is a function, which takes a floating point number as a parameter and returns `true` iff it represents a NaN as defined in [IEEE 754 standard]
410411
* `||B||` is the length of the byte sequence generated from the production `B` in a derivation as defined in [Core convention auxilary notation]
@@ -449,6 +450,7 @@ named once.
449450
[`core:uN`]: https://webassembly.github.io/spec/core/binary/values.html#integers
450451
[`core:f32`]: https://webassembly.github.io/spec/core/binary/values.html#floating-point
451452
[`core:f64`]: https://webassembly.github.io/spec/core/binary/values.html#floating-point
453+
[`core:utf8`]: https://webassembly.github.io/spec/core/binary/values.html#binary-utf8
452454
[`core:section`]: https://webassembly.github.io/spec/core/binary/modules.html#binary-section
453455
[`core:custom`]: https://webassembly.github.io/spec/core/binary/modules.html#custom-section
454456
[`core:module`]: https://webassembly.github.io/spec/core/binary/modules.html#binary-module

design/mvp/Explainer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1376,7 +1376,7 @@ val ::= false | true
13761376
| (f32 nan)
13771377
| (f64 <f64canon>)
13781378
| (f64 nan)
1379-
| '<core:char>'
1379+
| '<core:stringchar>'
13801380
| <core:name>
13811381
| (record <val>+)
13821382
| (variant "<label>" <val>?)

0 commit comments

Comments
 (0)