paramReparseCheck(nodeSource, false);
}
public static void paramReparseCheck(String nodeSource, boolean reparseAsFunctionParam) {
DeeParser unambigParser = new DeeParser(nodeSource);
IASTNode unambigParsedParameter = reparseAsFunctionParam ?
unambigParser.parseFunctionParameter() : unambigParser.parseTemplateParameter();
Object ambigParsedParameterResult = parseAmbigParameter(nodeSource);
ASTNode nodeToCompareAgainst = null;
if(ambigParsedParameterResult instanceof IFunctionParameter) {
nodeToCompareAgainst = reparseAsFunctionParam ? (ASTNode) ambigParsedParameterResult : null;
} else if(ambigParsedParameterResult instanceof TemplateParameter) {
nodeToCompareAgainst = !reparseAsFunctionParam ? (ASTNode) ambigParsedParameterResult : null;
} else {
AmbiguousParameter ambigParsedParameter = (AmbiguousParameter) ambigParsedParameterResult;
nodeToCompareAgainst = reparseAsFunctionParam ?
ambigParsedParameter.convertToFunction().asNode() : ambigParsedParameter.convertToTemplate();
}
if(nodeToCompareAgainst != null) {
assertTrue(unambigParser.lookAhead() == DeeTokens.EOF);
DeeParsingChecks.checkNodeEquality(unambigParsedParameter.asNode(), nodeToCompareAgainst);
} else {
assertTrue(unambigParser.lookAhead() != DeeTokens.EOF ||
collectNodeErrors(unambigParsedParameter.asNode()).size() > 0);
}
}