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

Made null handling YAML 1.2 compliant #357

Merged
merged 1 commit into from
Apr 1, 2016
Merged

Conversation

TripleWhy
Copy link
Contributor

See http://www.yaml.org/spec/1.2/spec.html#id2805071
Also fixes Bugs #289 and #230 (I think).

@@ -157,7 +157,7 @@ bool IsValidPlainScalar(const std::string& str, FlowType::value flowType,
}

// check against null
if (str == "null") {
if (str == "~" || str == "null" || str == "Null" || str == "NULL") {
Copy link
Owner

Choose a reason for hiding this comment

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

Can you extract these two places into a separate function? Perhaps put it in null.h / null.cpp.

@TripleWhy
Copy link
Contributor Author

As you wish.

@@ -2,4 +2,8 @@

namespace YAML {
_Null Null;

bool IsNullString(const std::string& str) {
return (str.empty() || str == "~" || str == "null" || str == "Null" || str == "NULL");
Copy link
Owner

Choose a reason for hiding this comment

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

You don't need the extra parens around the return value.

@jbeder
Copy link
Owner

jbeder commented Mar 26, 2016

Sorry for the delay. Please squash and rebase against HEAD.

@TripleWhy
Copy link
Contributor Author

Done

@jbeder jbeder merged commit 52bcefa into jbeder:master Apr 1, 2016
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.

None yet

2 participants