Take care for -> and pop the stack if something has been pushed onto the stack
@@ -116,20 +116,19 @@ struct Scanner {
}
if (!valid_symbols[ARROW] && isolated_sequence(lexer, "->")) {
- if (iswspace(lexer->lookahead)) {
- indent_length_stack.pop_back();
if (valid_symbols[LAYOUT_CLOSE_BRACE]) {
+ indent_length_stack.pop_back();
lexer->result_symbol = LAYOUT_CLOSE_BRACE;
return true;
} else {
- if (valid_symbols[LAYOUT_SEMICOLON]) {
+ if (valid_symbols[LAYOUT_SEMICOLON] && indent_length_stack.size() > 1) {
+ indent_length_stack.pop_back();
queued_close_brace_count++;
lexer->result_symbol = LAYOUT_SEMICOLON;
return true;
}
}
}
- }
if (lexer->lookahead != '\n') return false;
advance(lexer);
