From 60226dca5c100460d21d04f1bf6851c91ed0b5ae Mon Sep 17 00:00:00 2001 From: lyon1998 Date: Fri, 18 Mar 2022 22:20:44 +0800 Subject: [PATCH] fix arg name in pikaCompile --- src/PikaObj.h | 2 +- src/PikaParser.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/PikaObj.h b/src/PikaObj.h index 2837ddf17..31049f3fd 100644 --- a/src/PikaObj.h +++ b/src/PikaObj.h @@ -216,6 +216,6 @@ void obj_shellLineProcess(PikaObj* self, __platform_fwrite() __platform_fclose() */ -int pikaCompile(char* python_lines, char* output_file_name); +int pikaCompile(char* output_file_name, char* py_lines); #endif diff --git a/src/PikaParser.c b/src/PikaParser.c index baa6dabe1..9a47c9334 100644 --- a/src/PikaParser.c +++ b/src/PikaParser.c @@ -1615,10 +1615,10 @@ static void __handler_instructArray_output_file(InstructArray* self, __platform_fwrite() __platform_fclose() */ -int pikaCompile(char* python_lines, char* output_file_name) { +int pikaCompile(char* output_file_name, char* py_lines) { ByteCodeFrame bytecode_frame = {0}; - FILE* bytecode_f = __platform_fopen(python_lines, "w+"); + FILE* bytecode_f = __platform_fopen(output_file_name, "w+"); /* main process */ /* step 1, get size of const pool and instruct array */ @@ -1627,7 +1627,7 @@ int pikaCompile(char* python_lines, char* output_file_name) { bytecode_frame.instruct_array.output_f = bytecode_f; bytecode_frame.instruct_array.output_redirect_fun = __handler_instructArray_output_none; - Parser_parsePyLines(NULL, &bytecode_frame, output_file_name); + Parser_parsePyLines(NULL, &bytecode_frame, py_lines); uint16_t const_pool_size = bytecode_frame.const_pool.size; uint16_t instruct_array_size = bytecode_frame.instruct_array.size; byteCodeFrame_deinit(&bytecode_frame); @@ -1640,7 +1640,7 @@ int pikaCompile(char* python_lines, char* output_file_name) { /* instruct array to file */ bytecode_frame.instruct_array.output_redirect_fun = __handler_instructArray_output_file; - Parser_parsePyLines(NULL, &bytecode_frame, output_file_name); + Parser_parsePyLines(NULL, &bytecode_frame, py_lines); byteCodeFrame_deinit(&bytecode_frame); /* step 3, write const pool to file */ @@ -1657,7 +1657,7 @@ int pikaCompile(char* python_lines, char* output_file_name) { /* instruct array to none */ bytecode_frame.instruct_array.output_redirect_fun = __handler_instructArray_output_none; - Parser_parsePyLines(NULL, &bytecode_frame, output_file_name); + Parser_parsePyLines(NULL, &bytecode_frame, py_lines); byteCodeFrame_deinit(&bytecode_frame); /* deinit */