Skip to content

Commit 5791596

Browse files
committed
Update
1 parent 70b62ff commit 5791596

2 files changed

Lines changed: 28 additions & 19 deletions

File tree

src/_BASE/e4x.md renamed to src/_BASE/s4x.md

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,41 @@
1-
# E4X
1+
# S4X
22

3-
ECMAScript for XML (E4X) comprises XML markup and XML data manipulation facilities.
3+
ShockScript for XML (S4X) comprises the XML capabilities of the ShockScript language.
44

55
## Markup
66

7-
XML markup is directly used in ActionScript for rendering reactive user interface.
7+
XML expressions by default are used for building implementation-defined objects; however, when the inference type is `XML` or `XMLList`, XML expressions result in one of these types.
88

99
```
1010
package me.diantha.portfolio {
1111
import j = jet.**;
1212
13-
/** Portfolio */
1413
public function Portfolio() {
1514
return (
16-
<>
17-
<j:VGroup gap={5}>
18-
<!-- content -->
19-
<j:Label>
20-
<markdown>
21-
Hi **there**.
22-
</markdown>
23-
</j:Label>
24-
</j:VGroup>
25-
</>
15+
<j:VGroup gap={5}>
16+
<!-- content -->
17+
<j:Label>
18+
<markdown>
19+
Hi **there**.
20+
</markdown>
21+
</j:Label>
22+
</j:VGroup>
23+
);
24+
}
25+
26+
public function data(a:String):XML {
27+
return (
28+
<tag>{a}</tag>
2629
);
2730
}
2831
}
32+
33+
const xn = XML(<tag/>);
2934
```
3035

31-
> **Note:** Unlike the E4X standard 2nd edition, markup does not result in `XML` or `XMLList` objects, but rather `ReactNode`; and there is support for `a` attributes without an attribute value, which equals `a={true}`.
36+
### Attributes
37+
38+
`<t a/>` is equivalent to `<t a={true}/>`.
3239

3340
### Event handlers
3441

@@ -56,7 +63,7 @@ It is additionally allowed to interpolate text or arbitrary markup inside a `<ma
5663
<!-- interpolate HTML -->
5764
Hi, <?html={personName}?>
5865

59-
<!-- interpolate Markdown (not XHTML) -->
66+
<!-- interpolate Markdown (use HTML tags; not XHTML tags) -->
6067
Hi, <?markdown={personName}?>
6168
</markdown>
6269
```

src/overview/as3.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,12 @@ class A {
9191

9292
## E4X
9393

94-
XML expressions do not produce `XML` or `XMLList`; they are implementation-defined. Such expressions have also undergone incremental syntax additions:
94+
XML expressions do not produce `XML` or `XMLList` unless the inference type is one of these; they are implementation-defined by default. Such expressions have also undergone incremental syntax additions:
9595

9696
- `<t a/>` equals `<t a={true}/>`
9797
- `<t e&={}/>` equals `<t e={function(event){}}/>` or `<t e={function(){}}/>`
98-
- `<?html={exp}?>` alternative for `{exp}`
99-
- `<?markdown={exp}?>` alternative for `{exp}`
98+
- `<?html={exp}?>` alternative for tag content `{exp}`
99+
- `<?markdown={exp}?>` alternative for tag content `{exp}`
100100

101101
> **Note**: Jet Engine translates XML expressions into nodes suitable for a graphical user interface.
102102
@@ -107,6 +107,8 @@ XML expressions do not produce `XML` or `XMLList`; they are implementation-defin
107107
</j:VGroup>
108108
```
109109

110+
> **Note**: `XML(<tag/>)` equals `var _loc_0:XML = <tag/>;`.
111+
110112
## Events
111113

112114
Events are declared without defining related static constants, as ShockScript performs vast type inference; thus, the ASDoc `@eventType` tag does not exist in ShockScript.

0 commit comments

Comments
 (0)