Fix multiline basic string parsing

This commit is contained in:
Thomas Pelletier
2021-03-28 00:17:58 -04:00
parent 9a436c7eeb
commit 7dc5550057
2 changed files with 15 additions and 0 deletions
+1
View File
@@ -493,6 +493,7 @@ func (p *parser) parseMultilineBasicString(b []byte) ([]byte, []byte, error) {
for ; i < len(token)-3; i++ {
c := token[i]
if !(c == '\n' || c == '\r' || c == ' ' || c == '\t') {
i--
break
}
}
+14
View File
@@ -192,6 +192,20 @@ func TestUnmarshal(t *testing.T) {
}
},
},
{
desc: "multiline basic string",
input: `A = """\
Test"""`,
gen: func() test {
type doc struct {
A string
}
return test{
target: &doc{},
expected: &doc{A: "Test"},
}
},
},
{
desc: "kv bool true",
input: `A = true`,