ExpressionParser { static Parser<UnaryOperator<Expression>> subscript(Parser<Expression> expr) { return expr.between(term("["), term("]")).map(i -> a -> new ArraySubscriptExpression(a, i)); }  static Parser<Expression> expression(
      Parser<DefBody> classBody, Parser<Statement> statement); static Parser<Expression> arrayInitializer(Parser<Expression> expr);  }
@Test public void testSubscript() { TerminalParserTest.assertToString(ArraySubscriptExpression.class, "1[foo]", parse(ExpressionParser.subscript(ExpressionParser.IDENTIFIER), "[foo]").apply(literal(1))); }