#NEWLINE# def test_issue_22( ) : #NEWLINE# #INDENT# '\n    Infinite recursion during resolving of a grammar given in a clean PEG\n    notation.\n    ' #NEWLINE# current_dir = os . path . dirname ( __file__ ) #NEWLINE# grammar1 = open ( os . path . join ( current_dir , 'grammar1.peg' ) ) . read ( ) #NEWLINE# parser1 = ParserPEG ( grammar2 , 'belang' ) #NEWLINE# parser1 . parse ( 'a [0]' ) #NEWLINE# parser1 . parse ( 'a (0)' ) #NEWLINE# grammar2 = open ( os . path . join ( current_dir , 'grammar2.peg' ) ) . read ( ) #NEWLINE# parser2 = ParserPEG ( grammar2 , 'belang' , debug = True ) #NEWLINE# parser2 . parse ( 'a [0](1)[2]' )