selving range

This commit is contained in:
lyon 2021-12-25 14:24:52 +08:00
parent 94ff412dc9
commit b292380c20

View File

@ -760,13 +760,23 @@ AST* AST_parseLine(char* line, Stack* blockStack) {
list_in = strsAppend(list_buffs, list_in, token);
token = Lexer_popToken(list_buffs, tokens) + 1;
if (strEqu("range", token)) {
// isRange = 1;
}
while (!strEqu(token, ":")) {
list_in = strsAppend(list_buffs, list_in, token);
token = Lexer_popToken(list_buffs, tokens) + 1;
isRange = 1;
while (!strEqu(token, ":")) {
list_in = strsAppend(list_buffs, list_in, token);
token = Lexer_popToken(list_buffs, tokens) + 1;
}
if (NULL != blockStack) {
stack_pushStr(blockStack, "for");
}
stmt = "";
args_deinit(list_buffs);
goto block_matched;
}
if (!isRange) {
while (!strEqu(token, ":")) {
list_in = strsAppend(list_buffs, list_in, token);
token = Lexer_popToken(list_buffs, tokens) + 1;
}
list_in = strsAppend(list_buffs, "iter(", list_in);
list_in = strsAppend(list_buffs, list_in, ")");
list_in = strsCopy(buffs, list_in);