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

229 lines
5.3 KiB

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