2021-10-01 00:21:50 +08:00
|
|
|
/* this demo shows the usage of method */
|
|
|
|
#include <stdio.h>
|
2022-06-23 15:37:04 +08:00
|
|
|
#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
|
|
|
|
2022-06-23 15:37:04 +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");
|
2022-06-23 15:37:04 +08:00
|
|
|
pikaVM_runFile(pikaMain, argv[1]);
|
|
|
|
obj_deinit(pikaMain);
|
|
|
|
return 0;
|
|
|
|
}
|
2021-10-01 00:21:50 +08:00
|
|
|
}
|