evm2term
Version:
Translates from Egg Virtual Machine (JSON) to a summarized AST term
105 lines • 2.1 kB
JSON
{
"type": "apply",
"operator": {
"type": "word",
"line": 1,
"col": 1,
"length": 2,
"name": "do"
},
"args": [
{
"type": "apply",
"operator": {
"type": "word",
"line": 2,
"col": 3,
"length": 3,
"name": "def"
},
"args": [
{
"type": "word",
"line": 2,
"col": 7,
"length": 1,
"name": "x"
},
{
"type": "apply",
"operator": {
"type": "word",
"line": 2,
"col": 10,
"length": 5,
"name": "array"
},
"args": [
{
"type": "value",
"value": "a"
},
{
"type": "value",
"value": "b"
},
{
"type": "value",
"value": "c"
}
]
}
]
},
{
"type": "apply",
"operator": {
"type": "word",
"line": 3,
"col": 3,
"length": 5,
"name": "print"
},
"args": [
{
"type": "apply",
"operator": {
"type": "property",
"operator": {
"type": "apply",
"operator": {
"type": "property",
"operator": {
"type": "word",
"line": 3,
"col": 9,
"length": 1,
"name": "x"
},
"args": [
{
"type": "value",
"value": "join"
}
]
},
"args": [
{
"type": "value",
"value": "-"
}
]
},
"args": [
{
"type": "value",
"value": "toUpperCase"
}
]
},
"args": []
}
]
}
]
}