You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
1.1 KiB
50 lines
1.1 KiB
3 years ago
|
{
|
||
|
"kind" : "Program",
|
||
|
"location" : [ 1, 1, 3, 9 ],
|
||
|
"declarations" : [ {
|
||
|
"kind" : "VarDef",
|
||
|
"location" : [ 1, 1, 1, 9 ],
|
||
|
"var" : {
|
||
|
"kind" : "TypedVar",
|
||
|
"location" : [ 1, 1, 1, 5 ],
|
||
|
"identifier" : {
|
||
|
"kind" : "Identifier",
|
||
|
"location" : [ 1, 1, 1, 1 ],
|
||
|
"name" : "x"
|
||
|
},
|
||
|
"type" : {
|
||
|
"kind" : "ClassType",
|
||
|
"location" : [ 1, 3, 1, 5 ],
|
||
|
"className" : "int"
|
||
|
}
|
||
|
},
|
||
|
"value" : {
|
||
|
"kind" : "IntegerLiteral",
|
||
|
"location" : [ 1, 9, 1, 9 ],
|
||
|
"inferredType" : {
|
||
|
"kind" : "ClassValueType",
|
||
|
"className" : "int"
|
||
|
},
|
||
|
"value" : 0
|
||
|
}
|
||
|
} ],
|
||
|
"statements" : [ {
|
||
|
"kind" : "ReturnStmt",
|
||
|
"location" : [ 3, 1, 3, 8 ],
|
||
|
"errorMsg" : "Return statement cannot appear at the top level",
|
||
|
"value" : {
|
||
|
"kind" : "Identifier",
|
||
|
"location" : [ 3, 8, 3, 8 ],
|
||
|
"name" : "x"
|
||
|
}
|
||
|
} ],
|
||
|
"errors" : {
|
||
|
"errors" : [ {
|
||
|
"kind" : "CompilerError",
|
||
|
"location" : [ 3, 1, 3, 8 ],
|
||
|
"message" : "Return statement cannot appear at the top level"
|
||
|
} ],
|
||
|
"kind" : "Errors",
|
||
|
"location" : [ 0, 0, 0, 0 ]
|
||
|
}
|
||
|
}
|