Merge pull request #67 from Iazel/patch-1
Quotes string starting with a dot
This commit is contained in:
commit
312b370f4e
1 changed files with 3 additions and 0 deletions
|
@ -291,6 +291,7 @@ fn need_quotes(string: &str) -> bool {
|
||||||
|| string == "false"
|
|| string == "false"
|
||||||
|| string == "null"
|
|| string == "null"
|
||||||
|| string == "~"
|
|| string == "~"
|
||||||
|
|| string.starts_with('.')
|
||||||
|| string.parse::<i64>().is_ok()
|
|| string.parse::<i64>().is_ok()
|
||||||
|| string.parse::<f64>().is_ok()
|
|| string.parse::<f64>().is_ok()
|
||||||
}
|
}
|
||||||
|
@ -394,6 +395,8 @@ products:
|
||||||
amount: 4
|
amount: 4
|
||||||
"*cookies":
|
"*cookies":
|
||||||
amount: 4
|
amount: 4
|
||||||
|
".milk":
|
||||||
|
amount: 1
|
||||||
"2.4": real key
|
"2.4": real key
|
||||||
"[1,2,3,4]": array key
|
"[1,2,3,4]": array key
|
||||||
"true": bool key
|
"true": bool key
|
||||||
|
|
Loading…
Reference in a new issue