diff --git a/src/test/data/pa2/student_contributed/good.py.ast.typed b/src/test/data/pa2/student_contributed/good.py.ast.typed index e935d0a..10b9365 100644 --- a/src/test/data/pa2/student_contributed/good.py.ast.typed +++ b/src/test/data/pa2/student_contributed/good.py.ast.typed @@ -1,1200 +1,1299 @@ { "kind" : "Program", - "location" : [ 2, 1, 83, 25 ], + "location" : [ 2, 1, 109, 11 ], "declarations" : [ { "kind" : "ClassDef", - "location" : [ 2, 1, 10, 14 ], + "location" : [ 2, 1, 9, 16 ], "name" : { "kind" : "Identifier", - "location" : [ 2, 7, 2, 9 ], - "name" : "Foo" + "location" : [ 2, 7, 2, 13 ], + "name" : "A_CLASS" }, "superClass" : { "kind" : "Identifier", - "location" : [ 2, 11, 2, 16 ], + "location" : [ 2, 15, 2, 20 ], "name" : "object" }, "declarations" : [ { "kind" : "VarDef", - "location" : [ 3, 5, 3, 13 ], + "location" : [ 3, 5, 3, 21 ], "var" : { "kind" : "TypedVar", - "location" : [ 3, 5, 3, 9 ], + "location" : [ 3, 5, 3, 17 ], "identifier" : { "kind" : "Identifier", - "location" : [ 3, 5, 3, 5 ], - "name" : "x" + "location" : [ 3, 5, 3, 13 ], + "name" : "a_class_i" }, "type" : { "kind" : "ClassType", - "location" : [ 3, 7, 3, 9 ], + "location" : [ 3, 15, 3, 17 ], "className" : "int" } }, "value" : { "kind" : "IntegerLiteral", - "location" : [ 3, 13, 3, 13 ], + "location" : [ 3, 21, 3, 21 ], "value" : 0 } }, { "kind" : "FuncDef", - "location" : [ 5, 5, 6, 18 ], + "location" : [ 4, 5, 5, 18 ], "name" : { "kind" : "Identifier", - "location" : [ 5, 9, 5, 16 ], + "location" : [ 4, 9, 4, 16 ], "errorMsg" : "Method overridden with different type signature: __init__", "name" : "__init__" }, "params" : [ { "kind" : "TypedVar", - "location" : [ 5, 18, 5, 27 ], + "location" : [ 4, 18, 4, 31 ], "identifier" : { "kind" : "Identifier", - "location" : [ 5, 18, 5, 21 ], + "location" : [ 4, 18, 4, 21 ], "name" : "self" }, "type" : { "kind" : "ClassType", - "location" : [ 5, 23, 5, 27 ], - "className" : "Foo" + "location" : [ 4, 23, 4, 31 ], + "className" : "A_CLASS" } }, { "kind" : "TypedVar", - "location" : [ 5, 30, 5, 34 ], + "location" : [ 4, 34, 4, 38 ], "identifier" : { "kind" : "Identifier", - "location" : [ 5, 30, 5, 30 ], + "location" : [ 4, 34, 4, 34 ], "name" : "x" }, "type" : { "kind" : "ClassType", - "location" : [ 5, 32, 5, 34 ], + "location" : [ 4, 36, 4, 38 ], "className" : "int" } } ], "returnType" : { "kind" : "ClassType", - "location" : [ 5, 36, 5, 36 ], + "location" : [ 4, 40, 4, 40 ], "className" : "" }, "declarations" : [ ], "statements" : [ { "kind" : "AssignStmt", - "location" : [ 6, 9, 6, 18 ], + "location" : [ 5, 9, 5, 18 ], "targets" : [ { "kind" : "MemberExpr", - "location" : [ 6, 9, 6, 14 ], + "location" : [ 5, 9, 5, 14 ], "object" : { "kind" : "Identifier", - "location" : [ 6, 9, 6, 12 ], + "location" : [ 5, 9, 5, 12 ], "name" : "self" }, "member" : { "kind" : "Identifier", - "location" : [ 6, 14, 6, 14 ], + "location" : [ 5, 14, 5, 14 ], "name" : "x" } } ], "value" : { "kind" : "Identifier", - "location" : [ 6, 18, 6, 18 ], + "location" : [ 5, 18, 5, 18 ], "name" : "x" } } ] }, { "kind" : "FuncDef", - "location" : [ 8, 5, 10, 14 ], + "location" : [ 7, 5, 9, 16 ], "name" : { "kind" : "Identifier", - "location" : [ 8, 9, 8, 11 ], - "errorMsg" : "First parameter of the following method must be of the enclosing class: bar", - "name" : "bar" + "location" : [ 7, 9, 7, 11 ], + "name" : "add" }, "params" : [ { "kind" : "TypedVar", - "location" : [ 8, 13, 8, 17 ], + "location" : [ 7, 13, 7, 26 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 7, 13, 7, 16 ], + "name" : "self" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 7, 18, 7, 26 ], + "className" : "A_CLASS" + } + }, { + "kind" : "TypedVar", + "location" : [ 7, 29, 7, 33 ], "identifier" : { "kind" : "Identifier", - "location" : [ 8, 13, 8, 13 ], + "location" : [ 7, 29, 7, 29 ], "name" : "y" }, "type" : { "kind" : "ClassType", - "location" : [ 8, 15, 8, 17 ], + "location" : [ 7, 31, 7, 33 ], "className" : "int" } } ], "returnType" : { "kind" : "ClassType", - "location" : [ 8, 19, 8, 19 ], - "className" : "" + "location" : [ 7, 39, 7, 41 ], + "className" : "int" }, "declarations" : [ ], "statements" : [ { - "kind" : "ExprStmt", - "location" : [ 9, 9, 9, 38 ], - "expr" : { - "kind" : "CallExpr", - "location" : [ 9, 9, 9, 38 ], - "function" : { + "kind" : "AssignStmt", + "location" : [ 8, 9, 8, 20 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 8, 9, 8, 9 ], + "name" : "y" + } ], + "value" : { + "kind" : "BinaryExpr", + "location" : [ 8, 13, 8, 20 ], + "left" : { "kind" : "Identifier", - "location" : [ 9, 9, 9, 13 ], - "name" : "print" + "location" : [ 8, 13, 8, 13 ], + "name" : "y" }, - "args" : [ { - "kind" : "StringLiteral", - "location" : [ 9, 15, 9, 28 ], - "value" : "Hello World!" - }, { - "kind" : "BinaryExpr", - "location" : [ 9, 30, 9, 37 ], - "left" : { - "kind" : "MemberExpr", - "location" : [ 9, 30, 9, 35 ], - "object" : { - "kind" : "Identifier", - "location" : [ 9, 30, 9, 33 ], - "name" : "self" - }, - "member" : { - "kind" : "Identifier", - "location" : [ 9, 35, 9, 35 ], - "name" : "x" - } + "operator" : "+", + "right" : { + "kind" : "MemberExpr", + "location" : [ 8, 15, 8, 20 ], + "object" : { + "kind" : "Identifier", + "location" : [ 8, 15, 8, 18 ], + "name" : "self" }, - "operator" : "+", - "right" : { + "member" : { "kind" : "Identifier", - "location" : [ 9, 37, 9, 37 ], - "name" : "y" + "location" : [ 8, 20, 8, 20 ], + "name" : "x" } - } ] + } } }, { - "kind" : "AssignStmt", - "location" : [ 10, 9, 10, 14 ], - "targets" : [ { + "kind" : "ReturnStmt", + "location" : [ 9, 9, 9, 16 ], + "value" : { "kind" : "Identifier", - "location" : [ 10, 9, 10, 9 ], + "location" : [ 9, 16, 9, 16 ], "name" : "y" - } ], - "value" : { - "kind" : "IntegerLiteral", - "location" : [ 10, 13, 10, 14 ], - "value" : 10 } } ] } ] }, { - "kind" : "FuncDef", - "location" : [ 12, 1, 17, 25 ], + "kind" : "ClassDef", + "location" : [ 11, 1, 12, 21 ], "name" : { "kind" : "Identifier", - "location" : [ 12, 5, 12, 14 ], - "name" : "get_stones" + "location" : [ 11, 7, 11, 13 ], + "name" : "B_CLASS" }, - "params" : [ { - "kind" : "TypedVar", - "location" : [ 12, 16, 12, 23 ], - "identifier" : { - "kind" : "Identifier", - "location" : [ 12, 16, 12, 19 ], - "name" : "name" - }, - "type" : { - "kind" : "ClassType", - "location" : [ 12, 21, 12, 23 ], - "className" : "str" - } - } ], - "returnType" : { - "kind" : "ClassType", - "location" : [ 12, 27, 12, 29 ], - "className" : "str" + "superClass" : { + "kind" : "Identifier", + "location" : [ 11, 15, 11, 20 ], + "name" : "object" }, "declarations" : [ { - "kind" : "FuncDef", - "location" : [ 13, 5, 14, 38 ], - "name" : { - "kind" : "Identifier", - "location" : [ 13, 9, 13, 16 ], - "name" : "map_name" - }, - "params" : [ { + "kind" : "VarDef", + "location" : [ 12, 5, 12, 21 ], + "var" : { "kind" : "TypedVar", - "location" : [ 13, 18, 13, 23 ], + "location" : [ 12, 5, 12, 17 ], "identifier" : { "kind" : "Identifier", - "location" : [ 13, 18, 13, 19 ], - "name" : "nm" + "location" : [ 12, 5, 12, 13 ], + "name" : "b_class_i" }, "type" : { "kind" : "ClassType", - "location" : [ 13, 21, 13, 23 ], - "className" : "str" + "location" : [ 12, 15, 12, 17 ], + "className" : "int" } - } ], - "returnType" : { - "kind" : "ClassType", - "location" : [ 13, 27, 13, 29 ], - "className" : "str" }, - "declarations" : [ ], - "statements" : [ { - "kind" : "ReturnStmt", - "location" : [ 14, 9, 14, 38 ], - "value" : { - "kind" : "IndexExpr", - "location" : [ 14, 16, 14, 38 ], - "list" : { - "kind" : "Identifier", - "location" : [ 14, 16, 14, 21 ], - "name" : "stones" - }, - "index" : { - "kind" : "MethodCallExpr", - "location" : [ 14, 23, 14, 37 ], - "method" : { - "kind" : "MemberExpr", - "location" : [ 14, 23, 14, 33 ], - "object" : { - "kind" : "Identifier", - "location" : [ 14, 23, 14, 27 ], - "name" : "color" - }, - "member" : { - "kind" : "Identifier", - "location" : [ 14, 29, 14, 33 ], - "name" : "index" - } - }, - "args" : [ { - "kind" : "Identifier", - "location" : [ 14, 35, 14, 36 ], - "name" : "nm" - } ] - } - } - } ] - } ], - "statements" : [ { - "kind" : "AssignStmt", - "location" : [ 15, 5, 15, 24 ], - "targets" : [ { - "kind" : "Identifier", - "location" : [ 15, 5, 15, 9 ], - "name" : "color" - } ], - "value" : { - "kind" : "ListExpr", - "location" : [ 15, 11, 15, 24 ], - "elements" : [ { - "kind" : "StringLiteral", - "location" : [ 15, 12, 15, 16 ], - "value" : "Red" - }, { - "kind" : "StringLiteral", - "location" : [ 15, 18, 15, 23 ], - "value" : "Blue" - } ] - } - }, { - "kind" : "AssignStmt", - "location" : [ 16, 5, 16, 26 ], - "targets" : [ { - "kind" : "Identifier", - "location" : [ 16, 5, 16, 10 ], - "name" : "stones" - } ], "value" : { - "kind" : "ListExpr", - "location" : [ 16, 12, 16, 26 ], - "elements" : [ { - "kind" : "StringLiteral", - "location" : [ 16, 13, 16, 18 ], - "value" : "Mind" - }, { - "kind" : "StringLiteral", - "location" : [ 16, 20, 16, 25 ], - "value" : "Soul" - } ] - } - }, { - "kind" : "ReturnStmt", - "location" : [ 17, 5, 17, 25 ], - "value" : { - "kind" : "CallExpr", - "location" : [ 17, 12, 17, 25 ], - "function" : { - "kind" : "Identifier", - "location" : [ 17, 12, 17, 19 ], - "name" : "map_name" - }, - "args" : [ { - "kind" : "Identifier", - "location" : [ 17, 21, 17, 24 ], - "name" : "name" - } ] + "kind" : "IntegerLiteral", + "location" : [ 12, 21, 12, 21 ], + "value" : 0 } } ] }, { - "kind" : "FuncDef", - "location" : [ 19, 1, 22, 10 ], + "kind" : "ClassDef", + "location" : [ 14, 1, 0, 0 ], "name" : { "kind" : "Identifier", - "location" : [ 19, 5, 19, 8 ], - "name" : "funa" + "location" : [ 14, 7, 14, 13 ], + "name" : "C_CLASS" }, - "params" : [ ], - "returnType" : { - "kind" : "ClassType", - "location" : [ 19, 11, 19, 11 ], - "className" : "" + "superClass" : { + "kind" : "Identifier", + "location" : [ 14, 15, 14, 21 ], + "name" : "B_CLASS" }, - "declarations" : [ { - "kind" : "FuncDef", - "location" : [ 20, 5, 21, 22 ], - "name" : { + "declarations" : [ ] + }, { + "kind" : "VarDef", + "location" : [ 18, 1, 18, 15 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 18, 1, 18, 7 ], + "identifier" : { "kind" : "Identifier", - "location" : [ 20, 9, 20, 12 ], - "name" : "funb" + "location" : [ 18, 1, 18, 3 ], + "name" : "a_s" }, - "params" : [ ], - "returnType" : { + "type" : { "kind" : "ClassType", - "location" : [ 20, 15, 20, 15 ], - "className" : "" - }, - "declarations" : [ ], - "statements" : [ { - "kind" : "ExprStmt", - "location" : [ 21, 9, 21, 22 ], - "expr" : { - "kind" : "CallExpr", - "location" : [ 21, 9, 21, 22 ], - "function" : { - "kind" : "Identifier", - "location" : [ 21, 9, 21, 13 ], - "name" : "print" - }, - "args" : [ { - "kind" : "StringLiteral", - "location" : [ 21, 15, 21, 21 ], - "value" : "Hello" - } ] - } - } ] - } ], - "statements" : [ { - "kind" : "ExprStmt", - "location" : [ 22, 5, 22, 10 ], - "expr" : { - "kind" : "CallExpr", - "location" : [ 22, 5, 22, 10 ], - "function" : { - "kind" : "Identifier", - "location" : [ 22, 5, 22, 8 ], - "name" : "funb" - }, - "args" : [ ] + "location" : [ 18, 5, 18, 7 ], + "className" : "str" } - } ] - }, { - "kind" : "FuncDef", - "location" : [ 24, 1, 27, 13 ], - "name" : { - "kind" : "Identifier", - "location" : [ 24, 5, 24, 8 ], - "name" : "fund" - }, - "params" : [ ], - "returnType" : { - "kind" : "ClassType", - "location" : [ 24, 11, 24, 11 ], - "className" : "" }, - "declarations" : [ { - "kind" : "FuncDef", - "location" : [ 25, 5, 26, 22 ], - "name" : { + "value" : { + "kind" : "StringLiteral", + "location" : [ 18, 11, 18, 15 ], + "value" : "a_s" + } + }, { + "kind" : "VarDef", + "location" : [ 19, 1, 19, 15 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 19, 1, 19, 7 ], + "identifier" : { "kind" : "Identifier", - "location" : [ 25, 9, 25, 12 ], - "name" : "fune" + "location" : [ 19, 1, 19, 3 ], + "name" : "b_s" }, - "params" : [ ], - "returnType" : { + "type" : { "kind" : "ClassType", - "location" : [ 25, 15, 25, 15 ], - "className" : "" - }, - "declarations" : [ ], - "statements" : [ { - "kind" : "ExprStmt", - "location" : [ 26, 9, 26, 22 ], - "expr" : { - "kind" : "CallExpr", - "location" : [ 26, 9, 26, 22 ], - "function" : { - "kind" : "Identifier", - "location" : [ 26, 9, 26, 13 ], - "name" : "print" - }, - "args" : [ { - "kind" : "StringLiteral", - "location" : [ 26, 15, 26, 21 ], - "value" : "Hello" - } ] - } - } ] - } ], - "statements" : [ { - "kind" : "AssignStmt", - "location" : [ 27, 5, 27, 13 ], - "targets" : [ { + "location" : [ 19, 5, 19, 7 ], + "className" : "str" + } + }, + "value" : { + "kind" : "StringLiteral", + "location" : [ 19, 11, 19, 15 ], + "value" : "b_s" + } + }, { + "kind" : "VarDef", + "location" : [ 20, 1, 20, 15 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 20, 1, 20, 7 ], + "identifier" : { "kind" : "Identifier", - "location" : [ 27, 5, 27, 5 ], - "name" : "c" - } ], - "value" : { - "kind" : "BinaryExpr", - "location" : [ 27, 9, 27, 13 ], - "left" : { - "kind" : "IntegerLiteral", - "location" : [ 27, 9, 27, 9 ], - "value" : 4 - }, - "operator" : "+", - "right" : { - "kind" : "IntegerLiteral", - "location" : [ 27, 13, 27, 13 ], - "value" : 5 - } + "location" : [ 20, 1, 20, 3 ], + "name" : "c_s" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 20, 5, 20, 7 ], + "className" : "str" } - } ] + }, + "value" : { + "kind" : "StringLiteral", + "location" : [ 20, 11, 20, 15 ], + "value" : "c_s" + } }, { - "kind" : "FuncDef", - "location" : [ 29, 1, 33, 13 ], - "name" : { - "kind" : "Identifier", - "location" : [ 29, 5, 29, 8 ], - "name" : "funf" + "kind" : "VarDef", + "location" : [ 22, 1, 22, 11 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 22, 1, 22, 7 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 22, 1, 22, 3 ], + "name" : "a_i" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 22, 5, 22, 7 ], + "className" : "int" + } }, - "params" : [ ], - "returnType" : { - "kind" : "ClassType", - "location" : [ 29, 11, 29, 11 ], - "className" : "" + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 22, 11, 22, 11 ], + "value" : 0 + } + }, { + "kind" : "VarDef", + "location" : [ 23, 1, 23, 11 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 23, 1, 23, 7 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 23, 1, 23, 3 ], + "name" : "b_i" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 23, 5, 23, 7 ], + "className" : "int" + } }, - "declarations" : [ { - "kind" : "FuncDef", - "location" : [ 30, 5, 31, 22 ], - "name" : { + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 23, 11, 23, 11 ], + "value" : 0 + } + }, { + "kind" : "VarDef", + "location" : [ 24, 1, 24, 11 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 24, 1, 24, 7 ], + "identifier" : { "kind" : "Identifier", - "location" : [ 30, 9, 30, 12 ], - "name" : "fung" + "location" : [ 24, 1, 24, 3 ], + "name" : "c_i" }, - "params" : [ ], - "returnType" : { + "type" : { "kind" : "ClassType", - "location" : [ 30, 15, 30, 15 ], - "className" : "" + "location" : [ 24, 5, 24, 7 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 24, 11, 24, 11 ], + "value" : 0 + } + }, { + "kind" : "VarDef", + "location" : [ 26, 1, 26, 16 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 26, 1, 26, 8 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 26, 1, 26, 3 ], + "name" : "a_b" }, - "declarations" : [ ], - "statements" : [ { - "kind" : "ExprStmt", - "location" : [ 31, 9, 31, 22 ], - "expr" : { - "kind" : "CallExpr", - "location" : [ 31, 9, 31, 22 ], - "function" : { + "type" : { + "kind" : "ClassType", + "location" : [ 26, 5, 26, 8 ], + "className" : "bool" + } + }, + "value" : { + "kind" : "BooleanLiteral", + "location" : [ 26, 12, 26, 16 ], + "value" : false + } + }, { + "kind" : "VarDef", + "location" : [ 27, 1, 27, 16 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 27, 1, 27, 8 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 27, 1, 27, 3 ], + "name" : "b_b" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 27, 5, 27, 8 ], + "className" : "bool" + } + }, + "value" : { + "kind" : "BooleanLiteral", + "location" : [ 27, 12, 27, 16 ], + "value" : false + } + }, { + "kind" : "VarDef", + "location" : [ 28, 1, 28, 16 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 28, 1, 28, 8 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 28, 1, 28, 3 ], + "name" : "c_b" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 28, 5, 28, 8 ], + "className" : "bool" + } + }, + "value" : { + "kind" : "BooleanLiteral", + "location" : [ 28, 12, 28, 16 ], + "value" : false + } + }, { + "kind" : "VarDef", + "location" : [ 30, 1, 30, 19 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 30, 1, 30, 12 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 30, 1, 30, 6 ], + "name" : "a_list" + }, + "type" : { + "kind" : "ListType", + "location" : [ 30, 8, 30, 12 ], + "elementType" : { + "kind" : "ClassType", + "location" : [ 30, 9, 30, 11 ], + "className" : "int" + } + } + }, + "value" : { + "kind" : "NoneLiteral", + "location" : [ 30, 16, 30, 19 ] + } + }, { + "kind" : "VarDef", + "location" : [ 31, 1, 31, 19 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 31, 1, 31, 12 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 31, 1, 31, 6 ], + "name" : "b_list" + }, + "type" : { + "kind" : "ListType", + "location" : [ 31, 8, 31, 12 ], + "elementType" : { + "kind" : "ClassType", + "location" : [ 31, 9, 31, 11 ], + "className" : "int" + } + } + }, + "value" : { + "kind" : "NoneLiteral", + "location" : [ 31, 16, 31, 19 ] + } + }, { + "kind" : "VarDef", + "location" : [ 32, 1, 32, 19 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 32, 1, 32, 12 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 32, 1, 32, 6 ], + "name" : "c_list" + }, + "type" : { + "kind" : "ListType", + "location" : [ 32, 8, 32, 12 ], + "elementType" : { + "kind" : "ClassType", + "location" : [ 32, 9, 32, 11 ], + "className" : "int" + } + } + }, + "value" : { + "kind" : "NoneLiteral", + "location" : [ 32, 16, 32, 19 ] + } + }, { + "kind" : "VarDef", + "location" : [ 34, 1, 34, 22 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 34, 1, 34, 15 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 34, 1, 34, 7 ], + "name" : "a_class" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 34, 9, 34, 15 ], + "className" : "A_CLASS" + } + }, + "value" : { + "kind" : "NoneLiteral", + "location" : [ 34, 19, 34, 22 ] + } + }, { + "kind" : "VarDef", + "location" : [ 35, 1, 35, 22 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 35, 1, 35, 15 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 35, 1, 35, 7 ], + "name" : "b_class" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 35, 9, 35, 15 ], + "className" : "B_CLASS" + } + }, + "value" : { + "kind" : "NoneLiteral", + "location" : [ 35, 19, 35, 22 ] + } + }, { + "kind" : "VarDef", + "location" : [ 36, 1, 36, 22 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 36, 1, 36, 15 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 36, 1, 36, 7 ], + "name" : "c_class" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 36, 9, 36, 15 ], + "className" : "C_CLASS" + } + }, + "value" : { + "kind" : "NoneLiteral", + "location" : [ 36, 19, 36, 22 ] + } + }, { + "kind" : "FuncDef", + "location" : [ 40, 1, 0, 0 ], + "name" : { + "kind" : "Identifier", + "location" : [ 40, 5, 40, 7 ], + "name" : "f_1" + }, + "params" : [ ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 40, 14, 40, 19 ], + "className" : "object" + }, + "declarations" : [ { + "kind" : "FuncDef", + "location" : [ 41, 5, 43, 18 ], + "name" : { + "kind" : "Identifier", + "location" : [ 41, 9, 41, 13 ], + "name" : "f_f_1" + }, + "params" : [ ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 41, 20, 41, 25 ], + "className" : "object" + }, + "declarations" : [ { + "kind" : "GlobalDecl", + "location" : [ 42, 9, 42, 18 ], + "variable" : { + "kind" : "Identifier", + "location" : [ 42, 16, 42, 18 ], + "name" : "a_s" + } + } ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 43, 9, 43, 18 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 43, 9, 43, 18 ], + "function" : { "kind" : "Identifier", - "location" : [ 31, 9, 31, 13 ], + "location" : [ 43, 9, 43, 13 ], "name" : "print" }, "args" : [ { - "kind" : "StringLiteral", - "location" : [ 31, 15, 31, 21 ], - "value" : "Hello" + "kind" : "Identifier", + "location" : [ 43, 15, 43, 17 ], + "name" : "a_s" } ] } } ] } ], - "statements" : [ { - "kind" : "AssignStmt", - "location" : [ 32, 5, 32, 9 ], - "targets" : [ { - "kind" : "Identifier", - "location" : [ 32, 5, 32, 5 ], - "name" : "c" - } ], + "statements" : [ ] + }, { + "kind" : "FuncDef", + "location" : [ 47, 1, 0, 0 ], + "name" : { + "kind" : "Identifier", + "location" : [ 47, 5, 47, 7 ], + "name" : "f_2" + }, + "params" : [ ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 47, 14, 47, 19 ], + "className" : "object" + }, + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 48, 5, 48, 19 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 48, 5, 48, 13 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 48, 5, 48, 9 ], + "name" : "f_a_s" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 48, 11, 48, 13 ], + "className" : "str" + } + }, "value" : { - "kind" : "IntegerLiteral", - "location" : [ 32, 9, 32, 9 ], - "value" : 6 + "kind" : "StringLiteral", + "location" : [ 48, 17, 48, 19 ], + "value" : "s" } }, { - "kind" : "AssignStmt", - "location" : [ 33, 5, 33, 13 ], - "targets" : [ { + "kind" : "FuncDef", + "location" : [ 49, 5, 51, 20 ], + "name" : { "kind" : "Identifier", - "location" : [ 33, 5, 33, 5 ], - "name" : "c" + "location" : [ 49, 9, 49, 13 ], + "name" : "f_f_2" + }, + "params" : [ ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 49, 20, 49, 25 ], + "className" : "object" + }, + "declarations" : [ { + "kind" : "NonLocalDecl", + "location" : [ 50, 9, 50, 22 ], + "variable" : { + "kind" : "Identifier", + "location" : [ 50, 18, 50, 22 ], + "name" : "f_a_s" + } } ], + "statements" : [ { + "kind" : "ExprStmt", + "location" : [ 51, 9, 51, 20 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 51, 9, 51, 20 ], + "function" : { + "kind" : "Identifier", + "location" : [ 51, 9, 51, 13 ], + "name" : "print" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 51, 15, 51, 19 ], + "name" : "f_a_s" + } ] + } + } ] + } ], + "statements" : [ ] + }, { + "kind" : "FuncDef", + "location" : [ 55, 1, 57, 18 ], + "name" : { + "kind" : "Identifier", + "location" : [ 55, 5, 55, 7 ], + "name" : "f_3" + }, + "params" : [ { + "kind" : "TypedVar", + "location" : [ 55, 9, 55, 13 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 55, 9, 55, 9 ], + "name" : "x" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 55, 11, 55, 13 ], + "className" : "int" + } + } ], + "returnType" : { + "kind" : "ClassType", + "location" : [ 55, 19, 55, 21 ], + "className" : "int" + }, + "declarations" : [ { + "kind" : "VarDef", + "location" : [ 56, 5, 56, 17 ], + "var" : { + "kind" : "TypedVar", + "location" : [ 56, 5, 56, 13 ], + "identifier" : { + "kind" : "Identifier", + "location" : [ 56, 5, 56, 9 ], + "name" : "f_b_s" + }, + "type" : { + "kind" : "ClassType", + "location" : [ 56, 11, 56, 13 ], + "className" : "int" + } + }, + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 56, 17, 56, 17 ], + "value" : 3 + } + } ], + "statements" : [ { + "kind" : "ReturnStmt", + "location" : [ 57, 5, 57, 18 ], "value" : { "kind" : "BinaryExpr", - "location" : [ 33, 9, 33, 13 ], + "location" : [ 57, 12, 57, 18 ], + "left" : { + "kind" : "Identifier", + "location" : [ 57, 12, 57, 12 ], + "name" : "x" + }, + "operator" : "*", + "right" : { + "kind" : "Identifier", + "location" : [ 57, 14, 57, 18 ], + "name" : "f_b_s" + } + } + } ] + } ], + "statements" : [ { + "kind" : "AssignStmt", + "location" : [ 60, 1, 60, 18 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 60, 1, 60, 6 ], + "name" : "a_list" + } ], + "value" : { + "kind" : "ListExpr", + "location" : [ 60, 10, 60, 18 ], + "elements" : [ { + "kind" : "IntegerLiteral", + "location" : [ 60, 11, 60, 11 ], + "value" : 1 + }, { + "kind" : "IntegerLiteral", + "location" : [ 60, 14, 60, 14 ], + "value" : 2 + }, { + "kind" : "IntegerLiteral", + "location" : [ 60, 17, 60, 17 ], + "value" : 3 + } ] + } + }, { + "kind" : "AssignStmt", + "location" : [ 61, 1, 61, 18 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 61, 1, 61, 6 ], + "name" : "b_list" + } ], + "value" : { + "kind" : "ListExpr", + "location" : [ 61, 10, 61, 18 ], + "elements" : [ { + "kind" : "IntegerLiteral", + "location" : [ 61, 11, 61, 11 ], + "value" : 0 + }, { + "kind" : "IntegerLiteral", + "location" : [ 61, 14, 61, 14 ], + "value" : 0 + }, { + "kind" : "IntegerLiteral", + "location" : [ 61, 17, 61, 17 ], + "value" : 0 + } ] + } + }, { + "kind" : "AssignStmt", + "location" : [ 62, 1, 62, 21 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 62, 1, 62, 6 ], + "name" : "c_list" + } ], + "value" : { + "kind" : "ListExpr", + "location" : [ 62, 10, 62, 21 ], + "elements" : [ { + "kind" : "UnaryExpr", + "location" : [ 62, 11, 62, 12 ], + "operator" : "-", + "operand" : { + "kind" : "IntegerLiteral", + "location" : [ 62, 12, 62, 12 ], + "value" : 1 + } + }, { + "kind" : "UnaryExpr", + "location" : [ 62, 15, 62, 16 ], + "operator" : "-", + "operand" : { + "kind" : "IntegerLiteral", + "location" : [ 62, 16, 62, 16 ], + "value" : 2 + } + }, { + "kind" : "UnaryExpr", + "location" : [ 62, 19, 62, 20 ], + "operator" : "-", + "operand" : { + "kind" : "IntegerLiteral", + "location" : [ 62, 20, 62, 20 ], + "value" : 3 + } + } ] + } + }, { + "kind" : "AssignStmt", + "location" : [ 64, 1, 64, 20 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 64, 1, 64, 7 ], + "name" : "a_class" + } ], + "value" : { + "kind" : "CallExpr", + "location" : [ 64, 11, 64, 20 ], + "function" : { + "kind" : "Identifier", + "location" : [ 64, 11, 64, 17 ], + "name" : "A_CLASS" + }, + "args" : [ { + "kind" : "IntegerLiteral", + "location" : [ 64, 19, 64, 19 ], + "value" : 5 + } ] + } + }, { + "kind" : "AssignStmt", + "location" : [ 65, 1, 65, 19 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 65, 1, 65, 7 ], + "name" : "b_class" + } ], + "value" : { + "kind" : "CallExpr", + "location" : [ 65, 11, 65, 19 ], + "function" : { + "kind" : "Identifier", + "location" : [ 65, 11, 65, 17 ], + "name" : "B_CLASS" + }, + "args" : [ ] + } + }, { + "kind" : "AssignStmt", + "location" : [ 66, 1, 66, 19 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 66, 1, 66, 7 ], + "name" : "c_class" + } ], + "value" : { + "kind" : "CallExpr", + "location" : [ 66, 11, 66, 19 ], + "function" : { + "kind" : "Identifier", + "location" : [ 66, 11, 66, 17 ], + "name" : "C_CLASS" + }, + "args" : [ ] + } + }, { + "kind" : "AssignStmt", + "location" : [ 74, 1, 74, 15 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 74, 1, 74, 3 ], + "name" : "a_s" + } ], + "value" : { + "kind" : "BinaryExpr", + "location" : [ 74, 7, 74, 15 ], + "left" : { + "kind" : "Identifier", + "location" : [ 74, 7, 74, 9 ], + "name" : "a_s" + }, + "operator" : "+", + "right" : { + "kind" : "Identifier", + "location" : [ 74, 13, 74, 15 ], + "name" : "b_s" + } + } + }, { + "kind" : "ExprStmt", + "location" : [ 75, 1, 75, 10 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 75, 1, 75, 10 ], + "function" : { + "kind" : "Identifier", + "location" : [ 75, 1, 75, 5 ], + "name" : "print" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 75, 7, 75, 9 ], + "name" : "a_s" + } ] + } + }, { + "kind" : "AssignStmt", + "location" : [ 78, 1, 78, 12 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 78, 1, 78, 3 ], + "name" : "c_s" + } ], + "value" : { + "kind" : "IndexExpr", + "location" : [ 78, 7, 78, 12 ], + "list" : { + "kind" : "Identifier", + "location" : [ 78, 7, 78, 9 ], + "name" : "a_s" + }, + "index" : { + "kind" : "IntegerLiteral", + "location" : [ 78, 11, 78, 11 ], + "value" : 0 + } + } + }, { + "kind" : "ExprStmt", + "location" : [ 79, 1, 79, 10 ], + "expr" : { + "kind" : "CallExpr", + "location" : [ 79, 1, 79, 10 ], + "function" : { + "kind" : "Identifier", + "location" : [ 79, 1, 79, 5 ], + "name" : "print" + }, + "args" : [ { + "kind" : "Identifier", + "location" : [ 79, 7, 79, 9 ], + "name" : "c_s" + } ] + } + }, { + "kind" : "AssignStmt", + "location" : [ 84, 1, 84, 28 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 84, 1, 84, 3 ], + "name" : "a_b" + } ], + "value" : { + "kind" : "BinaryExpr", + "location" : [ 84, 7, 84, 28 ], + "left" : { + "kind" : "BinaryExpr", + "location" : [ 84, 7, 84, 16 ], "left" : { - "kind" : "IntegerLiteral", - "location" : [ 33, 9, 33, 9 ], - "value" : 4 + "kind" : "Identifier", + "location" : [ 84, 7, 84, 9 ], + "name" : "a_i" }, - "operator" : "+", + "operator" : "==", "right" : { - "kind" : "IntegerLiteral", - "location" : [ 33, 13, 33, 13 ], - "value" : 5 + "kind" : "Identifier", + "location" : [ 84, 14, 84, 16 ], + "name" : "b_i" } - } - } ] - } ], - "statements" : [ { - "kind" : "IfStmt", - "location" : [ 36, 1, 0, 0 ], - "condition" : { - "kind" : "BooleanLiteral", - "location" : [ 36, 4, 36, 7 ], - "value" : true - }, - "thenBody" : [ { - "kind" : "IfStmt", - "location" : [ 37, 5, 0, 0 ], - "condition" : { - "kind" : "BooleanLiteral", - "location" : [ 37, 8, 37, 11 ], - "value" : true }, - "thenBody" : [ { - "kind" : "IfStmt", - "location" : [ 38, 9, 0, 0 ], - "condition" : { - "kind" : "BooleanLiteral", - "location" : [ 38, 12, 38, 15 ], - "value" : true - }, - "thenBody" : [ { - "kind" : "ExprStmt", - "location" : [ 39, 13, 39, 26 ], - "expr" : { - "kind" : "CallExpr", - "location" : [ 39, 13, 39, 26 ], - "function" : { - "kind" : "Identifier", - "location" : [ 39, 13, 39, 17 ], - "name" : "print" - }, - "args" : [ { - "kind" : "StringLiteral", - "location" : [ 39, 19, 39, 25 ], - "value" : "Hello" - } ] - } - } ], - "elseBody" : [ ] - } ], - "elseBody" : [ ] - } ], - "elseBody" : [ ] + "operator" : "and", + "right" : { + "kind" : "UnaryExpr", + "location" : [ 84, 22, 84, 28 ], + "operator" : "not", + "operand" : { + "kind" : "Identifier", + "location" : [ 84, 26, 84, 28 ], + "name" : "b_b" + } + } + } }, { "kind" : "ExprStmt", - "location" : [ 40, 1, 40, 14 ], + "location" : [ 85, 1, 85, 10 ], "expr" : { "kind" : "CallExpr", - "location" : [ 40, 1, 40, 14 ], + "location" : [ 85, 1, 85, 10 ], "function" : { "kind" : "Identifier", - "location" : [ 40, 1, 40, 5 ], + "location" : [ 85, 1, 85, 5 ], "name" : "print" }, "args" : [ { - "kind" : "StringLiteral", - "location" : [ 40, 7, 40, 13 ], - "value" : "World" + "kind" : "Identifier", + "location" : [ 85, 7, 85, 9 ], + "name" : "a_b" } ] } }, { - "kind" : "IfStmt", - "location" : [ 42, 1, 0, 0 ], - "condition" : { - "kind" : "BooleanLiteral", - "location" : [ 42, 4, 42, 7 ], - "value" : true - }, - "thenBody" : [ { - "kind" : "IfStmt", - "location" : [ 43, 5, 0, 0 ], - "condition" : { - "kind" : "BooleanLiteral", - "location" : [ 43, 8, 43, 11 ], - "value" : true - }, - "thenBody" : [ { - "kind" : "IfStmt", - "location" : [ 44, 9, 0, 0 ], - "condition" : { - "kind" : "BooleanLiteral", - "location" : [ 44, 12, 44, 15 ], - "value" : true - }, - "thenBody" : [ { - "kind" : "ExprStmt", - "location" : [ 45, 13, 45, 26 ], - "expr" : { - "kind" : "CallExpr", - "location" : [ 45, 13, 45, 26 ], - "function" : { - "kind" : "Identifier", - "location" : [ 45, 13, 45, 17 ], - "name" : "print" - }, - "args" : [ { - "kind" : "StringLiteral", - "location" : [ 45, 19, 45, 25 ], - "value" : "Hello" - } ] - } - } ], - "elseBody" : [ ] - }, { - "kind" : "ExprStmt", - "location" : [ 46, 9, 46, 22 ], - "expr" : { - "kind" : "CallExpr", - "location" : [ 46, 9, 46, 22 ], - "function" : { - "kind" : "Identifier", - "location" : [ 46, 9, 46, 13 ], - "name" : "print" - }, - "args" : [ { - "kind" : "StringLiteral", - "location" : [ 46, 15, 46, 21 ], - "value" : "World" - } ] - } - } ], - "elseBody" : [ ] + "kind" : "AssignStmt", + "location" : [ 90, 1, 90, 24 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 90, 1, 90, 6 ], + "name" : "a_list" } ], - "elseBody" : [ ] - }, { - "kind" : "IfStmt", - "location" : [ 48, 1, 0, 0 ], - "condition" : { - "kind" : "BooleanLiteral", - "location" : [ 48, 4, 48, 7 ], - "value" : true - }, - "thenBody" : [ { - "kind" : "IfStmt", - "location" : [ 49, 5, 0, 0 ], - "condition" : { - "kind" : "BooleanLiteral", - "location" : [ 49, 8, 49, 11 ], - "value" : true + "value" : { + "kind" : "BinaryExpr", + "location" : [ 90, 10, 90, 24 ], + "left" : { + "kind" : "Identifier", + "location" : [ 90, 10, 90, 15 ], + "name" : "a_list" }, - "thenBody" : [ { - "kind" : "IfStmt", - "location" : [ 50, 9, 0, 0 ], - "condition" : { - "kind" : "BooleanLiteral", - "location" : [ 50, 12, 50, 15 ], - "value" : true - }, - "thenBody" : [ { - "kind" : "ExprStmt", - "location" : [ 51, 13, 51, 26 ], - "expr" : { - "kind" : "CallExpr", - "location" : [ 51, 13, 51, 26 ], - "function" : { - "kind" : "Identifier", - "location" : [ 51, 13, 51, 17 ], - "name" : "print" - }, - "args" : [ { - "kind" : "StringLiteral", - "location" : [ 51, 19, 51, 25 ], - "value" : "Hello" - } ] - } - } ], - "elseBody" : [ ] - } ], - "elseBody" : [ ] - }, { - "kind" : "ExprStmt", - "location" : [ 52, 5, 52, 18 ], - "expr" : { - "kind" : "CallExpr", - "location" : [ 52, 5, 52, 18 ], - "function" : { - "kind" : "Identifier", - "location" : [ 52, 5, 52, 9 ], - "name" : "print" - }, - "args" : [ { - "kind" : "StringLiteral", - "location" : [ 52, 11, 52, 17 ], - "value" : "World" - } ] + "operator" : "+", + "right" : { + "kind" : "Identifier", + "location" : [ 90, 19, 90, 24 ], + "name" : "b_list" } + } + }, { + "kind" : "AssignStmt", + "location" : [ 91, 1, 91, 15 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 91, 1, 91, 3 ], + "name" : "c_i" } ], - "elseBody" : [ ] + "value" : { + "kind" : "IndexExpr", + "location" : [ 91, 7, 91, 15 ], + "list" : { + "kind" : "Identifier", + "location" : [ 91, 7, 91, 12 ], + "name" : "a_list" + }, + "index" : { + "kind" : "IntegerLiteral", + "location" : [ 91, 14, 91, 14 ], + "value" : 0 + } + } }, { - "kind" : "IfStmt", - "location" : [ 54, 1, 0, 0 ], - "condition" : { - "kind" : "BooleanLiteral", - "location" : [ 54, 4, 54, 7 ], - "value" : true - }, - "thenBody" : [ { - "kind" : "IfStmt", - "location" : [ 55, 5, 59, 22 ], - "condition" : { - "kind" : "BooleanLiteral", - "location" : [ 55, 8, 55, 11 ], - "value" : true + "kind" : "AssignStmt", + "location" : [ 92, 1, 92, 13 ], + "targets" : [ { + "kind" : "IndexExpr", + "location" : [ 92, 1, 92, 9 ], + "list" : { + "kind" : "Identifier", + "location" : [ 92, 1, 92, 6 ], + "name" : "a_list" }, - "thenBody" : [ { - "kind" : "IfStmt", - "location" : [ 56, 9, 0, 0 ], - "condition" : { - "kind" : "BooleanLiteral", - "location" : [ 56, 12, 56, 15 ], - "value" : true - }, - "thenBody" : [ { - "kind" : "ExprStmt", - "location" : [ 57, 13, 57, 26 ], - "expr" : { - "kind" : "CallExpr", - "location" : [ 57, 13, 57, 26 ], - "function" : { - "kind" : "Identifier", - "location" : [ 57, 13, 57, 17 ], - "name" : "print" - }, - "args" : [ { - "kind" : "StringLiteral", - "location" : [ 57, 19, 57, 25 ], - "value" : "Hello" - } ] - } - } ], - "elseBody" : [ ] - } ], - "elseBody" : [ { - "kind" : "ExprStmt", - "location" : [ 59, 9, 59, 22 ], - "expr" : { - "kind" : "CallExpr", - "location" : [ 59, 9, 59, 22 ], - "function" : { - "kind" : "Identifier", - "location" : [ 59, 9, 59, 13 ], - "name" : "print" - }, - "args" : [ { - "kind" : "StringLiteral", - "location" : [ 59, 15, 59, 21 ], - "value" : "World" - } ] - } - } ] + "index" : { + "kind" : "IntegerLiteral", + "location" : [ 92, 8, 92, 8 ], + "value" : 1 + } } ], - "elseBody" : [ ] + "value" : { + "kind" : "IntegerLiteral", + "location" : [ 92, 13, 92, 13 ], + "value" : 2 + } }, { - "kind" : "IfStmt", - "location" : [ 61, 1, 66, 18 ], - "condition" : { - "kind" : "BooleanLiteral", - "location" : [ 61, 4, 61, 7 ], - "value" : true - }, - "thenBody" : [ { - "kind" : "IfStmt", - "location" : [ 62, 5, 0, 0 ], - "condition" : { - "kind" : "BooleanLiteral", - "location" : [ 62, 8, 62, 11 ], - "value" : true - }, - "thenBody" : [ { - "kind" : "IfStmt", - "location" : [ 63, 9, 0, 0 ], - "condition" : { - "kind" : "BooleanLiteral", - "location" : [ 63, 12, 63, 15 ], - "value" : true - }, - "thenBody" : [ { - "kind" : "ExprStmt", - "location" : [ 64, 13, 64, 26 ], - "expr" : { - "kind" : "CallExpr", - "location" : [ 64, 13, 64, 26 ], - "function" : { - "kind" : "Identifier", - "location" : [ 64, 13, 64, 17 ], - "name" : "print" - }, - "args" : [ { - "kind" : "StringLiteral", - "location" : [ 64, 19, 64, 25 ], - "value" : "Hello" - } ] - } - } ], - "elseBody" : [ ] - } ], - "elseBody" : [ ] + "kind" : "AssignStmt", + "location" : [ 97, 1, 97, 16 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 97, 1, 97, 3 ], + "name" : "a_i" } ], - "elseBody" : [ { - "kind" : "ExprStmt", - "location" : [ 66, 5, 66, 18 ], - "expr" : { + "value" : { + "kind" : "BinaryExpr", + "location" : [ 97, 7, 97, 16 ], + "left" : { "kind" : "CallExpr", - "location" : [ 66, 5, 66, 18 ], + "location" : [ 97, 7, 97, 12 ], "function" : { "kind" : "Identifier", - "location" : [ 66, 5, 66, 9 ], - "name" : "print" + "location" : [ 97, 7, 97, 9 ], + "name" : "f_3" }, "args" : [ { - "kind" : "StringLiteral", - "location" : [ 66, 11, 66, 17 ], - "value" : "World" + "kind" : "IntegerLiteral", + "location" : [ 97, 11, 97, 11 ], + "value" : 3 } ] + }, + "operator" : "+", + "right" : { + "kind" : "IntegerLiteral", + "location" : [ 97, 16, 97, 16 ], + "value" : 5 } - } ] + } }, { - "kind" : "AssignStmt", - "location" : [ 70, 1, 70, 10 ], - "targets" : [ { - "kind" : "Identifier", - "location" : [ 70, 1, 70, 1 ], - "name" : "f" - } ], - "value" : { + "kind" : "ExprStmt", + "location" : [ 98, 1, 98, 5 ], + "expr" : { "kind" : "CallExpr", - "location" : [ 70, 5, 70, 10 ], + "location" : [ 98, 1, 98, 5 ], "function" : { "kind" : "Identifier", - "location" : [ 70, 5, 70, 7 ], - "name" : "Foo" + "location" : [ 98, 1, 98, 3 ], + "name" : "f_1" }, - "args" : [ { - "kind" : "IntegerLiteral", - "location" : [ 70, 9, 70, 9 ], - "value" : 1 - } ] + "args" : [ ] } }, { "kind" : "ExprStmt", - "location" : [ 71, 1, 71, 10 ], + "location" : [ 99, 1, 99, 5 ], "expr" : { "kind" : "CallExpr", - "location" : [ 71, 1, 71, 10 ], + "location" : [ 99, 1, 99, 5 ], "function" : { "kind" : "Identifier", - "location" : [ 71, 1, 71, 5 ], - "name" : "print" + "location" : [ 99, 1, 99, 3 ], + "name" : "f_2" }, - "args" : [ { - "kind" : "MemberExpr", - "location" : [ 71, 7, 71, 9 ], - "object" : { - "kind" : "Identifier", - "location" : [ 71, 7, 71, 7 ], - "name" : "f" - }, - "member" : { - "kind" : "Identifier", - "location" : [ 71, 9, 71, 9 ], - "name" : "x" - } - } ] + "args" : [ ] } }, { - "kind" : "ExprStmt", - "location" : [ 72, 1, 72, 8 ], - "expr" : { + "kind" : "AssignStmt", + "location" : [ 104, 1, 104, 20 ], + "targets" : [ { + "kind" : "Identifier", + "location" : [ 104, 1, 104, 3 ], + "name" : "a_i" + } ], + "value" : { "kind" : "MethodCallExpr", - "location" : [ 72, 1, 72, 8 ], + "location" : [ 104, 7, 104, 20 ], "method" : { "kind" : "MemberExpr", - "location" : [ 72, 1, 72, 5 ], + "location" : [ 104, 7, 104, 17 ], "object" : { "kind" : "Identifier", - "location" : [ 72, 1, 72, 1 ], - "name" : "f" + "location" : [ 104, 7, 104, 13 ], + "name" : "a_class" }, "member" : { "kind" : "Identifier", - "location" : [ 72, 3, 72, 5 ], - "name" : "bar" + "location" : [ 104, 15, 104, 17 ], + "name" : "add" } }, "args" : [ { "kind" : "IntegerLiteral", - "location" : [ 72, 7, 72, 7 ], - "value" : 4 - } ] - } - }, { - "kind" : "AssignStmt", - "location" : [ 74, 1, 74, 23 ], - "targets" : [ { - "kind" : "Identifier", - "location" : [ 74, 1, 74, 1 ], - "name" : "a" - } ], - "value" : { - "kind" : "ListExpr", - "location" : [ 74, 3, 74, 23 ], - "elements" : [ { - "kind" : "ListExpr", - "location" : [ 74, 4, 74, 12 ], - "elements" : [ { - "kind" : "ListExpr", - "location" : [ 74, 5, 74, 7 ], - "elements" : [ { - "kind" : "IntegerLiteral", - "location" : [ 74, 6, 74, 6 ], - "value" : 1 - } ] - }, { - "kind" : "ListExpr", - "location" : [ 74, 9, 74, 11 ], - "elements" : [ { - "kind" : "IntegerLiteral", - "location" : [ 74, 10, 74, 10 ], - "value" : 2 - } ] - } ] - }, { - "kind" : "ListExpr", - "location" : [ 74, 14, 74, 22 ], - "elements" : [ { - "kind" : "ListExpr", - "location" : [ 74, 15, 74, 17 ], - "elements" : [ { - "kind" : "IntegerLiteral", - "location" : [ 74, 16, 74, 16 ], - "value" : 3 - } ] - }, { - "kind" : "ListExpr", - "location" : [ 74, 19, 74, 21 ], - "elements" : [ { - "kind" : "IntegerLiteral", - "location" : [ 74, 20, 74, 20 ], - "value" : 4 - } ] - } ] + "location" : [ 104, 19, 104, 19 ], + "value" : 2 } ] } }, { "kind" : "ExprStmt", - "location" : [ 75, 1, 75, 28 ], + "location" : [ 105, 1, 105, 10 ], "expr" : { "kind" : "CallExpr", - "location" : [ 75, 1, 75, 28 ], + "location" : [ 105, 1, 105, 10 ], "function" : { "kind" : "Identifier", - "location" : [ 75, 1, 75, 5 ], + "location" : [ 105, 1, 105, 5 ], "name" : "print" }, "args" : [ { - "kind" : "BinaryExpr", - "location" : [ 75, 7, 75, 27 ], - "left" : { - "kind" : "IndexExpr", - "location" : [ 75, 7, 75, 16 ], - "list" : { - "kind" : "IndexExpr", - "location" : [ 75, 7, 75, 13 ], - "list" : { - "kind" : "IndexExpr", - "location" : [ 75, 7, 75, 10 ], - "list" : { - "kind" : "Identifier", - "location" : [ 75, 7, 75, 7 ], - "name" : "a" - }, - "index" : { - "kind" : "IntegerLiteral", - "location" : [ 75, 9, 75, 9 ], - "value" : 0 - } - }, - "index" : { - "kind" : "IntegerLiteral", - "location" : [ 75, 12, 75, 12 ], - "value" : 0 - } - }, - "index" : { - "kind" : "IntegerLiteral", - "location" : [ 75, 15, 75, 15 ], - "value" : 1 - } - }, - "operator" : "*", - "right" : { - "kind" : "IndexExpr", - "location" : [ 75, 18, 75, 27 ], - "list" : { - "kind" : "IndexExpr", - "location" : [ 75, 18, 75, 24 ], - "list" : { - "kind" : "IndexExpr", - "location" : [ 75, 18, 75, 21 ], - "list" : { - "kind" : "Identifier", - "location" : [ 75, 18, 75, 18 ], - "name" : "a" - }, - "index" : { - "kind" : "IntegerLiteral", - "location" : [ 75, 20, 75, 20 ], - "value" : 1 - } - }, - "index" : { - "kind" : "IntegerLiteral", - "location" : [ 75, 23, 75, 23 ], - "value" : 1 - } - }, - "index" : { - "kind" : "IntegerLiteral", - "location" : [ 75, 26, 75, 26 ], - "value" : 0 - } - } + "kind" : "Identifier", + "location" : [ 105, 7, 105, 9 ], + "name" : "a_i" } ] } }, { "kind" : "AssignStmt", - "location" : [ 77, 1, 78, 10 ], - "targets" : [ { - "kind" : "Identifier", - "location" : [ 77, 1, 77, 16 ], - "name" : "multiline_string" - } ], - "value" : { - "kind" : "StringLiteral", - "location" : [ 77, 18, 78, 10 ], - "value" : "Hi World,\nHere I am" - } - }, { - "kind" : "AssignStmt", - "location" : [ 80, 1, 80, 34 ], + "location" : [ 108, 1, 108, 36 ], "targets" : [ { "kind" : "Identifier", - "location" : [ 80, 1, 80, 15 ], - "name" : "expr_precedence" + "location" : [ 108, 1, 108, 3 ], + "name" : "a_i" } ], "value" : { - "kind" : "BinaryExpr", - "location" : [ 80, 19, 80, 34 ], - "left" : { - "kind" : "UnaryExpr", - "location" : [ 80, 19, 80, 20 ], - "operator" : "-", - "operand" : { + "kind" : "MethodCallExpr", + "location" : [ 108, 7, 108, 36 ], + "method" : { + "kind" : "MemberExpr", + "location" : [ 108, 7, 108, 17 ], + "object" : { + "kind" : "Identifier", + "location" : [ 108, 7, 108, 13 ], + "name" : "a_class" + }, + "member" : { "kind" : "Identifier", - "location" : [ 80, 20, 80, 20 ], - "name" : "a" + "location" : [ 108, 15, 108, 17 ], + "name" : "add" } }, - "operator" : "+", - "right" : { - "kind" : "BinaryExpr", - "location" : [ 80, 24, 80, 34 ], - "left" : { + "args" : [ { + "kind" : "MemberExpr", + "location" : [ 108, 19, 108, 35 ], + "object" : { "kind" : "Identifier", - "location" : [ 80, 24, 80, 24 ], - "name" : "b" + "location" : [ 108, 19, 108, 25 ], + "name" : "c_class" }, - "operator" : "*", - "right" : { - "kind" : "BinaryExpr", - "location" : [ 80, 29, 80, 33 ], - "left" : { - "kind" : "Identifier", - "location" : [ 80, 29, 80, 29 ], - "name" : "c" - }, - "operator" : "+", - "right" : { - "kind" : "Identifier", - "location" : [ 80, 33, 80, 33 ], - "name" : "d" - } + "member" : { + "kind" : "Identifier", + "location" : [ 108, 27, 108, 35 ], + "name" : "b_class_i" } - } - } - }, { - "kind" : "AssignStmt", - "location" : [ 82, 1, 82, 12 ], - "targets" : [ { - "kind" : "Identifier", - "location" : [ 82, 1, 82, 5 ], - "name" : "stone" - } ], - "value" : { - "kind" : "StringLiteral", - "location" : [ 82, 7, 82, 12 ], - "value" : "Blue" + } ] } }, { "kind" : "ExprStmt", - "location" : [ 83, 1, 83, 24 ], + "location" : [ 109, 1, 109, 10 ], "expr" : { "kind" : "CallExpr", - "location" : [ 83, 1, 83, 24 ], + "location" : [ 109, 1, 109, 10 ], "function" : { "kind" : "Identifier", - "location" : [ 83, 1, 83, 5 ], + "location" : [ 109, 1, 109, 5 ], "name" : "print" }, "args" : [ { - "kind" : "CallExpr", - "location" : [ 83, 7, 83, 23 ], - "function" : { - "kind" : "Identifier", - "location" : [ 83, 7, 83, 16 ], - "name" : "get_stones" - }, - "args" : [ { - "kind" : "Identifier", - "location" : [ 83, 18, 83, 22 ], - "name" : "stone" - } ] + "kind" : "Identifier", + "location" : [ 109, 7, 109, 9 ], + "name" : "a_i" } ] } } ], "errors" : { "errors" : [ { "kind" : "CompilerError", - "location" : [ 5, 9, 5, 16 ], + "location" : [ 4, 9, 4, 16 ], "message" : "Method overridden with different type signature: __init__" - }, { - "kind" : "CompilerError", - "location" : [ 8, 9, 8, 11 ], - "message" : "First parameter of the following method must be of the enclosing class: bar" } ], "kind" : "Errors", "location" : [ 0, 0, 0, 0 ]