fix 'from PikaObj import *' error info

This commit is contained in:
lyon 2022-05-19 21:31:08 +08:00
parent 971c7ffc48
commit aaffdbaee1
4 changed files with 10 additions and 1 deletions

View File

@ -1,3 +1,4 @@
from PikaObj import *
import PikaStdLib
import PikaStdData
import ctypes
@ -6,3 +7,5 @@ import PikaMath
import PikaStdDevice
import test_module1
import test_cmodule
print('hello pikascript!')

View File

@ -1437,6 +1437,12 @@ static char* Parser_PreProcess_from(Args* buffs_p, char* line) {
alias = class;
}
/* skip PikaObj */
if (strEqu(module, "PikaObj")){
line_out = strsCopy(buffs_p, "");
goto exit;
}
line_out = strsFormat(&buffs, PIKA_LINE_BUFF_SIZE, "import %s\n%s = %s.%s",
module, alias, module, class);
line_out = strsCopy(buffs_p, line_out);