FINALLY fixed an error that took weeks. Turned out that the ParseRule was shallow copied, and the lookahead was not copied correctly. So it got extended and thus skipped over the state when it should have been redone.
This commit is contained in:
@@ -29,7 +29,12 @@ const bool ParseRule::operator!=(const ParseRule &other) {
|
||||
}
|
||||
|
||||
ParseRule* ParseRule::clone() {
|
||||
return( new ParseRule(leftHandle, pointerIndex, rightSide, lookahead) );
|
||||
std::vector<Symbol>* newLookahead = NULL;
|
||||
if (lookahead) {
|
||||
newLookahead = new std::vector<Symbol>();
|
||||
*newLookahead = *lookahead;
|
||||
}
|
||||
return( new ParseRule(leftHandle, pointerIndex, rightSide, newLookahead) );
|
||||
}
|
||||
|
||||
void ParseRule::setLeftHandle(Symbol leftHandle) {
|
||||
|
||||
Reference in New Issue
Block a user