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.
711 lines
18 KiB
711 lines
18 KiB
{
|
|
"kind" : "Program",
|
|
"location" : [ 1, 1, 16, 14 ],
|
|
"declarations" : [ {
|
|
"kind" : "VarDef",
|
|
"location" : [ 1, 1, 1, 10 ],
|
|
"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, 10 ],
|
|
"inferredType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "int"
|
|
},
|
|
"value" : 42
|
|
}
|
|
}, {
|
|
"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" : 7
|
|
}
|
|
} ],
|
|
"statements" : [ {
|
|
"kind" : "ExprStmt",
|
|
"location" : [ 4, 1, 4, 13 ],
|
|
"expr" : {
|
|
"kind" : "CallExpr",
|
|
"location" : [ 4, 1, 4, 13 ],
|
|
"inferredType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "<None>"
|
|
},
|
|
"function" : {
|
|
"kind" : "Identifier",
|
|
"location" : [ 4, 1, 4, 5 ],
|
|
"inferredType" : {
|
|
"kind" : "FuncType",
|
|
"parameters" : [ {
|
|
"kind" : "ClassValueType",
|
|
"className" : "object"
|
|
} ],
|
|
"returnType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "<None>"
|
|
}
|
|
},
|
|
"name" : "print"
|
|
},
|
|
"args" : [ {
|
|
"kind" : "BinaryExpr",
|
|
"location" : [ 4, 7, 4, 12 ],
|
|
"inferredType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "bool"
|
|
},
|
|
"left" : {
|
|
"kind" : "Identifier",
|
|
"location" : [ 4, 7, 4, 7 ],
|
|
"inferredType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "int"
|
|
},
|
|
"name" : "x"
|
|
},
|
|
"operator" : "==",
|
|
"right" : {
|
|
"kind" : "Identifier",
|
|
"location" : [ 4, 12, 4, 12 ],
|
|
"inferredType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "int"
|
|
},
|
|
"name" : "y"
|
|
}
|
|
} ]
|
|
}
|
|
}, {
|
|
"kind" : "ExprStmt",
|
|
"location" : [ 5, 1, 5, 13 ],
|
|
"expr" : {
|
|
"kind" : "CallExpr",
|
|
"location" : [ 5, 1, 5, 13 ],
|
|
"inferredType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "<None>"
|
|
},
|
|
"function" : {
|
|
"kind" : "Identifier",
|
|
"location" : [ 5, 1, 5, 5 ],
|
|
"inferredType" : {
|
|
"kind" : "FuncType",
|
|
"parameters" : [ {
|
|
"kind" : "ClassValueType",
|
|
"className" : "object"
|
|
} ],
|
|
"returnType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "<None>"
|
|
}
|
|
},
|
|
"name" : "print"
|
|
},
|
|
"args" : [ {
|
|
"kind" : "BinaryExpr",
|
|
"location" : [ 5, 7, 5, 12 ],
|
|
"inferredType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "bool"
|
|
},
|
|
"left" : {
|
|
"kind" : "Identifier",
|
|
"location" : [ 5, 7, 5, 7 ],
|
|
"inferredType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "int"
|
|
},
|
|
"name" : "x"
|
|
},
|
|
"operator" : "!=",
|
|
"right" : {
|
|
"kind" : "Identifier",
|
|
"location" : [ 5, 12, 5, 12 ],
|
|
"inferredType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "int"
|
|
},
|
|
"name" : "y"
|
|
}
|
|
} ]
|
|
}
|
|
}, {
|
|
"kind" : "ExprStmt",
|
|
"location" : [ 6, 1, 6, 12 ],
|
|
"expr" : {
|
|
"kind" : "CallExpr",
|
|
"location" : [ 6, 1, 6, 12 ],
|
|
"inferredType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "<None>"
|
|
},
|
|
"function" : {
|
|
"kind" : "Identifier",
|
|
"location" : [ 6, 1, 6, 5 ],
|
|
"inferredType" : {
|
|
"kind" : "FuncType",
|
|
"parameters" : [ {
|
|
"kind" : "ClassValueType",
|
|
"className" : "object"
|
|
} ],
|
|
"returnType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "<None>"
|
|
}
|
|
},
|
|
"name" : "print"
|
|
},
|
|
"args" : [ {
|
|
"kind" : "BinaryExpr",
|
|
"location" : [ 6, 7, 6, 11 ],
|
|
"inferredType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "bool"
|
|
},
|
|
"left" : {
|
|
"kind" : "Identifier",
|
|
"location" : [ 6, 7, 6, 7 ],
|
|
"inferredType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "int"
|
|
},
|
|
"name" : "x"
|
|
},
|
|
"operator" : "<",
|
|
"right" : {
|
|
"kind" : "Identifier",
|
|
"location" : [ 6, 11, 6, 11 ],
|
|
"inferredType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "int"
|
|
},
|
|
"name" : "y"
|
|
}
|
|
} ]
|
|
}
|
|
}, {
|
|
"kind" : "ExprStmt",
|
|
"location" : [ 7, 1, 7, 13 ],
|
|
"expr" : {
|
|
"kind" : "CallExpr",
|
|
"location" : [ 7, 1, 7, 13 ],
|
|
"inferredType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "<None>"
|
|
},
|
|
"function" : {
|
|
"kind" : "Identifier",
|
|
"location" : [ 7, 1, 7, 5 ],
|
|
"inferredType" : {
|
|
"kind" : "FuncType",
|
|
"parameters" : [ {
|
|
"kind" : "ClassValueType",
|
|
"className" : "object"
|
|
} ],
|
|
"returnType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "<None>"
|
|
}
|
|
},
|
|
"name" : "print"
|
|
},
|
|
"args" : [ {
|
|
"kind" : "BinaryExpr",
|
|
"location" : [ 7, 7, 7, 12 ],
|
|
"inferredType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "bool"
|
|
},
|
|
"left" : {
|
|
"kind" : "Identifier",
|
|
"location" : [ 7, 7, 7, 7 ],
|
|
"inferredType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "int"
|
|
},
|
|
"name" : "x"
|
|
},
|
|
"operator" : "<=",
|
|
"right" : {
|
|
"kind" : "Identifier",
|
|
"location" : [ 7, 12, 7, 12 ],
|
|
"inferredType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "int"
|
|
},
|
|
"name" : "y"
|
|
}
|
|
} ]
|
|
}
|
|
}, {
|
|
"kind" : "ExprStmt",
|
|
"location" : [ 8, 1, 8, 12 ],
|
|
"expr" : {
|
|
"kind" : "CallExpr",
|
|
"location" : [ 8, 1, 8, 12 ],
|
|
"inferredType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "<None>"
|
|
},
|
|
"function" : {
|
|
"kind" : "Identifier",
|
|
"location" : [ 8, 1, 8, 5 ],
|
|
"inferredType" : {
|
|
"kind" : "FuncType",
|
|
"parameters" : [ {
|
|
"kind" : "ClassValueType",
|
|
"className" : "object"
|
|
} ],
|
|
"returnType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "<None>"
|
|
}
|
|
},
|
|
"name" : "print"
|
|
},
|
|
"args" : [ {
|
|
"kind" : "BinaryExpr",
|
|
"location" : [ 8, 7, 8, 11 ],
|
|
"inferredType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "bool"
|
|
},
|
|
"left" : {
|
|
"kind" : "Identifier",
|
|
"location" : [ 8, 7, 8, 7 ],
|
|
"inferredType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "int"
|
|
},
|
|
"name" : "x"
|
|
},
|
|
"operator" : ">",
|
|
"right" : {
|
|
"kind" : "Identifier",
|
|
"location" : [ 8, 11, 8, 11 ],
|
|
"inferredType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "int"
|
|
},
|
|
"name" : "y"
|
|
}
|
|
} ]
|
|
}
|
|
}, {
|
|
"kind" : "ExprStmt",
|
|
"location" : [ 9, 1, 9, 13 ],
|
|
"expr" : {
|
|
"kind" : "CallExpr",
|
|
"location" : [ 9, 1, 9, 13 ],
|
|
"inferredType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "<None>"
|
|
},
|
|
"function" : {
|
|
"kind" : "Identifier",
|
|
"location" : [ 9, 1, 9, 5 ],
|
|
"inferredType" : {
|
|
"kind" : "FuncType",
|
|
"parameters" : [ {
|
|
"kind" : "ClassValueType",
|
|
"className" : "object"
|
|
} ],
|
|
"returnType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "<None>"
|
|
}
|
|
},
|
|
"name" : "print"
|
|
},
|
|
"args" : [ {
|
|
"kind" : "BinaryExpr",
|
|
"location" : [ 9, 7, 9, 12 ],
|
|
"inferredType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "bool"
|
|
},
|
|
"left" : {
|
|
"kind" : "Identifier",
|
|
"location" : [ 9, 7, 9, 7 ],
|
|
"inferredType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "int"
|
|
},
|
|
"name" : "x"
|
|
},
|
|
"operator" : ">=",
|
|
"right" : {
|
|
"kind" : "Identifier",
|
|
"location" : [ 9, 12, 9, 12 ],
|
|
"inferredType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "int"
|
|
},
|
|
"name" : "y"
|
|
}
|
|
} ]
|
|
}
|
|
}, {
|
|
"kind" : "ExprStmt",
|
|
"location" : [ 11, 1, 11, 13 ],
|
|
"expr" : {
|
|
"kind" : "CallExpr",
|
|
"location" : [ 11, 1, 11, 13 ],
|
|
"inferredType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "<None>"
|
|
},
|
|
"function" : {
|
|
"kind" : "Identifier",
|
|
"location" : [ 11, 1, 11, 5 ],
|
|
"inferredType" : {
|
|
"kind" : "FuncType",
|
|
"parameters" : [ {
|
|
"kind" : "ClassValueType",
|
|
"className" : "object"
|
|
} ],
|
|
"returnType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "<None>"
|
|
}
|
|
},
|
|
"name" : "print"
|
|
},
|
|
"args" : [ {
|
|
"kind" : "BinaryExpr",
|
|
"location" : [ 11, 7, 11, 12 ],
|
|
"inferredType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "bool"
|
|
},
|
|
"left" : {
|
|
"kind" : "Identifier",
|
|
"location" : [ 11, 7, 11, 7 ],
|
|
"inferredType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "int"
|
|
},
|
|
"name" : "x"
|
|
},
|
|
"operator" : "==",
|
|
"right" : {
|
|
"kind" : "Identifier",
|
|
"location" : [ 11, 12, 11, 12 ],
|
|
"inferredType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "int"
|
|
},
|
|
"name" : "x"
|
|
}
|
|
} ]
|
|
}
|
|
}, {
|
|
"kind" : "ExprStmt",
|
|
"location" : [ 12, 1, 12, 13 ],
|
|
"expr" : {
|
|
"kind" : "CallExpr",
|
|
"location" : [ 12, 1, 12, 13 ],
|
|
"inferredType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "<None>"
|
|
},
|
|
"function" : {
|
|
"kind" : "Identifier",
|
|
"location" : [ 12, 1, 12, 5 ],
|
|
"inferredType" : {
|
|
"kind" : "FuncType",
|
|
"parameters" : [ {
|
|
"kind" : "ClassValueType",
|
|
"className" : "object"
|
|
} ],
|
|
"returnType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "<None>"
|
|
}
|
|
},
|
|
"name" : "print"
|
|
},
|
|
"args" : [ {
|
|
"kind" : "BinaryExpr",
|
|
"location" : [ 12, 7, 12, 12 ],
|
|
"inferredType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "bool"
|
|
},
|
|
"left" : {
|
|
"kind" : "Identifier",
|
|
"location" : [ 12, 7, 12, 7 ],
|
|
"inferredType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "int"
|
|
},
|
|
"name" : "x"
|
|
},
|
|
"operator" : "!=",
|
|
"right" : {
|
|
"kind" : "Identifier",
|
|
"location" : [ 12, 12, 12, 12 ],
|
|
"inferredType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "int"
|
|
},
|
|
"name" : "x"
|
|
}
|
|
} ]
|
|
}
|
|
}, {
|
|
"kind" : "ExprStmt",
|
|
"location" : [ 13, 1, 13, 12 ],
|
|
"expr" : {
|
|
"kind" : "CallExpr",
|
|
"location" : [ 13, 1, 13, 12 ],
|
|
"inferredType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "<None>"
|
|
},
|
|
"function" : {
|
|
"kind" : "Identifier",
|
|
"location" : [ 13, 1, 13, 5 ],
|
|
"inferredType" : {
|
|
"kind" : "FuncType",
|
|
"parameters" : [ {
|
|
"kind" : "ClassValueType",
|
|
"className" : "object"
|
|
} ],
|
|
"returnType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "<None>"
|
|
}
|
|
},
|
|
"name" : "print"
|
|
},
|
|
"args" : [ {
|
|
"kind" : "BinaryExpr",
|
|
"location" : [ 13, 7, 13, 11 ],
|
|
"inferredType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "bool"
|
|
},
|
|
"left" : {
|
|
"kind" : "Identifier",
|
|
"location" : [ 13, 7, 13, 7 ],
|
|
"inferredType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "int"
|
|
},
|
|
"name" : "x"
|
|
},
|
|
"operator" : "<",
|
|
"right" : {
|
|
"kind" : "Identifier",
|
|
"location" : [ 13, 11, 13, 11 ],
|
|
"inferredType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "int"
|
|
},
|
|
"name" : "x"
|
|
}
|
|
} ]
|
|
}
|
|
}, {
|
|
"kind" : "ExprStmt",
|
|
"location" : [ 14, 1, 14, 13 ],
|
|
"expr" : {
|
|
"kind" : "CallExpr",
|
|
"location" : [ 14, 1, 14, 13 ],
|
|
"inferredType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "<None>"
|
|
},
|
|
"function" : {
|
|
"kind" : "Identifier",
|
|
"location" : [ 14, 1, 14, 5 ],
|
|
"inferredType" : {
|
|
"kind" : "FuncType",
|
|
"parameters" : [ {
|
|
"kind" : "ClassValueType",
|
|
"className" : "object"
|
|
} ],
|
|
"returnType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "<None>"
|
|
}
|
|
},
|
|
"name" : "print"
|
|
},
|
|
"args" : [ {
|
|
"kind" : "BinaryExpr",
|
|
"location" : [ 14, 7, 14, 12 ],
|
|
"inferredType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "bool"
|
|
},
|
|
"left" : {
|
|
"kind" : "Identifier",
|
|
"location" : [ 14, 7, 14, 7 ],
|
|
"inferredType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "int"
|
|
},
|
|
"name" : "x"
|
|
},
|
|
"operator" : "<=",
|
|
"right" : {
|
|
"kind" : "Identifier",
|
|
"location" : [ 14, 12, 14, 12 ],
|
|
"inferredType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "int"
|
|
},
|
|
"name" : "x"
|
|
}
|
|
} ]
|
|
}
|
|
}, {
|
|
"kind" : "ExprStmt",
|
|
"location" : [ 15, 1, 15, 12 ],
|
|
"expr" : {
|
|
"kind" : "CallExpr",
|
|
"location" : [ 15, 1, 15, 12 ],
|
|
"inferredType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "<None>"
|
|
},
|
|
"function" : {
|
|
"kind" : "Identifier",
|
|
"location" : [ 15, 1, 15, 5 ],
|
|
"inferredType" : {
|
|
"kind" : "FuncType",
|
|
"parameters" : [ {
|
|
"kind" : "ClassValueType",
|
|
"className" : "object"
|
|
} ],
|
|
"returnType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "<None>"
|
|
}
|
|
},
|
|
"name" : "print"
|
|
},
|
|
"args" : [ {
|
|
"kind" : "BinaryExpr",
|
|
"location" : [ 15, 7, 15, 11 ],
|
|
"inferredType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "bool"
|
|
},
|
|
"left" : {
|
|
"kind" : "Identifier",
|
|
"location" : [ 15, 7, 15, 7 ],
|
|
"inferredType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "int"
|
|
},
|
|
"name" : "x"
|
|
},
|
|
"operator" : ">",
|
|
"right" : {
|
|
"kind" : "Identifier",
|
|
"location" : [ 15, 11, 15, 11 ],
|
|
"inferredType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "int"
|
|
},
|
|
"name" : "x"
|
|
}
|
|
} ]
|
|
}
|
|
}, {
|
|
"kind" : "ExprStmt",
|
|
"location" : [ 16, 1, 16, 13 ],
|
|
"expr" : {
|
|
"kind" : "CallExpr",
|
|
"location" : [ 16, 1, 16, 13 ],
|
|
"inferredType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "<None>"
|
|
},
|
|
"function" : {
|
|
"kind" : "Identifier",
|
|
"location" : [ 16, 1, 16, 5 ],
|
|
"inferredType" : {
|
|
"kind" : "FuncType",
|
|
"parameters" : [ {
|
|
"kind" : "ClassValueType",
|
|
"className" : "object"
|
|
} ],
|
|
"returnType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "<None>"
|
|
}
|
|
},
|
|
"name" : "print"
|
|
},
|
|
"args" : [ {
|
|
"kind" : "BinaryExpr",
|
|
"location" : [ 16, 7, 16, 12 ],
|
|
"inferredType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "bool"
|
|
},
|
|
"left" : {
|
|
"kind" : "Identifier",
|
|
"location" : [ 16, 7, 16, 7 ],
|
|
"inferredType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "int"
|
|
},
|
|
"name" : "x"
|
|
},
|
|
"operator" : ">=",
|
|
"right" : {
|
|
"kind" : "Identifier",
|
|
"location" : [ 16, 12, 16, 12 ],
|
|
"inferredType" : {
|
|
"kind" : "ClassValueType",
|
|
"className" : "int"
|
|
},
|
|
"name" : "x"
|
|
}
|
|
} ]
|
|
}
|
|
} ],
|
|
"errors" : {
|
|
"errors" : [ ],
|
|
"kind" : "Errors",
|
|
"location" : [ 0, 0, 0, 0 ]
|
|
}
|
|
} |