evm2term
Version:
Translates from Egg Virtual Machine (JSON) to a summarized AST term
286 lines • 5.92 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": 3,
"name": "map"
},
"args": [
{
"type": "value",
"value": "x",
"line": 2,
"col": 14,
"length": 1,
"raw": "\"x\""
},
{
"type": "value",
"value": 4,
"line": 2,
"col": 17,
"length": 1
},
{
"type": "value",
"value": "y",
"line": 2,
"col": 20,
"length": 1,
"raw": "\"y\""
},
{
"type": "apply",
"operator": {
"type": "word",
"line": 2,
"col": 23,
"length": 3,
"name": "map"
},
"args": [
{
"type": "value",
"value": "z",
"line": 2,
"col": 27,
"length": 1,
"raw": "\"z\""
},
{
"type": "value",
"value": 3,
"line": 2,
"col": 30,
"length": 1
}
]
}
]
}
]
},
{
"type": "apply",
"operator": {
"type": "word",
"line": 3,
"col": 3,
"length": 5,
"name": "print"
},
"args": [
{
"type": "word",
"line": 3,
"col": 9,
"length": 1,
"name": "x"
}
]
},
{
"type": "apply",
"operator": {
"type": "word",
"line": 4,
"col": 3,
"length": 5,
"name": "print"
},
"args": [
{
"type": "property",
"operator": {
"type": "word",
"line": 4,
"col": 9,
"length": 1,
"name": "x"
},
"args": [
{
"type": "value",
"value": "x",
"line": 4,
"col": 11,
"length": 3,
"raw": "\"x\""
}
]
}
]
},
{
"type": "apply",
"operator": {
"type": "word",
"line": 5,
"col": 3,
"length": 5,
"name": "print"
},
"args": [
{
"type": "property",
"operator": {
"type": "property",
"operator": {
"type": "word",
"line": 5,
"col": 9,
"length": 1,
"name": "x"
},
"args": [
{
"type": "value",
"value": "y",
"line": 5,
"col": 11,
"length": 3,
"raw": "\"y\""
}
]
},
"args": [
{
"type": "value",
"value": "z",
"line": 5,
"col": 16,
"length": 3,
"raw": "\"z\""
}
]
}
]
},
{
"type": "apply",
"operator": {
"type": "word",
"line": 6,
"col": 3,
"length": 3,
"name": "set"
},
"args": [
{
"type": "property",
"operator": {
"type": "property",
"operator": {
"type": "word",
"line": 6,
"col": 7,
"length": 1,
"name": "x"
},
"args": [
{
"type": "value",
"value": "y",
"line": 6,
"col": 9,
"length": 3,
"raw": "\"y\""
}
]
},
"args": [
{
"type": "value",
"value": "z",
"line": 6,
"col": 14,
"length": 3,
"raw": "\"z\""
}
]
},
{
"type": "value",
"value": 100,
"line": 6,
"col": 20,
"length": 3
}
]
},
{
"type": "apply",
"operator": {
"type": "word",
"line": 7,
"col": 3,
"length": 5,
"name": "print"
},
"args": [
{
"type": "property",
"operator": {
"type": "property",
"operator": {
"type": "word",
"line": 7,
"col": 9,
"length": 1,
"name": "x"
},
"args": [
{
"type": "value",
"value": "y",
"line": 7,
"col": 11,
"length": 3,
"raw": "\"y\""
}
]
},
"args": [
{
"type": "value",
"value": "z",
"line": 7,
"col": 16,
"length": 3,
"raw": "\"z\""
}
]
}
]
}
]
}