Repository: apple/pkl
File: pkl-parser/src/main/java/org/pkl/parser/GenericParser.java (Java)

Code before:
      case AS -> Operator.AS;
      case EQUAL -> Operator.EQ_EQ;
      case NOT_EQUAL -> Operator.NOT_EQ;
      case AND -> Operator.AND;
      case OR -> Operator.OR;
      case PIPE -> Operator.PIPE;
      case COALESCE -> Operator.NULL_COALESCE;
      case DOT -> Operator.DOT;
      case QDOT -> Operator.QDOT;
      case LBRACK -> Operator.SUBSCRIPT;
      case NON_NULL -> Operator.NON_NULL;
      default -> null;
    };
  }

  private Node parseExprAtom(@Nullable String expectation) {
    var expr =
        switch (lookahead) {
          case THIS -> new Node(NodeType.THIS_EXPR, next().span);
          case OUTER -> new Node(NodeType.OUTER_EXPR, next().span);
          case MODULE -> new Node(NodeType.MODULE_EXPR, next().span);
          case NULL -> new Node(NodeType.NULL_EXPR, next().span);
          case THROW -> {
            var children = new ArrayList<Node>();
            children.add(makeTerminal(next()));
            ff(children);
            expect(Token.LPAREN, children, "unexpectedToken", "(");
            ff(children);
            children.add(parseExpr(")"));
            ff(children);
            expect(Token.RPAREN, children, "unexpectedToken", ")");
            yield new Node(NodeType.THROW_EXPR, children);
          }
          case TRACE -> {
            var children = new ArrayList<Node>();
            children.add(makeTerminal(next()));
            ff(children);
            expect(Token.LPAREN, children, "unexpectedToken", "(");
            ff(children);
            children.add(parseExpr(")"));
            ff(children);
            expect(Token.RPAREN, children, "unexpectedToken", ")");
            yield new Node(NodeType.TRACE_EXPR, children);
          }
          case IMPORT, IMPORT_STAR -> {
            var children = new ArrayList<Node>();
            children.add(makeTerminal(next()));
            ff(children);
            expect(Token.LPAREN, children, "unexpectedToken", "(");
            ff(children);
            children.add(parseStringConstant());

Review comment (bug):
```suggestion
    children.add(parseIdentifier());
    if (lookahead() == Token.LPAREN && noSemicolonInbetween() && _lookahead.newLinesBetween == 0) {
      ff(children);
      children.add(parseArgumentList());
    }
```
Just found another bug looking at this code: we are not fast forwarding after parsing the identifier so code like `foo.bar/*asd*/()` is not parsing, even though it works fine for the normal parser.

Code after:
      case GTE -> Operator.GTE;
      case LT -> Operator.LT;
      case LTE -> Operator.LTE;
      case IS -> Operator.IS;
      case AS -> Operator.AS;
      case EQUAL -> Operator.EQ_EQ;
      case NOT_EQUAL -> Operator.NOT_EQ;
      case AND -> Operator.AND;
      case OR -> Operator.OR;
      case PIPE -> Operator.PIPE;
      case COALESCE -> Operator.NULL_COALESCE;
      case DOT -> Operator.DOT;
      case QDOT -> Operator.QDOT;
      case LBRACK -> Operator.SUBSCRIPT;
      case NON_NULL -> Operator.NON_NULL;
      default -> null;
    };
  }

  private Node parseUnqualifiedAccessExpr() {
    var children = new ArrayList<Node>();
    children.add(parseIdentifier());
    if (lookahead() == Token.LPAREN && noSemicolonInbetween() && _lookahead.newLinesBetween == 0) {
      ff(children);
      children.add(parseArgumentList());
    }
    return new Node(NodeType.UNQUALIFIED_ACCESS_EXPR, children);
  }

  private Node parseExprAtom(@Nullable String expectation) {
    var expr =
        switch (lookahead) {
          case THIS -> new Node(NodeType.THIS_EXPR, next().span);
          case OUTER -> new Node(NodeType.OUTER_EXPR, next().span);
          case MODULE -> new Node(NodeType.MODULE_EXPR, next().span);
          case NULL -> new Node(NodeType.NULL_EXPR, next().span);
          case THROW -> {
            var children = new ArrayList<Node>();
            children.add(makeTerminal(next()));
            ff(children);
            expect(Token.LPAREN, children, "unexpectedToken", "(");
            ff(children);
            children.add(parseExpr(")"));
            ff(children);
            expect(Token.RPAREN, children, "unexpectedToken", ")");
            yield new Node(NodeType.THROW_EXPR, children);
          }
          case TRACE -> {
            var children = new ArrayList<Node>();
            children.add(makeTerminal(next()));
            ff(children);