@@ -338,7 +338,7 @@ Loop:
|
||||
case tokenRightCurlyBrace:
|
||||
p.getToken()
|
||||
break Loop
|
||||
case tokenKey:
|
||||
case tokenKey, tokenInteger, tokenString:
|
||||
if !tokenIsComma(previous) && previous != nil {
|
||||
p.raiseError(follow, "comma expected between fields in inline table")
|
||||
}
|
||||
|
||||
@@ -897,3 +897,14 @@ func TestInvalidFloatParsing(t *testing.T) {
|
||||
t.Error("Bad error message:", err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
func TestMapKeyIsNum(t *testing.T) {
|
||||
_, err := Load("table={2018=1,2019=2}")
|
||||
if err != nil {
|
||||
t.Error("should be passed")
|
||||
}
|
||||
_, err = Load(`table={"2018"=1,"2019"=2}`)
|
||||
if err != nil {
|
||||
t.Error("should be passed")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user