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

Fix closing flow sequence after explicit key #296

Merged
merged 1 commit into from
May 20, 2024

Conversation

perlpunk
Copy link
Member

@perlpunk perlpunk commented May 20, 2024

The fix in #295 was not correct.

# cat a.yaml
---
[?]

# Before
% ./tests/run-parser-test-suite --flow keep < a.yaml
+STR
+DOC ---
+SEQ []
+MAP {}
-SEQ
-DOC
-STR

% ./tests/run-loader a.yaml
[1] Loading 'a.yaml': run-loader: loader.c:470: yaml_parser_load_sequence_end: Assertion `parser->document->nodes.start[index-1].type == YAML_SEQUENCE_NODE' failed.
[1]    21446 IOT instruction (core dumped)  ./tests/run-loader a.yaml

# After
% ./tests/run-parser-test-suite --flow keep < a.yaml
+STR
+DOC ---
+SEQ []
+MAP {}
=VAL :
=VAL :
-MAP
-SEQ
-DOC
-STR

% ./tests/run-loader a.yaml
[1] Loading 'a.yaml': SUCCESS (1 documents)

The fix in yaml#295 was not correct.

    # cat a.yaml
    ---
    [?]

    # Before
    % ./tests/run-parser-test-suite --flow keep < a.yaml
    +STR
    +DOC ---
    +SEQ []
    +MAP {}
    -SEQ
    -DOC
    -STR

    % ./tests/run-loader a.yaml
    [1] Loading 'a.yaml': run-loader: loader.c:470: yaml_parser_load_sequence_end: Assertion `parser->document->nodes.start[index-1].type == YAML_SEQUENCE_NODE' failed.
    [1]    21446 IOT instruction (core dumped)  ./tests/run-loader a.yaml

    # After
    % ./tests/run-parser-test-suite --flow keep < a.yaml
    +STR
    +DOC ---
    +SEQ []
    +MAP {}
    =VAL :
    =VAL :
    -MAP
    -SEQ
    -DOC
    -STR

    % ./tests/run-loader a.yaml
    [1] Loading 'a.yaml': SUCCESS (1 documents)
@perlpunk perlpunk merged commit 840b65c into yaml:master May 20, 2024
4 checks passed
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.

2 participants