22 lines
621 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) {
pikaScriptShell(pikaScriptInit());
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");
pks_printVersion();
__platform_printf("===========================================\r\n");
pikaVM_runFile(pikaMain, argv[1]);
obj_deinit(pikaMain);
return 0;
}
2021-10-01 00:21:50 +08:00
}