Skip to content
Snippets Groups Projects
Commit f512e2a4 authored by Mick Jordan's avatar Mick Jordan
Browse files

cope with incorrect number of args deparsing infix operators

parent 6ace9245
No related branches found
No related tags found
No related merge requests found
......@@ -142,14 +142,26 @@ public class RASTDeparse {
break;
case DOLLAR:
argValues[0].deparseImpl(state);
/*
* Experimentally one cannot assume that the call is well formed, i.e arguments may
* be missing.
*/
if (argValues.length > 0) {
argValues[0].deparseImpl(state);
} else {
state.append("NULL");
}
state.append(func.op);
String fieldName = ConstantNode.getString(argValues[1]);
if (fieldName != null) {
state.append(fieldName);
if (argValues.length > 1) {
String fieldName = ConstantNode.getString(argValues[1]);
if (fieldName != null) {
state.append(fieldName);
} else {
// FIXME: this needs to be handled in RCallNode, not here
argValues[1].deparseImpl(state);
}
} else {
// FIXME: this needs to be handled in RCallNode, not here
argValues[1].deparseImpl(state);
state.append("NULL");
}
break;
default:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment