Skip to content

Instantly share code, notes, and snippets.

@lmuntaner
Created January 26, 2022 11:29
Show Gist options
  • Save lmuntaner/c9e35b81d20fdb3e257682c603f1e7ac to your computer and use it in GitHub Desktop.
Save lmuntaner/c9e35b81d20fdb3e257682c603f1e7ac to your computer and use it in GitHub Desktop.
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