Skip to content

Commit

Permalink
toString() shouldn't disturb repeating groups #890 (#892)
Browse files Browse the repository at this point in the history
* toString() shouldn't disturb repeating groups #890

* Remove trailing whitespace

* Ugh, removed more whitespace
  • Loading branch information
spoerri committed Mar 7, 2022
1 parent 595d73c commit 9b8c5db
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3475,6 +3475,9 @@ private void appendDecoderDisplay(
final String groupName = formatPropertyName(groupToken.name());
final String groupDecoderName = decoderName(groupToken.name());

append(sb, indent, "int " + groupName + "OriginalOffset = " + groupName + ".offset;");
append(sb, indent, "int " + groupName + "OriginalIndex = " + groupName + ".index;");

append(
sb, indent, "builder.append(\"" + groupName + Separator.KEY_VALUE + Separator.BEGIN_GROUP + "\");");
append(sb, indent, groupDecoderName + " " + groupName + " = " + groupName + "();");
Expand All @@ -3489,6 +3492,9 @@ private void appendDecoderDisplay(
append(sb, indent, "}");
Separator.END_GROUP.appendToGeneratedBuilder(sb, indent);

append(sb, indent, groupName + ".offset = " + groupName + "OriginalOffset;");
append(sb, indent, groupName + ".index = " + groupName + "OriginalIndex;");

lengthBeforeLastGeneratedSeparator = sb.length();
Separator.FIELD.appendToGeneratedBuilder(sb, indent);

Expand Down

0 comments on commit 9b8c5db

Please sign in to comment.