Created
March 27, 2011 17:48
-
-
Save leto/889410 to your computer and use it in GitHub Desktop.
Jaspers AST
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(sarkomand)(~/git/jaspers master* )$ node jaspers.js | |
{ type: 'Program', | |
elements: | |
[ { type: 'VariableStatement', declarations: [Object] }, | |
{ type: 'FunctionCall', name: [Object], arguments: [] }, | |
{ type: 'VariableStatement', declarations: [Object] }, | |
{ type: 'VariableStatement', declarations: [Object] }, | |
{ type: 'Function', | |
name: 'bar', | |
params: [Object], | |
elements: [Object] }, | |
{ type: 'FunctionCall', | |
name: [Object], | |
arguments: [Object] } ] } | |
{ type: 'VariableDeclaration', | |
name: 'f', | |
value: | |
{ type: 'Function', | |
name: null, | |
params: [], | |
elements: [ [Object] ] } } | |
[ { type: 'ReturnStatement', | |
value: { type: 'NumericLiteral', value: 42 } } ] | |
(sarkomand)(~/git/jaspers master )$ cat test.js | |
var f = function() { | |
return 42; | |
}; | |
f(); | |
var num1 = 3.14; | |
var num2 = "Inf"; | |
function bar(x) { return 55; } | |
bar(52); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment