#NEWLINE# def test_zero_or_more( ) : #NEWLINE# #INDENT# def grammar( ) : #NEWLINE# #INDENT# return ( ZeroOrMore ( 'a' ) , EOF ) #NEWLINE# #UNINDENT# parser = ParserPython ( grammar ) #NEWLINE# parsed = parser . parse ( 'aaaaaaa' ) #NEWLINE# assert ( str ( parsed ) == 'a | a | a | a | a | a | a | ' ) #NEWLINE# assert ( repr ( parsed ) == "[  'a' [0],  'a' [1],  'a' [2],  'a' [3],  'a' [4],  'a' [5],  'a' [6], EOF [7] ]" ) #NEWLINE# parsed = parser . parse ( '' ) #NEWLINE# assert ( str ( parsed ) == '' ) #NEWLINE# assert ( repr ( parsed ) == '[ EOF [0] ]' ) #NEWLINE# with pytest . raises ( NoMatch ) : #NEWLINE# #INDENT# parser . parse ( 'bbb' )