block = block_prev.next
if block is not None:
block_pos = block.pos
- file_in = yyin
action = yy_dfa_start_action[yystart]
while action != -1:
assert yy_dfa_states[state][2] == [0]
break
+ yy_buffer_stack[-1].file_in = yyin
while block is None or block_pos >= len(block.text):
if block is None:
- text = file_in.readline()
+ file_in = yy_buffer_stack[buffer_ptr].file_in
+ text = '' if file_in is None else file_in.readline()
if len(text):
block = YYBufferBlock(None, 0, text)
block_pos = 0
block_prev.next = block
else:
+ # do not re-attempt read once EOF is reached
+ yy_buffer_stack[buffer_ptr].file_in = None
+ yyin = yy_buffer_stack[-1].file_in
buffer_ptr -= 1
if buffer_ptr < 0:
break # EOF
block = block_prev.next
if block is not None:
block_pos = block.pos
- file_in = yy_buffer_stack[buffer_ptr].file_in
else:
i = match_len - len(match)
if i:
block = block_prev.next
if block is not None:
block_pos = block.pos
- file_in = yyin
action = yy_dfa_start_action[yystart]
while action != -1:
assert yy_dfa_states[state][2] == [0]
break
+ yy_buffer_stack[-1].file_in = yyin
while block is None or block_pos >= len(block.text):
if block is None:
- text = file_in.readline()
+ file_in = yy_buffer_stack[buffer_ptr].file_in
+ text = '' if file_in is None else file_in.readline()
if len(text):
block = YYBufferBlock(None, 0, text)
block_pos = 0
block_prev.next = block
else:
+ # do not re-attempt read once EOF is reached
+ yy_buffer_stack[buffer_ptr].file_in = None
+ yyin = yy_buffer_stack[-1].file_in
buffer_ptr -= 1
if buffer_ptr < 0:
break # EOF
block = block_prev.next
if block is not None:
block_pos = block.pos
- file_in = yy_buffer_stack[buffer_ptr].file_in
else:
i = match_len - len(match)
if i: