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_class_method.py.ast

158 lines
3.8 KiB

{
"kind" : "Program",
"location" : [ 1, 1, 13, 4 ],
"declarations" : [ {
"kind" : "ClassDef",
"location" : [ 1, 1, 13, 0 ],
"name" : {
"kind" : "Identifier",
"location" : [ 1, 7, 1, 7 ],
"name" : "A"
},
"superClass" : {
"kind" : "Identifier",
"location" : [ 1, 9, 1, 14 ],
"name" : "object"
},
"declarations" : [ {
"kind" : "VarDef",
"location" : [ 2, 5, 2, 13 ],
"var" : {
"kind" : "TypedVar",
"location" : [ 2, 5, 2, 9 ],
"identifier" : {
"kind" : "Identifier",
"location" : [ 2, 5, 2, 5 ],
"name" : "x"
},
"type" : {
"kind" : "ClassType",
"location" : [ 2, 7, 2, 9 ],
"className" : "int"
}
},
"value" : {
"kind" : "IntegerLiteral",
"location" : [ 2, 13, 2, 13 ],
"value" : 1
}
}, {
"kind" : "FuncDef",
"location" : [ 4, 5, 5, 17 ],
"name" : {
"kind" : "Identifier",
"location" : [ 4, 9, 4, 11 ],
"name" : "foo"
},
"params" : [ {
"kind" : "TypedVar",
"location" : [ 4, 13, 4, 20 ],
"identifier" : {
"kind" : "Identifier",
"location" : [ 4, 13, 4, 16 ],
"name" : "self"
},
"type" : {
"kind" : "ClassType",
"location" : [ 4, 18, 4, 20 ],
"className" : "A"
}
} ],
"returnType" : {
"kind" : "ClassType",
"location" : [ 4, 26, 4, 28 ],
"className" : "int"
},
"declarations" : [ ],
"statements" : [ {
"kind" : "ReturnStmt",
"location" : [ 5, 9, 5, 16 ],
"value" : {
"kind" : "IntegerLiteral",
"location" : [ 5, 16, 5, 16 ],
"value" : 0
}
} ]
}, {
"kind" : "FuncDef",
"location" : [ 7, 5, 8, 17 ],
"name" : {
"kind" : "Identifier",
"location" : [ 7, 9, 7, 11 ],
"name" : "bar"
},
"params" : [ ],
"returnType" : {
"kind" : "ClassType",
"location" : [ 7, 18, 7, 20 ],
"className" : "int"
},
"declarations" : [ ],
"statements" : [ {
"kind" : "ReturnStmt",
"location" : [ 8, 9, 8, 16 ],
"value" : {
"kind" : "IntegerLiteral",
"location" : [ 8, 16, 8, 16 ],
"value" : 0
}
} ]
}, {
"kind" : "FuncDef",
"location" : [ 10, 5, 11, 17 ],
"name" : {
"kind" : "Identifier",
"location" : [ 10, 9, 10, 11 ],
"name" : "baz"
},
"params" : [ {
"kind" : "TypedVar",
"location" : [ 10, 13, 10, 20 ],
"identifier" : {
"kind" : "Identifier",
"location" : [ 10, 13, 10, 16 ],
"name" : "self"
},
"type" : {
"kind" : "ClassType",
"location" : [ 10, 18, 10, 20 ],
"className" : "int"
}
} ],
"returnType" : {
"kind" : "ClassType",
"location" : [ 10, 26, 10, 28 ],
"className" : "int"
},
"declarations" : [ ],
"statements" : [ {
"kind" : "ReturnStmt",
"location" : [ 11, 9, 11, 16 ],
"value" : {
"kind" : "IntegerLiteral",
"location" : [ 11, 16, 11, 16 ],
"value" : 0
}
} ]
} ]
} ],
"statements" : [ {
"kind" : "ExprStmt",
"location" : [ 13, 1, 13, 3 ],
"expr" : {
"kind" : "CallExpr",
"location" : [ 13, 1, 13, 3 ],
"function" : {
"kind" : "Identifier",
"location" : [ 13, 1, 13, 1 ],
"name" : "A"
},
"args" : [ ]
}
} ],
"errors" : {
"errors" : [ ],
"kind" : "Errors",
"location" : [ 0, 0, 0, 0 ]
}
}