From ea986f3ef8bc0e278e16edef9e6fc1aa3662ff99 Mon Sep 17 00:00:00 2001 From: lyon Date: Sat, 10 Jun 2023 16:54:36 +0800 Subject: [PATCH] update pikaCompiler api to new api --- port/linux/run.sh | 1 + port/linux/version_config.py | 4 ++-- src/PikaObj.c | 3 ++- src/PikaVersion.h | 6 +++--- src/pika_adapter_old_api.h | 2 ++ tools/pikaCompiler/src/class_info.rs | 12 ++++++------ tools/pikaCompiler/src/entry.rs | 6 +++--- 7 files changed, 19 insertions(+), 15 deletions(-) diff --git a/port/linux/run.sh b/port/linux/run.sh index b0214c556..de14ae221 100644 --- a/port/linux/run.sh +++ b/port/linux/run.sh @@ -1,2 +1,3 @@ +bash make.sh cd package/pikascript && \ ./pika $1 diff --git a/port/linux/version_config.py b/port/linux/version_config.py index 640864216..1d355291e 100644 --- a/port/linux/version_config.py +++ b/port/linux/version_config.py @@ -1,3 +1,3 @@ MajorVersion = "1" -MinorVersion = "12" -MicroVersion = "3" +MinorVersion = "13" +MicroVersion = "0" diff --git a/src/PikaObj.c b/src/PikaObj.c index 342253054..8dac4d65a 100644 --- a/src/PikaObj.c +++ b/src/PikaObj.c @@ -758,7 +758,7 @@ PikaObj* newRootObj(char* name, NewFun newObjFun) { logo_printed = 1; pika_platform_printf("\r\n"); pika_platform_printf("~~~/ POWERED BY \\~~~\r\n"); - pika_platform_printf("~ pikascript.com ~\r\n"); + pika_platform_printf("~ pikapython.com ~\r\n"); pika_platform_printf("~~~~~~~~~~~~~~~~~~~~\r\n"); } if (NULL != __pikaMain) { @@ -2783,6 +2783,7 @@ void _do_pika_eventListener_send(PikaEventListener* self, } __exit: pika_GIL_EXIT(); + return; #endif } diff --git a/src/PikaVersion.h b/src/PikaVersion.h index ccd1337bc..bade1be9a 100644 --- a/src/PikaVersion.h +++ b/src/PikaVersion.h @@ -1,5 +1,5 @@ #define PIKA_VERSION_MAJOR 1 -#define PIKA_VERSION_MINOR 12 -#define PIKA_VERSION_MICRO 3 +#define PIKA_VERSION_MINOR 13 +#define PIKA_VERSION_MICRO 0 -#define PIKA_EDIT_TIME "2023/05/14 12:55:46" +#define PIKA_EDIT_TIME "2023/06/10 16:44:53" diff --git a/src/pika_adapter_old_api.h b/src/pika_adapter_old_api.h index 05cb8c2e9..fbd98e696 100644 --- a/src/pika_adapter_old_api.h +++ b/src/pika_adapter_old_api.h @@ -102,6 +102,8 @@ extern "C" { #define PIKA_BOOL pika_bool #define PIKA_TRUE pika_true #define PIKA_FALSE pika_false +#define pikaScriptInit pikaPythonInit +#define pikaScriptShell pikaPythonShell #endif diff --git a/tools/pikaCompiler/src/class_info.rs b/tools/pikaCompiler/src/class_info.rs index 0d432312f..096aaf431 100644 --- a/tools/pikaCompiler/src/class_info.rs +++ b/tools/pikaCompiler/src/class_info.rs @@ -142,25 +142,25 @@ impl ClassInfo { pub fn script_fn(&self, version_info: VersionInfo) -> String { let mut script_fn = String::new(); - /* add pikaScriptInit function define */ + /* add pikaPythonInit function define */ script_fn.push_str("volatile PikaObj *__pikaMain;\r\n"); - script_fn.push_str("PikaObj *pikaScriptInit(void){\r\n"); + script_fn.push_str("PikaObj *pikaPythonInit(void){\r\n"); /* print version info */ script_fn.push_str( - " __platform_printf(\"======[pikascript packages installed]======\\r\\n\");\r\n", + " pika_platform_printf(\"======[pikapython packages installed]======\\r\\n\");\r\n", ); - script_fn.push_str(" pks_printVersion();\r\n"); + script_fn.push_str(" pika_printVersion();\r\n"); for (package_name, package_version) in version_info.package_list { script_fn.push_str( format!( - " __platform_printf(\"{}=={}\\r\\n\");\r\n", + " pika_platform_printf(\"{}=={}\\r\\n\");\r\n", package_name, package_version ) .as_str(), ); } script_fn.push_str( - " __platform_printf(\"===========================================\\r\\n\");\r\n", + " pika_platform_printf(\"===========================================\\r\\n\");\r\n", ); /* create the root object */ script_fn.push_str(" PikaObj* pikaMain = newRootObj(\"pikaMain\", New_PikaMain);\r\n"); diff --git a/tools/pikaCompiler/src/entry.rs b/tools/pikaCompiler/src/entry.rs index 0a472eb0a..a2e520fa4 100644 --- a/tools/pikaCompiler/src/entry.rs +++ b/tools/pikaCompiler/src/entry.rs @@ -18,12 +18,12 @@ pub fn pika_compiler_entry() { "; /* new a version_info object */ - println!("(pikascript) packages installed:"); + println!("(pikapython) packages installed:"); let mut version_info = VersionInfo::new(); version_info = VersionInfo::analyse_file(version_info, String::from("requestment.txt")); println!(); - println!("(pikascript) pika compiler:"); + println!("(pikapython) pika compiler:"); /* new a compiler, sellect to path */ let mut compiler = Compiler::new(String::from(""), String::from("pikascript-api/")); @@ -166,7 +166,7 @@ pub fn pika_compiler_entry() { f.write("#include \"PikaObj.h\"\n".as_bytes()).unwrap(); f.write("#include \"PikaMain.h\"\n".as_bytes()).unwrap(); f.write("\n".as_bytes()).unwrap(); - f.write("PikaObj * pikaScriptInit(void);\n".as_bytes()) + f.write("PikaObj * pikaPythonInit(void);\n".as_bytes()) .unwrap(); f.write("\n".as_bytes()).unwrap(); f.write("#endif\n".as_bytes()).unwrap();