Skip to content

Instantly share code, notes, and snippets.

@matovitch
Created April 6, 2020 12:04
Show Gist options
  • Save matovitch/a2d57afb183da116cb96da30ff339912 to your computer and use it in GitHub Desktop.
Save matovitch/a2d57afb183da116cb96da30ff339912 to your computer and use it in GitHub Desktop.
{
"node": "Program",
"functions": [
{
"node": "Function",
"name": {
"node": "Identifier",
"lexeme": {
"node": "Lexeme",
"index": 42
}
},
"arguments": [
{
"node": "Type Claim",
"variable": {
"node": "Identifier",
"lexeme": {
"node": "Lexeme",
"index": 40
}
},
"type": {
"node": "Identifier",
"lexeme": {
"node": "Lexeme",
"index": 36
}
}
}
],
"returnType": {
"node": "Identifier",
"lexeme": {
"node": "Lexeme",
"index": 31
}
},
"body": [
{
"node": "Variable Declaration",
"typeClaim": {
"node": "Type Claim",
"variable": {
"node": "Identifier",
"lexeme": {
"node": "Lexeme",
"index": 25
}
},
"type": {
"node": "Identifier",
"lexeme": {
"node": "Lexeme",
"index": 21
}
}
}
},
{
"node": "Assignment",
"operator": {
"node": "Lexeme",
"index": 16
},
"lhs": {
"node": "Identifier",
"lexeme": {
"node": "Lexeme",
"index": 18
}
},
"rhs": {
"node": "Binary Operation",
"operator": {
"node": "Lexeme",
"index": 12
},
"lhs": {
"node": "Identifier",
"lexeme": {
"node": "Lexeme",
"index": 14
}
},
"rhs": {
"node": "Integer",
"lexeme": {
"node": "Lexeme",
"index": 10
}
}
}
},
{
"node": "Return Statement",
"expression": {
"node": "Identifier",
"lexeme": {
"node": "Lexeme",
"index": 5
}
}
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment