Browse Source

types/model: fix parser for empty values

brucemacd/tokenize
Michael Yang 2 years ago
parent
commit
63bc884e25
  1. 4
      types/model/file.go
  2. 4
      types/model/file_test.go

4
types/model/file.go

@ -249,10 +249,6 @@ func quote(s string) string {
}
func unquote(s string) (string, bool) {
if len(s) == 0 {
return "", false
}
// TODO: single quotes
if len(s) >= 3 && s[:3] == `"""` {
if len(s) >= 6 && s[len(s)-3:] == `"""` {

4
types/model/file_test.go

@ -489,6 +489,10 @@ You are a store greeter. Always responsed with "Hello!".
"""
MESSAGE user Hey there!
MESSAGE assistant Hello, I want to parse all the things!
`,
`
FROM foo
SYSTEM ""
`,
}

Loading…
Cancel
Save