24 lines
690 B
C
Raw Normal View History

2021-10-01 00:21:50 +08:00
/* this demo shows the usage of method */
#include <stdio.h>
#include "PikaMain.h"
#include "PikaVM.h"
2022-01-06 16:17:40 +08:00
#include "pikaScript.h"
2021-10-01 00:21:50 +08:00
int main(int argc, char* argv[]) {
if (1 == argc) {
2023-05-01 18:34:49 +08:00
PikaObj* pikaMain = pikaScriptInit();
pikaScriptShell(pikaMain);
obj_deinit(pikaMain);
return 0;
}
if (2 == argc) {
PikaObj* pikaMain = newRootObj("pikaMain", New_PikaMain);
2022-07-04 17:19:50 +08:00
__platform_printf("======[pikascript packages installed]======\r\n");
2023-06-10 01:47:11 +08:00
pika_printVersion();
2022-07-04 17:19:50 +08:00
__platform_printf("===========================================\r\n");
pikaVM_runFile(pikaMain, argv[1]);
obj_deinit(pikaMain);
return 0;
}
2021-10-01 00:21:50 +08:00
}