Fix #3926
This commit is contained in:
1 parent
251fa477af
commit
95a695e4cd
1 file changed
+9
-7
@@ -82,14 +82,16 @@ Map :: distinct map[string]map[string]string
|
|||||||
|
|
||||||
load_map_from_string :: proc(src: string, allocator: runtime.Allocator, options := DEFAULT_OPTIONS) -> (m: Map, err: runtime.Allocator_Error) {
|
load_map_from_string :: proc(src: string, allocator: runtime.Allocator, options := DEFAULT_OPTIONS) -> (m: Map, err: runtime.Allocator_Error) {
|
||||||
unquote :: proc(val: string) -> (string, runtime.Allocator_Error) {
|
unquote :: proc(val: string) -> (string, runtime.Allocator_Error) {
|
||||||
v, allocated, ok := strconv.unquote_string(val)
|
if strings.has_prefix(val, `"`) || strings.has_prefix(val, `'`) {
|
||||||
if !ok {
|
v, allocated, ok := strconv.unquote_string(val)
|
||||||
return strings.clone(val)
|
if !ok {
|
||||||
|
return strings.clone(val)
|
||||||
|
}
|
||||||
|
if allocated {
|
||||||
|
return v, nil
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if allocated {
|
return strings.clone(val)
|
||||||
return v, nil
|
|
||||||
}
|
|
||||||
return strings.clone(v)
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user