Skip to content
This repository has been archived by the owner on Apr 6, 2021. It is now read-only.

Fix example code for constructing ASTs. #27

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/treehugger/tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ Node.prototype.findNode = function(pos) {
*
* Example: Add(Num("1"), Num("2")) is constucted
* using new ConsNode(new ConsNode("Num", [new StringNode("1")]),
* new ConsNode("Num", [new StringNode("2")]))
* or, more briefly:
* tree.cons("Add", [tree.cons("Num", [ast.string("1"), ast.string("2")])])
* new ConsNode("Num", [new StringNode("2")]))
* or, equivalently:
* tree.cons("Add", [tree.cons("Num", [tree.string("1")]) , tree.cons("Num", [tree.string("2")])])
*/
function ConsNode(cons, children) {
this.cons = cons;
Expand Down