Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
dy authored Dec 19, 2024
1 parent 62c375f commit 7b97cf6
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,26 +104,22 @@ const fn = compile(['+', ['*', 'min', [,60]], [,'sec']])
fn({min: 5}) // min*60 + "sec" == "300sec"

// node kinds
['+', a]; // unary operator `+a`
['+', a, b]; // binary operator `a + b`
['+', a, b, c]; // n-ary operator `a + b + c`
['()', a]; // group operator `(a)`
['()', a, b]; // access operator `a(b)`
[, a]; // literal value `'a'`
a; // variable (from scope)
null; // placeholder
['+', a]; // unary operator `+a`
['+', a, b]; // binary operator `a + b`
['+', a, b, c]; // n-ary operator `a + b + c`
['()', a]; // group operator `(a)`
['()', a, b]; // access operator `a(b)`
[, 'a']; // literal value `'a'`
a; // variable (from scope)
null; // placeholder

// eg.
['()', 'a'] // (a)
['()', 'a', null] // a()
```
<!--
['()'] // ()
['()', 'a'] // (a)
['()', 'a'] // (a)
['()', 'a',,] // a()
['()', 'a', 'b'] // a(b)
['+',1] // +1
['+',1,,] // 1+
-->
```

### Stringify

Expand Down

0 comments on commit 7b97cf6

Please sign in to comment.