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

Scanner with SkipComments = false doesn't work #1004

Open
bryanbcook opened this issue Oct 29, 2024 · 0 comments
Open

Scanner with SkipComments = false doesn't work #1004

bryanbcook opened this issue Oct 29, 2024 · 0 comments

Comments

@bryanbcook
Copy link

bryanbcook commented Oct 29, 2024

Describe the bug
Looks like a possible regression of #260

To Reproduce

var content = @"
        key1: value1
        key2: value2
        key3:
          key4: value4
          key5: value5
        key6:
          - item1
          - item2
          - item3

        # comment
        key7:
          - key8: value8
            key9: value9
            key10: value10
          - key11: key11
            key12:
              key13: value13
              key14: value14";

var yamlStream = new YamlStream();
var textReader = new StringReader(content);
var scanner = new Scanner(textReader, skipComments: false);
var parser = new Parser(scanner);
yamlStream.Load(parser);

throws an ArgumentException. Stack trace points to here

Please suggest a workaround if I'm going about this the wrong way.

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

No branches or pull requests

3 participants
@bryanbcook and others