code: private ParseTree parseFunctionDeclaration() {
      SourcePosition start = getTreeStartLocation();
      eat(Keywords.FUNCTION.type);
      boolean isGenerator = eatOpt(TokenType.STAR) != null;
  
      FunctionDeclarationTree.Builder builder =
          FunctionDeclarationTree.builder(FunctionDeclarationTree.Kind.DECLARATION).setName(eatId());
      parseFunctionTail(builder, isGenerator ? FunctionFlavor.GENERATOR : FunctionFlavor.NORMAL);
      return builder.build(getTreeLocation(start));
    }
docs: 13 Function Definition