2022-01-03 21:54:34 +08:00
|
|
|
Compiler { dist_path: "pikascript-api/", source_path: "", class_list: {"Device": ClassInfo { this_class_name: "Device", super_class_name: "TinyObj", method_list: {"LED": MethodInfo { class_name: "Device", name: "LED", arg_list: None, return_type: Some(PyType { type_name: "any" }) }, "Uart": MethodInfo { class_name: "Device", name: "Uart", arg_list: None, return_type: Some(PyType { type_name: "any" }) }}, object_list: {}, import_list: {}, script_list: Script { content: "" }, is_package: true }, "Device_LED": ClassInfo { this_class_name: "Device_LED", super_class_name: "TinyObj", method_list: {"off": MethodInfo { class_name: "Device_LED", name: "off", arg_list: None, return_type: None }, "on": MethodInfo { class_name: "Device_LED", name: "on", arg_list: None, return_type: None }}, object_list: {}, import_list: {}, script_list: Script { content: "" }, is_package: false }, "Device_Uart": ClassInfo { this_class_name: "Device_Uart", super_class_name: "TinyObj", method_list: {"printName": MethodInfo { class_name: "Device_Uart", name: "printName", arg_list: None, return_type: None }, "send": MethodInfo { class_name: "Device_Uart", name: "send", arg_list: Some(ArgList { py_arg_list: "data:str", list: {"data": PyArg { py_type: PyType { type_name: "str" }, name: "data" }} }), return_type: None }, "setName": MethodInfo { class_name: "Device_Uart", name: "setName", arg_list: Some(ArgList { py_arg_list: "name:str", list: {"name": PyArg { py_type: PyType { type_name: "str" }, name: "name" }} }), return_type: None }}, object_list: {}, import_list: {}, script_list: Script { content: "" }, is_package: false }, "PikaMain": ClassInfo { this_class_name: "PikaMain", super_class_name: "PikaStdLib_SysObj", method_list: {}, object_list: {"Device": ObjectInfo { class_name: "PikaMain", name: "Device", import_class_name: "Device" }, "PikaStdData": ObjectInfo { class_name: "PikaMain", name: "PikaStdData", import_class_name: "PikaStdData" }, "PikaStdLib": ObjectInfo { class_name: "PikaMain", name: "PikaStdLib", import_class_name: "PikaStdLib" }}, import_list: {}, script_list: Script { content: " \"\\n\"\n \"mem = PikaStdLib.MemChecker()\\n\"\n \"\\n\"\n \"print('mem used max:')\\n\"\n \"mem.max()\\n\"\n \"\\n\"\n \"def EXPECT_EQ(test_name, input, expected):\\n\"\n \" print('-----TEST-----')\\n\"\n \" print(test_name)\\n\"\n \" if input != expected:\\n\"\n \" print('[Error]')\\n\"\n \" print(test_name)\\n\"\n \" print('[info] Expected:')\\n\"\n \" print(expected)\\n\"\n \" print('[info] Input:')\\n\"\n \" print(input)\\n\"\n \" # error\\n\"\n \" while True:\\n\"\n \" is_error = 1\\n\"\n \" else:\\n\"\n \" print('[ OK ]')\\n\"\n \"\\n\"\n \"a = 0\\n\"\n \"for i in range(0, 10):\\n\"\n \" if i == 5:\\n\"\n \" continue\\n\"\n \" a = a + i\\n\"\n \"EXPECT_EQ('for_if_continue', a, 40)\\n\"\n \" \\n\"\n \"a = 0\\n\"\n \"for i in range(0, 10):\\n\"\n \" if i == 5:\\n\"\n \" break\\n\"\n \" a = a + i\\n\"\n \"EXPECT_EQ('for_if_break', a, 10)\\n\"\n \"\\n\"\n \"a = 0\\n\"\n \"for i in range(0, 10):\\n\"\n \" for k in range(0, 3):\\n\"\n \" # print(k)\\n\"\n \" a = a + k\\n\"\n \"EXPECT_EQ('for_for_in_range', a, 30)\\n\"\n \"\\n\"\n \"a = 0\\n\"\n \"for i in range(0, 10):\\n\"\n \" # print(i)\\n\"\n \" a = a + i\\n\"\n \"EXPECT_EQ('for_in_range', a, 45)\\n\"\n \"\\n\"\n \"list = PikaStdData.List()\\n\"\n \"list.append(7)\\n\"\n \"list.append('eee')\\n\"\n
|