Handle non-alpha chars in keys

This commit is contained in:
Thomas Pelletier
2013-12-10 19:46:56 +01:00
parent b1d602f733
commit 0c4e891f3e
2 changed files with 12 additions and 1 deletions
+3 -1
View File
@@ -68,7 +68,9 @@ func isAlphanumeric(r rune) bool {
}
func isKeyChar(r rune) bool {
return isAlphanumeric(r) || r == '-'
// "Keys start with the first non-whitespace character and end with the last
// non-whitespace character before the equals sign."
return !(isSpace(r) || r == '\n' || r == eof || r == '=')
}
func isDigit(r rune) bool {