mirror of
https://github.com/jamiebuilds/the-super-tiny-compiler.git
synced 2024-10-27 20:34:08 +00:00
Update the-super-tiny-compiler.js (#51)
Made some modifications to make the newly-added text fit into existing paragraphs.
This commit is contained in:
parent
a7f50205ee
commit
dee8b924ea
@ -275,8 +275,8 @@
|
|||||||
* CallExpression() {},
|
* CallExpression() {},
|
||||||
* };
|
* };
|
||||||
*
|
*
|
||||||
* When we traverse our AST we will call the methods on this visitor whenever we
|
* When we traverse our AST, we will call the methods on this visitor whenever we
|
||||||
* encounter a node of a matching type.
|
* "enter" a node of a matching type.
|
||||||
*
|
*
|
||||||
* In order to make this useful we will also pass the node and a reference to
|
* In order to make this useful we will also pass the node and a reference to
|
||||||
* the parent node.
|
* the parent node.
|
||||||
@ -286,10 +286,8 @@
|
|||||||
* CallExpression(node, parent) {},
|
* CallExpression(node, parent) {},
|
||||||
* };
|
* };
|
||||||
*
|
*
|
||||||
* We call these functions when we "enter" the node. But there is also the
|
* However, there also exists the possibilty of calling things on "exit". Imagine
|
||||||
* possibilty of calling things on "exit".
|
* our tree structure from before in list form:
|
||||||
*
|
|
||||||
* Imagine our tree structure from before in list form:
|
|
||||||
*
|
*
|
||||||
* - Program
|
* - Program
|
||||||
* - CallExpression
|
* - CallExpression
|
||||||
@ -315,7 +313,7 @@
|
|||||||
* <- CallExpression (exit)
|
* <- CallExpression (exit)
|
||||||
* <- Program (exit)
|
* <- Program (exit)
|
||||||
*
|
*
|
||||||
* In order to supper that, our visitors will look like this:
|
* In order to support that, the final form of our visitor will look like this:
|
||||||
*
|
*
|
||||||
* var visitor = {
|
* var visitor = {
|
||||||
* NumberLiteral: {
|
* NumberLiteral: {
|
||||||
|
Loading…
Reference in New Issue
Block a user