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.
192 lines
4.6 KiB
192 lines
4.6 KiB
{
|
|
"kind" : "Program",
|
|
"location" : [ 1, 1, 6, 8 ],
|
|
"declarations" : [ {
|
|
"kind" : "VarDef",
|
|
"location" : [ 1, 1, 1, 14 ],
|
|
"var" : {
|
|
"kind" : "TypedVar",
|
|
"location" : [ 1, 1, 1, 7 ],
|
|
"identifier" : {
|
|
"kind" : "Identifier",
|
|
"location" : [ 1, 1, 1, 1 ],
|
|
"name" : "x"
|
|
},
|
|
"type" : {
|
|
"kind" : "ListType",
|
|
"location" : [ 1, 3, 1, 7 ],
|
|
"elementType" : {
|
|
"kind" : "ClassType",
|
|
"location" : [ 1, 4, 1, 6 ],
|
|
"className" : "int"
|
|
}
|
|
}
|
|
},
|
|
"value" : {
|
|
"kind" : "NoneLiteral",
|
|
"location" : [ 1, 11, 1, 14 ],
|
|
"inferredType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "<None>"
|
|
}
|
|
}
|
|
}, {
|
|
"kind" : "VarDef",
|
|
"location" : [ 2, 1, 2, 17 ],
|
|
"var" : {
|
|
"kind" : "TypedVar",
|
|
"location" : [ 2, 1, 2, 10 ],
|
|
"identifier" : {
|
|
"kind" : "Identifier",
|
|
"location" : [ 2, 1, 2, 1 ],
|
|
"name" : "y"
|
|
},
|
|
"type" : {
|
|
"kind" : "ListType",
|
|
"location" : [ 2, 3, 2, 10 ],
|
|
"elementType" : {
|
|
"kind" : "ClassType",
|
|
"location" : [ 2, 4, 2, 9 ],
|
|
"className" : "object"
|
|
}
|
|
}
|
|
},
|
|
"value" : {
|
|
"kind" : "NoneLiteral",
|
|
"location" : [ 2, 14, 2, 17 ],
|
|
"inferredType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "<None>"
|
|
}
|
|
}
|
|
} ],
|
|
"statements" : [ {
|
|
"kind" : "AssignStmt",
|
|
"location" : [ 4, 1, 4, 13 ],
|
|
"targets" : [ {
|
|
"kind" : "Identifier",
|
|
"location" : [ 4, 1, 4, 1 ],
|
|
"inferredType" : {
|
|
"kind" : "ListValueType",
|
|
"elementType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "int"
|
|
}
|
|
},
|
|
"name" : "x"
|
|
} ],
|
|
"value" : {
|
|
"kind" : "ListExpr",
|
|
"location" : [ 4, 5, 4, 13 ],
|
|
"inferredType" : {
|
|
"kind" : "ListValueType",
|
|
"elementType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "int"
|
|
}
|
|
},
|
|
"elements" : [ {
|
|
"kind" : "IntegerLiteral",
|
|
"location" : [ 4, 6, 4, 6 ],
|
|
"inferredType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "int"
|
|
},
|
|
"value" : 1
|
|
}, {
|
|
"kind" : "IntegerLiteral",
|
|
"location" : [ 4, 9, 4, 9 ],
|
|
"inferredType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "int"
|
|
},
|
|
"value" : 2
|
|
}, {
|
|
"kind" : "IntegerLiteral",
|
|
"location" : [ 4, 12, 4, 12 ],
|
|
"inferredType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "int"
|
|
},
|
|
"value" : 3
|
|
} ]
|
|
}
|
|
}, {
|
|
"kind" : "AssignStmt",
|
|
"location" : [ 5, 1, 5, 5 ],
|
|
"errorMsg" : "Expected type `[object]`; got type `[int]`",
|
|
"targets" : [ {
|
|
"kind" : "Identifier",
|
|
"location" : [ 5, 1, 5, 1 ],
|
|
"inferredType" : {
|
|
"kind" : "ListValueType",
|
|
"elementType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "object"
|
|
}
|
|
},
|
|
"name" : "y"
|
|
} ],
|
|
"value" : {
|
|
"kind" : "Identifier",
|
|
"location" : [ 5, 5, 5, 5 ],
|
|
"inferredType" : {
|
|
"kind" : "ListValueType",
|
|
"elementType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "int"
|
|
}
|
|
},
|
|
"name" : "x"
|
|
}
|
|
}, {
|
|
"kind" : "AssignStmt",
|
|
"location" : [ 6, 1, 6, 7 ],
|
|
"errorMsg" : "Expected type `[object]`; got type `[int]`",
|
|
"targets" : [ {
|
|
"kind" : "Identifier",
|
|
"location" : [ 6, 1, 6, 1 ],
|
|
"inferredType" : {
|
|
"kind" : "ListValueType",
|
|
"elementType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "object"
|
|
}
|
|
},
|
|
"name" : "y"
|
|
} ],
|
|
"value" : {
|
|
"kind" : "ListExpr",
|
|
"location" : [ 6, 5, 6, 7 ],
|
|
"inferredType" : {
|
|
"kind" : "ListValueType",
|
|
"elementType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "int"
|
|
}
|
|
},
|
|
"elements" : [ {
|
|
"kind" : "IntegerLiteral",
|
|
"location" : [ 6, 6, 6, 6 ],
|
|
"inferredType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "int"
|
|
},
|
|
"value" : 1
|
|
} ]
|
|
}
|
|
} ],
|
|
"errors" : {
|
|
"errors" : [ {
|
|
"kind" : "CompilerError",
|
|
"location" : [ 5, 1, 5, 5 ],
|
|
"message" : "Expected type `[object]`; got type `[int]`"
|
|
}, {
|
|
"kind" : "CompilerError",
|
|
"location" : [ 6, 1, 6, 7 ],
|
|
"message" : "Expected type `[object]`; got type `[int]`"
|
|
} ],
|
|
"kind" : "Errors",
|
|
"location" : [ 0, 0, 0, 0 ]
|
|
}
|
|
} |