[ClavaAst] Improves code generation for ArrayType
@@ -110,7 +110,11 @@ public abstract class ArrayType extends Type {
return elementType.getCode(sourceNode, nameCode + "[" + arrayContentCode + "]");
}
- return getElementType().getCode(sourceNode) + " " + nameCode + "[" + arrayContentCode + "]";
+ if (!nameCode.isEmpty()) {
+ nameCode = " " + nameCode;
+ }
+
+ return getElementType().getCode(sourceNode) + nameCode + "[" + arrayContentCode + "]";
}
@Override
