added the rest of the bnfs...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2026-01-18 05:29:30 +03:00
parent f103a37d74
commit 0db55b44d6

View File

@ -208,10 +208,8 @@ a reference by path to the first occurrence.
Format: Format:
```bnf ```bnf
<ref> ::= <ref> ::=
'<REF' <path> '>' '<REF[]>'
| '<REF[' <path-items> ']>'
<path> ::=
'[' <path-items> ']'
<path-items> ::= <path-items> ::=
<item> <item>
@ -300,6 +298,31 @@ serialize(-Infinity) // -> '-Infinity'
### Map / Set ### Map / Set
```bnf
<map> ::=
'Map([])
| 'Map([' <map-items> '])
<map-items> ::=
<map-item>
| <map-item> ',' <map-items>
<map-item> ::=
'[' <value> ',' <value> ']'
```
```bnf
<set> ::=
'Set([])
| 'Set([' <set-items> '])
<set-items> ::=
<value>
| <value> ',' <set-items>
```
```javascript ```javascript
serialize(new Set([1,2,3])) // -> 'Set([1,2,3])' serialize(new Set([1,2,3])) // -> 'Set([1,2,3])'
serialize(new Map([['a', 1], ['b', 2]])) // -> 'Map([["a",1],["b",2]])' serialize(new Map([['a', 1], ['b', 2]])) // -> 'Map([["a",1],["b",2]])'
@ -308,6 +331,18 @@ serialize(new Map([['a', 1], ['b', 2]])) // -> 'Map([["a",1],["b",2]])'
### Functions ### Functions
```bnf
<func> ::=
'<FUNC[' <length> ',(' <func-spec> ')]>
<func-spec> ::=
<code>
| <number>
<length> ::=
<number>
```
```javascript ```javascript
serialize(function(){}) // -> '<FUNC[14,(function(){})]>' serialize(function(){}) // -> '<FUNC[14,(function(){})]>'
``` ```