Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emitter: Don't output trailing space for empty scalar nodes #186

Merged
merged 1 commit into from
Jun 1, 2020

Conversation

perlpunk
Copy link
Member

See issue #46

Passing emitter tests:

  • 2XXW: Spec Example 2.25. Unordered Sets
  • 5WE3: Spec Example 8.17. Explicit Block Mapping Entries
  • 6KGN: Anchor for empty node
  • 6XDY: Two document start markers
  • 7W2P: Block Mapping with Missing Values
  • 8KB6: Multiline plain flow mapping key without value
  • 9BXH: Multiline doublequoted flow mapping key without value
  • C2DT: Spec Example 7.18. Flow Mapping Adjacent Values
  • JTV5: Block Mapping with Multiline Scalars
  • KK5P: Various combinations of explicit block mappings
  • LE5A: Spec Example 7.24. Flow Nodes
  • UT92: Spec Example 9.4. Explicit Documents
  • W42U: Spec Example 8.15. Block Sequence Entry Types
  • W4TN: Spec Example 9.5. Directives Documents
  • ZWK4: Key with anchor after missing explicit mapping value

@perlpunk perlpunk force-pushed the trailing-spaces branch 2 times, most recently from b42710d to 31958e8 Compare May 31, 2020 13:18
@perlpunk perlpunk marked this pull request as ready for review May 31, 2020 13:19
@perlpunk perlpunk changed the title Don't output trailing space for empty scalar nodes Emitter: Don't output trailing space for empty scalar nodes May 31, 2020
@perlpunk perlpunk requested a review from ingydotnet May 31, 2020 13:49
Copy link
Member

@ingydotnet ingydotnet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Just one small comment.

src/emitter.c Outdated Show resolved Hide resolved
src/emitter.c Outdated Show resolved Hide resolved
See issue yaml#46

Passing emitter tests:
* 2XXW: Spec Example 2.25. Unordered Sets
* 5WE3: Spec Example 8.17. Explicit Block Mapping Entries
* 6KGN: Anchor for empty node
* 6XDY: Two document start markers
* 7W2P: Block Mapping with Missing Values
* 8KB6: Multiline plain flow mapping key without value
* 9BXH: Multiline doublequoted flow mapping key without value
* C2DT: Spec Example 7.18. Flow Mapping Adjacent Values
* JTV5: Block Mapping with Multiline Scalars
* KK5P: Various combinations of explicit block mappings
* LE5A: Spec Example 7.24. Flow Nodes
* UT92: Spec Example 9.4. Explicit Documents
* W42U: Spec Example 8.15. Block Sequence Entry Types
* W4TN: Spec Example 9.5. Directives Documents
* ZWK4: Key with anchor after missing explicit mapping value
@perlpunk perlpunk changed the base branch from master to release/0.2.5 June 1, 2020 14:41
@perlpunk perlpunk merged commit 7eb0197 into yaml:release/0.2.5 Jun 1, 2020
@perlpunk perlpunk deleted the trailing-spaces branch June 1, 2020 21:46
tlsa added a commit to tlsa/libcyaml that referenced this pull request Jun 27, 2020
Libyaml does not emit trailing whitespace now.  Since we want
to work with older versions of libyaml too, we check against
reference output with and without trailing whitespace.

See: yaml/libyaml#186
Copy link

@ShadowsatNight ShadowsatNight left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

src/emitter.c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants