public FormalParametersListTreeImpl prependNewFormalParameter(VariableTreeImpl variable, Optional<Tuple<InternalSyntaxToken, FormalParametersListTreeImpl>> rest) { if (rest.isPresent()) { InternalSyntaxToken comma = rest.get().first(); FormalParametersListTreeImpl partial = rest.get().second(); partial.add(0, variable); // store the comma as endToken for the variable variable.setEndToken(comma); return partial; } else { return new FormalParametersListTreeImpl(variable); } }
public FormalParametersListTreeImpl prependNewFormalParameter(VariableTreeImpl variable, Optional<AstNode> rest) { if (rest.isPresent()) { AstNode comma = rest.get().getFirstChild(JavaPunctuator.COMMA); FormalParametersListTreeImpl partial = (FormalParametersListTreeImpl) rest.get().getLastChild(); partial.add(0, variable); partial.prependChildren(variable, comma); return partial; } else { return new FormalParametersListTreeImpl(variable); } }
public FormalParametersListTreeImpl prependNewFormalParameter(VariableTreeImpl variable, Optional<Tuple<InternalSyntaxToken, FormalParametersListTreeImpl>> rest) { if (rest.isPresent()) { InternalSyntaxToken comma = rest.get().first(); FormalParametersListTreeImpl partial = rest.get().second(); partial.add(0, variable); // store the comma as endToken for the variable variable.setEndToken(comma); return partial; } else { return new FormalParametersListTreeImpl(variable); } }
public FormalParametersListTreeImpl prependNewFormalParameter(VariableTreeImpl variable, Optional<Tuple<InternalSyntaxToken, FormalParametersListTreeImpl>> rest) { if (rest.isPresent()) { InternalSyntaxToken comma = rest.get().first(); FormalParametersListTreeImpl partial = rest.get().second(); partial.add(0, variable); // store the comma as endToken for the variable variable.setEndToken(comma); return partial; } else { return new FormalParametersListTreeImpl(variable); } }