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

[YAMLParser] Improve plain scalar spec compliance #68946

Conversation

akirchhoff-modular
Copy link
Contributor

The YAMLParser.h header file claims support for YAML 1.2 with a few deviations, but our plain scalar parsing failed to parse some valid YAML according to the spec. This change puts us more in compliance with the YAML spec, now letting us parse plain scalars containing additional special characters in cases where they are not ambiguous.

The `YAMLParser.h` header file claims support for YAML 1.2 with a few
deviations, but our plain scalar parsing failed to parse some valid YAML
according to the spec.  This change puts us more in compliance with the
YAML spec, now letting us parse plain scalars containing additional
special characters in cases where they are not ambiguous.
@akirchhoff-modular akirchhoff-modular force-pushed the akirchhoff/yaml-parser-plain-scalar-fixes branch from 4b8c1aa to d99c12b Compare October 13, 2023 02:04
@walter-erquinigo
Copy link
Member

This LGTM, but I'll let others more familiar with the code to accept it.

@JoeLoser
Copy link
Member

@slinder1 @arsenm Gentle ping here. We'd like to land this so we can make use of it downstream - thanks!

Copy link
Contributor

@slinder1 slinder1 left a comment

Choose a reason for hiding this comment

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

Thank you for the patch!

I am sorry for the delay in review, I was out most of last week.

The change looks good overall, but there are a couple test changes/additions I'd like, and I am a bit confused around some of the more subtle conditions and hoped you could just help me understand.

llvm/lib/Support/YAMLParser.cpp Show resolved Hide resolved
llvm/lib/Support/YAMLParser.cpp Show resolved Hide resolved
llvm/lib/Support/YAMLParser.cpp Outdated Show resolved Hide resolved
llvm/test/YAMLParser/plain-characters.test Outdated Show resolved Hide resolved
llvm/unittests/Support/YAMLIOTest.cpp Show resolved Hide resolved
Copy link
Contributor Author

@akirchhoff-modular akirchhoff-modular left a comment

Choose a reason for hiding this comment

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

Thanks @slinder1 for your detailed feedback. I have made some changes in response to your feedback, and also provided responses to your questions below. Please take another look when you can. Thanks!

llvm/lib/Support/YAMLParser.cpp Show resolved Hide resolved
llvm/lib/Support/YAMLParser.cpp Show resolved Hide resolved
llvm/lib/Support/YAMLParser.cpp Outdated Show resolved Hide resolved
llvm/test/YAMLParser/plain-characters.test Outdated Show resolved Hide resolved
llvm/unittests/Support/YAMLIOTest.cpp Show resolved Hide resolved
Copy link
Contributor

@slinder1 slinder1 left a comment

Choose a reason for hiding this comment

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

LGTM, thank you for the more detailed explanation where I was confused, and for the additional tests!

@JoeLoser
Copy link
Member

@akirchhoff-modular as discussed offline, I'll merge this on your behalf. Thanks for the thorough review, @slinder1!

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

Successfully merging this pull request may close these issues.

5 participants