| 1 | <h2>Comments</h2> |
| 2 | <pre><code>;; Single line comment |
| 3 | (; Multi-line |
| 4 | comment ;)</code></pre> |
| 5 | |
| 6 | <h2>Strings</h2> |
| 7 | <pre><code>"" |
| 8 | "Foobar" |
| 9 | "Foo\"ba\\r"</code></pre> |
| 10 | |
| 11 | <h2>Numbers</h2> |
| 12 | <pre><code>42 |
| 13 | 3.1415 |
| 14 | 0.4E-4 |
| 15 | -3.1_41_5 |
| 16 | 0xBADFACE |
| 17 | 0xB_adF_a_c_e |
| 18 | +0x4E.F7 |
| 19 | 0xFFp+4 |
| 20 | inf |
| 21 | nan |
| 22 | nan:0xf4</code></pre> |
| 23 | |
| 24 | <h2>Keywords</h2> |
| 25 | <pre><code>(func (param i32) (param f32) (local f64) |
| 26 | get_local 0 |
| 27 | get_local 1 |
| 28 | get_local 2)</code></pre> |
| 29 | |
| 30 | <h2>Identifiers</h2> |
| 31 | <pre><code>$p |
| 32 | $getAnswer |
| 33 | $return_i32</code></pre> |
| 34 | |
| 35 | <h2>Full example</h2> |
| 36 | <pre><code>(module |
| 37 | (import "js" "memory" (memory 1)) |
| 38 | (import "js" "table" (table 1 anyfunc)) |
| 39 | (elem (i32.const 0) $shared0func) |
| 40 | (func $shared0func (result i32) |
| 41 | i32.const 0 |
| 42 | i32.load) |
| 43 | )</code></pre> |