diff options
author | Sven Gothel <[email protected]> | 2015-03-07 09:39:26 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2015-03-07 09:39:26 +0100 |
commit | e2d5d6f55794c5e27c3a29dcbbdaf2921506667d (patch) | |
tree | e6a63ee06f68875a34ea2e8f8f308b1c5a1dd585 /src/java | |
parent | d75bd393a5850252d7d7012e68af3850178ca8c9 (diff) |
Fix Type.getDebugString() comma separation
Diffstat (limited to 'src/java')
-rw-r--r-- | src/java/com/jogamp/gluegen/cgram/types/Type.java | 112 |
1 files changed, 59 insertions, 53 deletions
diff --git a/src/java/com/jogamp/gluegen/cgram/types/Type.java b/src/java/com/jogamp/gluegen/cgram/types/Type.java index ee1aff1..bc1b155 100644 --- a/src/java/com/jogamp/gluegen/cgram/types/Type.java +++ b/src/java/com/jogamp/gluegen/cgram/types/Type.java @@ -134,11 +134,12 @@ public abstract class Type implements Cloneable, SemanticEqualityOp, ASTLocusTag } - private void append(final StringBuilder sb, final String val, final boolean prepComma) { + private StringBuilder append(final StringBuilder sb, final String val, final boolean prepComma) { if( prepComma ) { sb.append(", "); } sb.append(val); + return sb; } // For debugging public String getDebugString() { @@ -186,59 +187,64 @@ public abstract class Type implements Cloneable, SemanticEqualityOp, ASTLocusTag sb.append(" ZERO"); } append(sb, "[", prepComma); prepComma=false; - append(sb, "const[", prepComma); prepComma=false; - if( isConstTypedef() ) { - append(sb, "type ", prepComma); prepComma=true; - } - if( isConstRaw() ) { - append(sb, "inst -> ", prepComma); prepComma=false; - } - if( isConst() ) { - append(sb, "true]", prepComma); prepComma=true; - } else { - append(sb, "false]", prepComma); prepComma=true; - } - if( isVolatile() ) { - append(sb, "volatile ", prepComma); prepComma=true; - } - if( isPointer() ) { - append(sb, "pointer*"+pointerDepth(), prepComma); prepComma=true; - } - if( isArray() ) { - append(sb, "array*"+arrayDimension(), prepComma); prepComma=true; - } - if( isBit() ) { - append(sb, "bit", prepComma); prepComma=true; - } - if( isCompound() ) { - sb.append("struct{").append(asCompound().getStructName()).append(": ").append(asCompound().getNumFields()); - append(sb, "}", prepComma); prepComma=true; - } - if( isDouble() ) { - append(sb, "double", prepComma); prepComma=true; - } - if( isEnum() ) { - final EnumType eT = asEnum(); - sb.append("enum ").append(" [").append(eT.getUnderlyingType()).append("] {").append(eT.getNumEnumerates()).append(": "); - eT.appendEnums(sb, false); - prepComma=true; - } - if( isFloat() ) { - append(sb, "float", prepComma); prepComma=true; - } - if( isFunction() ) { - append(sb, "function", prepComma); prepComma=true; - } - if( isFunctionPointer() ) { - append(sb, "funcPointer", prepComma); prepComma=true; - } - if( isInt() ) { - append(sb, "int", prepComma); prepComma=true; - } - if( isVoid() ) { - append(sb, "void", prepComma); prepComma=true; + { + append(sb, "const[", prepComma); prepComma=false; + { + if( isConstTypedef() ) { + append(sb, "type ", prepComma); prepComma=true; + } + if( isConstRaw() ) { + append(sb, "inst -> ", prepComma); prepComma=false; + } + if( isConst() ) { + append(sb, "true]", prepComma); + } else { + append(sb, "false]", prepComma); + } + prepComma=true; + } + if( isVolatile() ) { + append(sb, "volatile ", prepComma); prepComma=true; + } + if( isPointer() ) { + append(sb, "pointer*"+pointerDepth(), prepComma); prepComma=true; + } + if( isArray() ) { + append(sb, "array*"+arrayDimension(), prepComma); prepComma=true; + } + if( isBit() ) { + append(sb, "bit", prepComma); prepComma=true; + } + if( isCompound() ) { + append(sb, "struct{", prepComma).append(asCompound().getStructName()).append(": ").append(asCompound().getNumFields()); + append(sb, "}", prepComma); prepComma=true; + } + if( isDouble() ) { + append(sb, "double", prepComma); prepComma=true; + } + if( isEnum() ) { + final EnumType eT = asEnum(); + append(sb, "enum ", prepComma).append(" [").append(eT.getUnderlyingType()).append("] {").append(eT.getNumEnumerates()).append(": "); + eT.appendEnums(sb, false); + prepComma=true; + } + if( isFloat() ) { + append(sb, "float", prepComma); prepComma=true; + } + if( isFunction() ) { + append(sb, "function", prepComma); prepComma=true; + } + if( isFunctionPointer() ) { + append(sb, "funcPointer", prepComma); prepComma=true; + } + if( isInt() ) { + append(sb, "int", prepComma); prepComma=true; + } + if( isVoid() ) { + append(sb, "void", prepComma); prepComma=true; + } + sb.append("]"); } - sb.append("]"); if( withASTLoc ) { sb.append(", loc ").append(astLocus); } |