Skip to content

Commit

Permalink
Treat trailing-delimiter as true by default
Browse files Browse the repository at this point in the history
  • Loading branch information
Cirras committed Jan 18, 2025
1 parent 901b559 commit dba5d7a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- Incorrect (de)serialization of some data structures containing arrays with trailing delimiters.

## [1.0.0-RC1] - 2024-10-20

### Added
Expand Down
6 changes: 1 addition & 5 deletions protocol-code-generator/Generator.ObjectCodeGenerator.pas
Original file line number Diff line number Diff line change
Expand Up @@ -473,10 +473,6 @@ procedure TFieldCodeGenerator.ValidateArrayField;
else if FDelimited then begin
raise ECodeGenerationError.Create('Only arrays can be delimited.');
end;

if not FDelimited and FTrailingDelimiter then begin
raise ECodeGenerationError.Create('Only delimited arrays can have a trailing delimiter.');
end;
end;

procedure TFieldCodeGenerator.ValidateLengthField;
Expand Down Expand Up @@ -1801,7 +1797,7 @@ procedure TObjectCodeGenerator.GenerateArray(Instruction: TDOMElement);
.Comment(GetComment(Instruction))
.ArrayField(True)
.Delimited(Delimited)
.TrailingDelimiter(GetBooleanAttribute(Instruction, 'trailing-delimiter'))
.TrailingDelimiter(GetBooleanAttribute(Instruction, 'trailing-delimiter', True))
.Build;

try
Expand Down

0 comments on commit dba5d7a

Please sign in to comment.