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/pa2-tests/core/bad_local_assign.py.ast

253 lines
5.8 KiB

{
"kind" : "Program",
"location" : [ 1, 1, 22, 7 ],
"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" : 1
}
}, {
"kind" : "VarDef",
"location" : [ 2, 1, 2, 9 ],
"var" : {
"kind" : "TypedVar",
"location" : [ 2, 1, 2, 5 ],
"identifier" : {
"kind" : "Identifier",
"location" : [ 2, 1, 2, 1 ],
"name" : "y"
},
"type" : {
"kind" : "ClassType",
"location" : [ 2, 3, 2, 5 ],
"className" : "int"
}
},
"value" : {
"kind" : "IntegerLiteral",
"location" : [ 2, 9, 2, 9 ],
"value" : 2
}
}, {
"kind" : "VarDef",
"location" : [ 3, 1, 3, 9 ],
"var" : {
"kind" : "TypedVar",
"location" : [ 3, 1, 3, 5 ],
"identifier" : {
"kind" : "Identifier",
"location" : [ 3, 1, 3, 1 ],
"name" : "z"
},
"type" : {
"kind" : "ClassType",
"location" : [ 3, 3, 3, 5 ],
"className" : "int"
}
},
"value" : {
"kind" : "IntegerLiteral",
"location" : [ 3, 9, 3, 9 ],
"value" : 3
}
}, {
"kind" : "FuncDef",
"location" : [ 5, 1, 15, 9 ],
"name" : {
"kind" : "Identifier",
"location" : [ 5, 5, 5, 7 ],
"name" : "foo"
},
"params" : [ {
"kind" : "TypedVar",
"location" : [ 5, 9, 5, 13 ],
"identifier" : {
"kind" : "Identifier",
"location" : [ 5, 9, 5, 9 ],
"name" : "x"
},
"type" : {
"kind" : "ClassType",
"location" : [ 5, 11, 5, 13 ],
"className" : "int"
}
} ],
"returnType" : {
"kind" : "ClassType",
"location" : [ 5, 19, 5, 24 ],
"className" : "object"
},
"declarations" : [ {
"kind" : "VarDef",
"location" : [ 6, 5, 6, 13 ],
"var" : {
"kind" : "TypedVar",
"location" : [ 6, 5, 6, 9 ],
"identifier" : {
"kind" : "Identifier",
"location" : [ 6, 5, 6, 5 ],
"name" : "y"
},
"type" : {
"kind" : "ClassType",
"location" : [ 6, 7, 6, 9 ],
"className" : "int"
}
},
"value" : {
"kind" : "IntegerLiteral",
"location" : [ 6, 13, 6, 13 ],
"value" : 4
}
}, {
"kind" : "GlobalDecl",
"location" : [ 7, 5, 7, 12 ],
"variable" : {
"kind" : "Identifier",
"location" : [ 7, 12, 7, 12 ],
"name" : "z"
}
}, {
"kind" : "FuncDef",
"location" : [ 9, 5, 11, 17 ],
"name" : {
"kind" : "Identifier",
"location" : [ 9, 9, 9, 11 ],
"name" : "qux"
},
"params" : [ ],
"returnType" : {
"kind" : "ClassType",
"location" : [ 9, 18, 9, 20 ],
"className" : "int"
},
"declarations" : [ ],
"statements" : [ {
"kind" : "AssignStmt",
"location" : [ 10, 9, 10, 13 ],
"targets" : [ {
"kind" : "Identifier",
"location" : [ 10, 9, 10, 9 ],
"name" : "y"
} ],
"value" : {
"kind" : "IntegerLiteral",
"location" : [ 10, 13, 10, 13 ],
"value" : 1
}
}, {
"kind" : "ReturnStmt",
"location" : [ 11, 9, 11, 16 ],
"value" : {
"kind" : "IntegerLiteral",
"location" : [ 11, 16, 11, 16 ],
"value" : 0
}
} ]
} ],
"statements" : [ {
"kind" : "AssignStmt",
"location" : [ 13, 5, 13, 9 ],
"targets" : [ {
"kind" : "Identifier",
"location" : [ 13, 5, 13, 5 ],
"name" : "z"
} ],
"value" : {
"kind" : "IntegerLiteral",
"location" : [ 13, 9, 13, 9 ],
"value" : 1
}
} ]
}, {
"kind" : "FuncDef",
"location" : [ 17, 1, 19, 13 ],
"name" : {
"kind" : "Identifier",
"location" : [ 17, 5, 17, 7 ],
"name" : "bar"
},
"params" : [ {
"kind" : "TypedVar",
"location" : [ 17, 9, 17, 13 ],
"identifier" : {
"kind" : "Identifier",
"location" : [ 17, 9, 17, 9 ],
"name" : "x"
},
"type" : {
"kind" : "ClassType",
"location" : [ 17, 11, 17, 13 ],
"className" : "int"
}
} ],
"returnType" : {
"kind" : "ClassType",
"location" : [ 17, 19, 17, 21 ],
"className" : "int"
},
"declarations" : [ ],
"statements" : [ {
"kind" : "AssignStmt",
"location" : [ 18, 5, 18, 9 ],
"targets" : [ {
"kind" : "Identifier",
"location" : [ 18, 5, 18, 5 ],
"name" : "z"
} ],
"value" : {
"kind" : "IntegerLiteral",
"location" : [ 18, 9, 18, 9 ],
"value" : 1
}
}, {
"kind" : "ReturnStmt",
"location" : [ 19, 5, 19, 12 ],
"value" : {
"kind" : "Identifier",
"location" : [ 19, 12, 19, 12 ],
"name" : "x"
}
} ]
} ],
"statements" : [ {
"kind" : "ExprStmt",
"location" : [ 22, 1, 22, 6 ],
"expr" : {
"kind" : "CallExpr",
"location" : [ 22, 1, 22, 6 ],
"function" : {
"kind" : "Identifier",
"location" : [ 22, 1, 22, 3 ],
"name" : "foo"
},
"args" : [ {
"kind" : "IntegerLiteral",
"location" : [ 22, 5, 22, 5 ],
"value" : 1
} ]
}
} ],
"errors" : {
"errors" : [ ],
"kind" : "Errors",
"location" : [ 0, 0, 0, 0 ]
}
}