Buggy code:
public class TestParse { public static void main ( String [ ] args ) { MathParser tree = new MathParser ( ) ; for ( ParseFunc p : tree . getFunctionList ( ) ) { System . out . print ( ( ( p . getName ( ) ) + "<seq2seq4repair_space>" ) ) ; } System . out . println ( ) ; String str = "3+4%6-2" ; tree . parse ( str ) ; System . out . println ( ( ( ( ( ( ( ( "\"" + str ) + "\"<seq2seq4repair_space>=<seq2seq4repair_space>" ) + tree ) + "<seq2seq4repair_space>=<seq2seq4repair_space>" ) + ( tree . evalOutString ( ) ) ) + "<seq2seq4repair_space>=<seq2seq4repair_space>" ) + ( tree . eval ( ) ) ) ) ; str = "3+(2)+1" ; tree . parse ( str ) ; System . out . println ( ( ( ( ( ( ( ( "\"" + str ) + "\"<seq2seq4repair_space>=<seq2seq4repair_space>" ) + tree ) + "<seq2seq4repair_space>=<seq2seq4repair_space>" ) + ( tree . evalOutString ( ) ) ) + "<seq2seq4repair_space>=<seq2seq4repair_space>" ) + ( tree . eval ( ) ) ) ) ; str = "sin(32+58)+7" ; tree . parse ( str ) ; System . out . println ( ( ( ( ( ( ( ( "\"" + str ) + "\"<seq2seq4repair_space>=<seq2seq4repair_space>" ) + tree ) + "<seq2seq4repair_space>=<seq2seq4repair_space>" ) + ( tree . evalOutString ( ) ) ) + "<seq2seq4repair_space>=<seq2seq4repair_space>" ) + ( tree . eval ( ) ) ) ) ; str = "4+(3)+(1)+2" ; tree . parse ( str ) ; System . out . println ( ( ( ( ( ( ( ( "\"" + str ) + "\"<seq2seq4repair_space>=<seq2seq4repair_space>" ) + tree ) + "<seq2seq4repair_space>=<seq2seq4repair_space>" ) + ( tree . evalOutString ( ) ) ) + "<seq2seq4repair_space>=<seq2seq4repair_space>" ) + ( tree . eval ( ) ) ) ) ; str = "(((2+2)))" ; tree . parse ( str ) ; System . out . println ( ( ( ( ( ( ( ( "\"" + str ) + "\"<seq2seq4repair_space>=<seq2seq4repair_space>" ) + tree ) + "<seq2seq4repair_space>=<seq2seq4repair_space>" ) + ( tree . evalOutString ( ) ) ) + "<seq2seq4repair_space>=<seq2seq4repair_space>" ) + ( tree . eval ( ) ) ) ) ; str = "(((2)))" ; tree . parse ( str ) ; System . out . println ( ( ( ( ( ( ( ( "\"" + str ) + "\"<seq2seq4repair_space>=<seq2seq4repair_space>" ) + tree ) + "<seq2seq4repair_space>=<seq2seq4repair_space>" ) + ( tree . evalOutString ( ) ) ) + "<seq2seq4repair_space>=<seq2seq4repair_space>" ) + ( tree . eval ( ) ) ) ) ; str = "(2)+1" ; tree . parse ( str ) ; System . out . println ( ( ( ( ( ( ( ( "\"" + str ) + "\"<seq2seq4repair_space>=<seq2seq4repair_space>" ) + tree ) + "<seq2seq4repair_space>=<seq2seq4repair_space>" ) + ( tree . evalOutString ( ) ) ) + "<seq2seq4repair_space>=<seq2seq4repair_space>" ) + ( tree . eval ( ) ) ) ) ; str = "1+(2)" ; tree . parse ( str ) ; System . out . println ( ( ( ( ( ( ( ( "\"" + str ) + "\"<seq2seq4repair_space>=<seq2seq4repair_space>" ) + tree ) + "<seq2seq4repair_space>=<seq2seq4repair_space>" ) + ( tree . evalOutString ( ) ) ) + "<seq2seq4repair_space>=<seq2seq4repair_space>" ) + ( tree . eval ( ) ) ) ) ; str = "2+X+3" ; tree . parse ( str ) ; System . out . println ( ( ( ( ( ( ( ( "\"" + str ) + "\"<seq2seq4repair_space>=<seq2seq4repair_space>" ) + tree ) + "<seq2seq4repair_space>=<seq2seq4repair_space>" ) + ( tree . evalOutString ( ) ) ) + "<seq2seq4repair_space>=<seq2seq4repair_space>" ) + ( tree . eval ( 3 ) ) ) ) ; str = "12+13" ; <START_BUG> tree . parse ( str , "" , 8 ) ; <END_BUG> System . out . println ( ( ( ( ( ( ( ( "\"" + str ) + "\"<seq2seq4repair_space>=<seq2seq4repair_space>" ) + tree ) + "<seq2seq4repair_space>=<seq2seq4repair_space>" ) + ( tree . evalOutString ( ) ) ) + "<seq2seq4repair_space>=<seq2seq4repair_space>" ) + ( tree . eval ( 3 ) ) ) ) ; } }

Fix:
tree . parse ( str , 8 ) ;