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/pa3-tests/core/stmt_for_list_empty.py.ast....

318 lines
7.6 KiB

{
"kind" : "Program",
"location" : [ 1, 1, 13, 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 ],
"inferredType" : {
"kind" : "ClassValueType",
"className" : "int"
},
"value" : 0
}
}, {
"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 ],
"inferredType" : {
"kind" : "ClassValueType",
"className" : "int"
},
"value" : 0
}
}, {
"kind" : "VarDef",
"location" : [ 3, 1, 3, 14 ],
"var" : {
"kind" : "TypedVar",
"location" : [ 3, 1, 3, 7 ],
"identifier" : {
"kind" : "Identifier",
"location" : [ 3, 1, 3, 1 ],
"name" : "z"
},
"type" : {
"kind" : "ListType",
"location" : [ 3, 3, 3, 7 ],
"elementType" : {
"kind" : "ClassType",
"location" : [ 3, 4, 3, 6 ],
"className" : "int"
}
}
},
"value" : {
"kind" : "NoneLiteral",
"location" : [ 3, 11, 3, 14 ],
"inferredType" : {
"kind" : "ClassValueType",
"className" : "<None>"
}
}
}, {
"kind" : "VarDef",
"location" : [ 4, 1, 4, 14 ],
"var" : {
"kind" : "TypedVar",
"location" : [ 4, 1, 4, 7 ],
"identifier" : {
"kind" : "Identifier",
"location" : [ 4, 1, 4, 1 ],
"name" : "e"
},
"type" : {
"kind" : "ListType",
"location" : [ 4, 3, 4, 7 ],
"elementType" : {
"kind" : "ClassType",
"location" : [ 4, 4, 4, 6 ],
"className" : "int"
}
}
},
"value" : {
"kind" : "NoneLiteral",
"location" : [ 4, 11, 4, 14 ],
"inferredType" : {
"kind" : "ClassValueType",
"className" : "<None>"
}
}
} ],
"statements" : [ {
"kind" : "AssignStmt",
"location" : [ 6, 1, 6, 11 ],
"targets" : [ {
"kind" : "Identifier",
"location" : [ 6, 1, 6, 1 ],
"inferredType" : {
"kind" : "ListValueType",
"elementType" : {
"kind" : "ClassValueType",
"className" : "int"
}
},
"name" : "z"
} ],
"value" : {
"kind" : "ListExpr",
"location" : [ 6, 5, 6, 11 ],
"inferredType" : {
"kind" : "ListValueType",
"elementType" : {
"kind" : "ClassValueType",
"className" : "int"
}
},
"elements" : [ {
"kind" : "IntegerLiteral",
"location" : [ 6, 6, 6, 6 ],
"inferredType" : {
"kind" : "ClassValueType",
"className" : "int"
},
"value" : 1
}, {
"kind" : "IntegerLiteral",
"location" : [ 6, 8, 6, 8 ],
"inferredType" : {
"kind" : "ClassValueType",
"className" : "int"
},
"value" : 2
}, {
"kind" : "IntegerLiteral",
"location" : [ 6, 10, 6, 10 ],
"inferredType" : {
"kind" : "ClassValueType",
"className" : "int"
},
"value" : 3
} ]
}
}, {
"kind" : "AssignStmt",
"location" : [ 7, 1, 7, 6 ],
"targets" : [ {
"kind" : "Identifier",
"location" : [ 7, 1, 7, 1 ],
"inferredType" : {
"kind" : "ListValueType",
"elementType" : {
"kind" : "ClassValueType",
"className" : "int"
}
},
"name" : "e"
} ],
"value" : {
"kind" : "ListExpr",
"location" : [ 7, 5, 7, 6 ],
"inferredType" : {
"kind" : "ClassValueType",
"className" : "<Empty>"
},
"elements" : [ ]
}
}, {
"kind" : "ForStmt",
"location" : [ 9, 1, 13, 1 ],
"identifier" : {
"kind" : "Identifier",
"location" : [ 9, 5, 9, 5 ],
"inferredType" : {
"kind" : "ClassValueType",
"className" : "int"
},
"name" : "x"
},
"iterable" : {
"kind" : "Identifier",
"location" : [ 9, 10, 9, 10 ],
"inferredType" : {
"kind" : "ListValueType",
"elementType" : {
"kind" : "ClassValueType",
"className" : "int"
}
},
"name" : "z"
},
"body" : [ {
"kind" : "ForStmt",
"location" : [ 10, 5, 12, 4 ],
"identifier" : {
"kind" : "Identifier",
"location" : [ 10, 9, 10, 9 ],
"inferredType" : {
"kind" : "ClassValueType",
"className" : "int"
},
"name" : "y"
},
"iterable" : {
"kind" : "Identifier",
"location" : [ 10, 14, 10, 14 ],
"inferredType" : {
"kind" : "ListValueType",
"elementType" : {
"kind" : "ClassValueType",
"className" : "int"
}
},
"name" : "e"
},
"body" : [ {
"kind" : "ExprStmt",
"location" : [ 11, 9, 11, 22 ],
"expr" : {
"kind" : "CallExpr",
"location" : [ 11, 9, 11, 22 ],
"inferredType" : {
"kind" : "ClassValueType",
"className" : "<None>"
},
"function" : {
"kind" : "Identifier",
"location" : [ 11, 9, 11, 13 ],
"inferredType" : {
"kind" : "FuncType",
"parameters" : [ {
"kind" : "ClassValueType",
"className" : "object"
} ],
"returnType" : {
"kind" : "ClassValueType",
"className" : "<None>"
}
},
"name" : "print"
},
"args" : [ {
"kind" : "StringLiteral",
"location" : [ 11, 15, 11, 21 ],
"inferredType" : {
"kind" : "ClassValueType",
"className" : "str"
},
"value" : "Never"
} ]
}
} ]
}, {
"kind" : "ExprStmt",
"location" : [ 12, 5, 12, 12 ],
"expr" : {
"kind" : "CallExpr",
"location" : [ 12, 5, 12, 12 ],
"inferredType" : {
"kind" : "ClassValueType",
"className" : "<None>"
},
"function" : {
"kind" : "Identifier",
"location" : [ 12, 5, 12, 9 ],
"inferredType" : {
"kind" : "FuncType",
"parameters" : [ {
"kind" : "ClassValueType",
"className" : "object"
} ],
"returnType" : {
"kind" : "ClassValueType",
"className" : "<None>"
}
},
"name" : "print"
},
"args" : [ {
"kind" : "Identifier",
"location" : [ 12, 11, 12, 11 ],
"inferredType" : {
"kind" : "ClassValueType",
"className" : "int"
},
"name" : "x"
} ]
}
} ]
} ],
"errors" : {
"errors" : [ ],
"kind" : "Errors",
"location" : [ 0, 0, 0, 0 ]
}
}