@@ -594,7 +594,7 @@ func (p *parser) parseSimpleKey(b []byte) (key, rest []byte, err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if b[0] == '\'' {
|
if b[0] == '\'' {
|
||||||
key, rest, err = scanLiteralString(b)
|
key, rest, err = p.parseLiteralString(b)
|
||||||
} else if b[0] == '"' {
|
} else if b[0] == '"' {
|
||||||
key, rest, err = p.parseBasicString(b)
|
key, rest, err = p.parseBasicString(b)
|
||||||
} else if isUnquotedKeyChar(b[0]) {
|
} else if isUnquotedKeyChar(b[0]) {
|
||||||
|
|||||||
@@ -210,6 +210,21 @@ func TestUnmarshal(t *testing.T) {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
desc: "issue 427 - quotation marks in key",
|
||||||
|
input: `'"a"' = 1
|
||||||
|
"\"b\"" = 2`,
|
||||||
|
gen: func() test {
|
||||||
|
m := map[string]interface{}{}
|
||||||
|
return test{
|
||||||
|
target: &m,
|
||||||
|
expected: &map[string]interface{}{
|
||||||
|
`"a"`: int64(1),
|
||||||
|
`"b"`: int64(2),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
desc: "multiline basic string",
|
desc: "multiline basic string",
|
||||||
input: `A = """\
|
input: `A = """\
|
||||||
|
|||||||
Reference in New Issue
Block a user