Skip to content

Instantly share code, notes, and snippets.

@lmuntaner
Created Jan 26, 2022
Embed
What would you like to do?
Test Simple AST
const num = 10;
{
"type": "Program",
"start": 0,
"end": 15,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 15
}
},
"body": [
{
"type": "VariableDeclaration",
"start": 0,
"end": 15,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 15
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 6,
"end": 14,
"loc": {
"start": {
"line": 1,
"column": 6
},
"end": {
"line": 1,
"column": 14
}
},
"id": {
"type": "Identifier",
"start": 6,
"end": 9,
"loc": {
"start": {
"line": 1,
"column": 6
},
"end": {
"line": 1,
"column": 9
}
},
"name": "num"
},
"init": {
"type": "Literal",
"start": 12,
"end": 14,
"loc": {
"start": {
"line": 1,
"column": 12
},
"end": {
"line": 1,
"column": 14
}
},
"value": 10,
"raw": "10"
}
}
],
"kind": "const"
}
],
"sourceType": "script"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment