fix arg name in pikaCompile

This commit is contained in:
lyon1998 2022-03-18 22:20:44 +08:00
parent 12ed4d40f6
commit 60226dca5c
2 changed files with 6 additions and 6 deletions

View File

@ -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

View File

@ -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 */