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.
ChocoPy/pa1-tests/core/stmt_for.py.ast

76 lines
1.7 KiB

{
"kind" : "Program",
"location" : [ 1, 1, 5, 1 ],
"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 ],
"value" : 0
}
} ],
"statements" : [ {
"kind" : "ForStmt",
"location" : [ 2, 1, 5, 1 ],
"identifier" : {
"kind" : "Identifier",
"location" : [ 2, 5, 2, 5 ],
"name" : "x"
},
"iterable" : {
"kind" : "ListExpr",
"location" : [ 2, 10, 2, 18 ],
"elements" : [ {
"kind" : "IntegerLiteral",
"location" : [ 2, 11, 2, 11 ],
"value" : 1
}, {
"kind" : "IntegerLiteral",
"location" : [ 2, 14, 2, 14 ],
"value" : 2
}, {
"kind" : "IntegerLiteral",
"location" : [ 2, 17, 2, 17 ],
"value" : 3
} ]
},
"body" : [ {
"kind" : "ExprStmt",
"location" : [ 3, 5, 3, 12 ],
"expr" : {
"kind" : "CallExpr",
"location" : [ 3, 5, 3, 12 ],
"function" : {
"kind" : "Identifier",
"location" : [ 3, 5, 3, 9 ],
"name" : "print"
},
"args" : [ {
"kind" : "Identifier",
"location" : [ 3, 11, 3, 11 ],
"name" : "x"
} ]
}
} ]
} ],
"errors" : {
"errors" : [ ],
"kind" : "Errors",
"location" : [ 0, 0, 0, 0 ]
}
}