@Test public void testCleanUpSignatureTextWithFunkyParamDatatype() { FunctionSignature f = fun("int", "Bob", "(aaa)", "a"); String result = parser.cleanUpSignatureText("int Bob((aaa) a)", f); assertEquals("int Bob(__REPLACE_DT_NAME__0 a)", result); }
String cleanUpSignatureText(String text, FunctionSignature signature) { DataType returnType = signature.getReturnType(); text = replaceDataTypeIfNeeded(text, returnType, REPLACEMENT_DT_NAME); text = replaceNameIfNeeded(text, signature.getName(), REPLACE_NAME); ParameterDefinition[] arguments = signature.getArguments(); for (ParameterDefinition argument : arguments) { text = replaceDataTypeIfNeeded(text, argument.getDataType(), REPLACEMENT_DT_NAME + argument.getOrdinal()); text = replaceNameIfNeeded(text, argument.getName(), REPLACE_NAME + argument.getOrdinal()); } return text; }
FunctionSignatureParser { String cleanUpSignatureText(String text, FunctionSignature signature) { DataType returnType = signature.getReturnType(); text = replaceDataTypeIfNeeded(text, returnType, REPLACEMENT_DT_NAME); text = replaceNameIfNeeded(text, signature.getName(), REPLACE_NAME); ParameterDefinition[] arguments = signature.getArguments(); for (ParameterDefinition argument : arguments) { text = replaceDataTypeIfNeeded(text, argument.getDataType(), REPLACEMENT_DT_NAME + argument.getOrdinal()); text = replaceNameIfNeeded(text, argument.getName(), REPLACE_NAME + argument.getOrdinal()); } return text; } }
FunctionSignatureParser { String cleanUpSignatureText(String text, FunctionSignature signature) { DataType returnType = signature.getReturnType(); text = replaceDataTypeIfNeeded(text, returnType, REPLACEMENT_DT_NAME); text = replaceNameIfNeeded(text, signature.getName(), REPLACE_NAME); ParameterDefinition[] arguments = signature.getArguments(); for (ParameterDefinition argument : arguments) { text = replaceDataTypeIfNeeded(text, argument.getDataType(), REPLACEMENT_DT_NAME + argument.getOrdinal()); text = replaceNameIfNeeded(text, argument.getName(), REPLACE_NAME + argument.getOrdinal()); } return text; } FunctionSignatureParser(Program program, DataTypeManagerService service); }
FunctionSignatureParser { String cleanUpSignatureText(String text, FunctionSignature signature) { DataType returnType = signature.getReturnType(); text = replaceDataTypeIfNeeded(text, returnType, REPLACEMENT_DT_NAME); text = replaceNameIfNeeded(text, signature.getName(), REPLACE_NAME); ParameterDefinition[] arguments = signature.getArguments(); for (ParameterDefinition argument : arguments) { text = replaceDataTypeIfNeeded(text, argument.getDataType(), REPLACEMENT_DT_NAME + argument.getOrdinal()); text = replaceNameIfNeeded(text, argument.getName(), REPLACE_NAME + argument.getOrdinal()); } return text; } FunctionSignatureParser(Program program, DataTypeManagerService service); FunctionDefinitionDataType parse(FunctionSignature originalSignature,
			String signatureText); }
FunctionSignatureParser { String cleanUpSignatureText(String text, FunctionSignature signature) { DataType returnType = signature.getReturnType(); text = replaceDataTypeIfNeeded(text, returnType, REPLACEMENT_DT_NAME); text = replaceNameIfNeeded(text, signature.getName(), REPLACE_NAME); ParameterDefinition[] arguments = signature.getArguments(); for (ParameterDefinition argument : arguments) { text = replaceDataTypeIfNeeded(text, argument.getDataType(), REPLACEMENT_DT_NAME + argument.getOrdinal()); text = replaceNameIfNeeded(text, argument.getName(), REPLACE_NAME + argument.getOrdinal()); } return text; } FunctionSignatureParser(Program program, DataTypeManagerService service); FunctionDefinitionDataType parse(FunctionSignature originalSignature,
			String signatureText);  }