mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-15 17:02:53 +08:00
add isToFlash to saveSingleAsm
This commit is contained in:
parent
6f37568ba7
commit
aafa703e03
@ -306,7 +306,10 @@ char* pikaParseLineToAsm(Args* buffs, char* line, Stack* blockStack) {
|
|||||||
return pikaAsm;
|
return pikaAsm;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Arg* saveSingleAsm(Args* buffs, Arg* pikaAsmBuff, char* singleAsm) {
|
static Arg* saveSingleAsm(Args* buffs,
|
||||||
|
Arg* pikaAsmBuff,
|
||||||
|
char* singleAsm,
|
||||||
|
uint8_t isToFlash) {
|
||||||
char* pikaAsm = arg_getStr(pikaAsmBuff);
|
char* pikaAsm = arg_getStr(pikaAsmBuff);
|
||||||
pikaAsm = strsAppend(buffs, pikaAsm, singleAsm);
|
pikaAsm = strsAppend(buffs, pikaAsm, singleAsm);
|
||||||
arg_deinit(pikaAsmBuff);
|
arg_deinit(pikaAsmBuff);
|
||||||
@ -323,9 +326,9 @@ char* pikaParseMultiLineToAsm(Args* outBuffs, char* multiLine) {
|
|||||||
Arg* pikaAsmBuff = arg_setStr(NULL, "", "");
|
Arg* pikaAsmBuff = arg_setStr(NULL, "", "");
|
||||||
uint32_t lineOffset = 0;
|
uint32_t lineOffset = 0;
|
||||||
uint32_t multiLineSize = strGetSize(multiLine);
|
uint32_t multiLineSize = strGetSize(multiLine);
|
||||||
uint8_t isSave = 0;
|
uint8_t isToFlash = 0;
|
||||||
if (strCountSign(multiLine, '\n') > 1) {
|
if (strCountSign(multiLine, '\n') > 1) {
|
||||||
isSave = 1;
|
isToFlash = 1;
|
||||||
}
|
}
|
||||||
while (1) {
|
while (1) {
|
||||||
Args* singleRunBuffs = New_strBuff();
|
Args* singleRunBuffs = New_strBuff();
|
||||||
@ -334,14 +337,17 @@ char* pikaParseMultiLineToAsm(Args* outBuffs, char* multiLine) {
|
|||||||
uint32_t lineSize = strGetSize(line);
|
uint32_t lineSize = strGetSize(line);
|
||||||
lineOffset = lineOffset + lineSize + 1;
|
lineOffset = lineOffset + lineSize + 1;
|
||||||
char* singleAsm = pikaParseLineToAsm(singleRunBuffs, line, blockStack);
|
char* singleAsm = pikaParseLineToAsm(singleRunBuffs, line, blockStack);
|
||||||
pikaAsmBuff = saveSingleAsm(singleRunBuffs, pikaAsmBuff, singleAsm);
|
pikaAsmBuff =
|
||||||
|
saveSingleAsm(singleRunBuffs, pikaAsmBuff, singleAsm, isToFlash);
|
||||||
args_deinit(singleRunBuffs);
|
args_deinit(singleRunBuffs);
|
||||||
if (lineOffset >= multiLineSize) {
|
if (lineOffset >= multiLineSize) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
char* outAsm = getOutAsm(outBuffs, pikaAsmBuff);
|
char* outAsm = getOutAsm(outBuffs, pikaAsmBuff);
|
||||||
|
if (NULL != pikaAsmBuff) {
|
||||||
arg_deinit(pikaAsmBuff);
|
arg_deinit(pikaAsmBuff);
|
||||||
|
}
|
||||||
stack_deinit(blockStack);
|
stack_deinit(blockStack);
|
||||||
return outAsm;
|
return outAsm;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user