Increment i after finding the end iterator when parsing variables
Signed-off-by: Username404 <w.iron.zombie@gmail.com>
This commit is contained in:
parent
01abadc1fa
commit
adbe98ec00
|
@ -77,12 +77,11 @@ namespace Parser {
|
|||
}
|
||||
const unsigned increment = 2 + isFinalDefine;
|
||||
const auto beginning = lexed.begin() + i + increment;
|
||||
parseTree << Define(isFinalDefine, current.toktext, parse( // TODO Find another way of choosing the tokens to parse
|
||||
beginning, find_if(beginning, lexed.end(), [¤t](const tok& it){
|
||||
return it.line != current.line;
|
||||
})
|
||||
));
|
||||
i += increment;
|
||||
const auto end = find_if(beginning, lexed.end(), [¤t](const tok& it){ // TODO Find another way of choosing the tokens to parse
|
||||
return it.line != current.line;
|
||||
});
|
||||
parseTree << Define(isFinalDefine, current.toktext, parse(beginning, end));
|
||||
i += 1 + isFinalDefine + distance(beginning, end);
|
||||
} else if (next.toktype == LPAR) {
|
||||
parseTree << Call(current.toktext);
|
||||
} else
|
||||
|
|
Loading…
Reference in New Issue