Skip to content

Commit

Permalink
protip about block syntax for wrap()
Browse files Browse the repository at this point in the history
  • Loading branch information
James Halliday committed Jun 15, 2011
1 parent 4e41619 commit 4ea19c1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,14 @@ should return a new stringified expression.
If the `node.name === "binary"`, you get the subterms "%a" and "%b" to play with
too. These subterms are applied if `s` is a function too: `s(expr, a, b)`.

Protip: to insert multiple statements you can use javascript's lesser-known block
syntax that it gets from C:

````javascript
if (node.name === 'stat') node.wrap('{ foo(); %s }')
node.wrap('')
````

node.node
---------

Expand Down

0 comments on commit 4ea19c1

Please sign in to comment.