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/src/test/data/pa2/student_contributed/bad_types.py.ast

94 lines
2.1 KiB

{
"kind" : "Program",
"location" : [ 1, 1, 5, 20 ],
"declarations" : [ {
"kind" : "VarDef",
"location" : [ 1, 1, 1, 12 ],
"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" : "BooleanLiteral",
"location" : [ 1, 9, 1, 12 ],
"value" : true
}
} ],
"statements" : [ {
"kind" : "ExprStmt",
"location" : [ 2, 1, 2, 7 ],
"expr" : {
"kind" : "BinaryExpr",
"location" : [ 2, 1, 2, 7 ],
"left" : {
"kind" : "Identifier",
"location" : [ 2, 1, 2, 1 ],
"name" : "x"
},
"operator" : "+",
"right" : {
"kind" : "ListExpr",
"location" : [ 2, 5, 2, 7 ],
"elements" : [ {
"kind" : "IntegerLiteral",
"location" : [ 2, 6, 2, 6 ],
"value" : 1
} ]
}
}
}, {
"kind" : "AssignStmt",
"location" : [ 4, 3, 4, 14 ],
"targets" : [ {
"kind" : "Identifier",
"location" : [ 4, 3, 4, 6 ],
"name" : "bool"
} ],
"value" : {
"kind" : "BooleanLiteral",
"location" : [ 4, 10, 4, 14 ],
"value" : false
}
}, {
"kind" : "AssignStmt",
"location" : [ 5, 1, 5, 19 ],
"targets" : [ {
"kind" : "Identifier",
"location" : [ 5, 1, 5, 1 ],
"name" : "x"
}, {
"kind" : "Identifier",
"location" : [ 5, 5, 5, 5 ],
"name" : "y"
}, {
"kind" : "Identifier",
"location" : [ 5, 9, 5, 9 ],
"name" : "z"
} ],
"value" : {
"kind" : "StringLiteral",
"location" : [ 5, 13, 5, 19 ],
"value" : "Error"
}
} ],
"errors" : {
"errors" : [ {
"kind" : "CompilerError",
"location" : [ 4, 2, 4, 2 ],
"message" : "Parse error near token COLON: :",
"syntax" : true
} ],
"kind" : "Errors",
"location" : [ 0, 0, 0, 0 ]
}
}