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

Support single quoted keys correctly (#61) #201

Closed
wants to merge 1 commit into from

Conversation

kzys
Copy link
Contributor

@kzys kzys commented Oct 27, 2017

The previous commit (a410399) doesn't work correctly because that
must be handled by lexers. parseKey() must not handle escape sequences.

The previous commit (a410399) doesn't work correctly because that
must be handled by lexers. parseKey() must not handle escape sequences.
Copy link
Owner

@pelletier pelletier left a comment

Choose a reason for hiding this comment

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

Sorry I completely let that one fall through the cracks. Added a couple comments, but overall looks good.

l.next()
continue
} else if r == '\n' {
return l.errorf("keys cannot contain new lines")
} else if isSpace(r) {
} else if isSpace(r) || r == ']' {
Copy link
Owner

Choose a reason for hiding this comment

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

why is || r == ']' needed?

@@ -71,18 +71,14 @@ func (t *Tree) Keys() []string {
}

// Get the value at key in the Tree.
// Key is a dot-separated path (e.g. a.b.c).
// Key is a dot-separated path (e.g. a.b.c) without single/double quoted strings
Copy link
Owner

Choose a reason for hiding this comment

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

Missing . at the end of the sentence. Also, do you mind adding a comment about using GetPath if the support for non-bare keys is required?

pelletier pushed a commit that referenced this pull request Jan 18, 2018
Patch #193 doesn't work correctly because that must be handled by the
lexer, and `parseKey()` must not handle escape sequences.

Ref #61
@pelletier
Copy link
Owner

merged with 4874e84

@pelletier pelletier closed this Jan 18, 2018
@kzys
Copy link
Contributor Author

kzys commented Jan 26, 2018

Thanks for merging! Sorry for not responding your comments quickly...

@pelletier
Copy link
Owner

pelletier commented Jan 27, 2018 via email

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