1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-23 03:32:32 +00:00

Ensured that the mark_end step can't overwrite another recognised symbol.

This commit is contained in:
Thomas Harte 2017-07-22 15:40:22 -04:00
parent a6b239698c
commit 456fdda6c2

View File

@ -35,7 +35,7 @@ template <typename SymbolType> class Parser {
while(!has_next_symbol_ && !tape->is_at_end()) {
process_pulse(tape->get_next_pulse());
}
if(tape->is_at_end()) mark_end();
if(!has_next_symbol_ && tape->is_at_end()) mark_end();
has_next_symbol_ = false;
return next_symbol_;
}