mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 07:38:48 +00:00
Fix #3926
This commit is contained in:
@@ -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