<s> from __future__ import unicode_literals <EOL> import pytest <EOL> from arpeggio import ZeroOrMore , OneOrMore , ParserPython , NonTerminal , EOF <EOL> def test_zeroormore_eolterm ( ) : <EOL> def grammar ( ) : return first , second , EOF <EOL> def first ( ) : return ZeroOrMore ( [ "<STR_LIT:a>" , "<STR_LIT:b>" ] , eolterm = True ) <EOL> def second ( ) : return "<STR_LIT:a>" <EOL> input = """<STR_LIT>""" <EOL> parser = ParserPython ( grammar , reduce_tree = False ) <EOL> result = parser . parse ( input ) <EOL> assert result <EOL> def test_oneormore_eolterm ( ) : <EOL> def grammar ( ) : return first , second , EOF <EOL> def first ( ) : return OneOrMore ( [ "<STR_LIT:a>" , "<STR_LIT:b>" ] , eolterm = True ) <EOL> def second ( ) : return "<STR_LIT:a>" <EOL> input = """<STR_LIT>""" <EOL> parser = ParserPython ( grammar , reduce_tree = False ) <EOL> result = parser . parse ( input ) <EOL> assert result </s>
