mirror of
https://github.com/odin-lang/Odin.git
synced 2026-02-16 08:04:07 +00:00
Clean up unquote code
This commit is contained in:
@@ -82,7 +82,7 @@ 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) {
|
||||
unquote :: proc(val: string) -> (string, runtime.Allocator_Error) {
|
||||
if strings.has_prefix(val, `"`) || strings.has_prefix(val, `'`) {
|
||||
if len(val) > 0 && (val[0] == '"' || val[0] == '\'') {
|
||||
v, allocated, ok := strconv.unquote_string(val)
|
||||
if !ok {
|
||||
return strings.clone(val)
|
||||
|
||||
Reference in New Issue
Block a user