-
Notifications
You must be signed in to change notification settings - Fork 213
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
Conversation
The previous commit (a410399) doesn't work correctly because that must be handled by lexers. parseKey() must not handle escape sequences.
There was a problem hiding this 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 == ']' { |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
merged with 4874e84 |
Thanks for merging! Sorry for not responding your comments quickly... |
No worries. Thank you for the fix!
--
Thomas Pelletier
|
The previous commit (a410399) doesn't work correctly because that
must be handled by lexers. parseKey() must not handle escape sequences.