mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-14 02:57:52 +08:00
libdasc/parse: Implement single-quoted string unquote
This commit is contained in:
parent
15b48d1125
commit
ca00832915
|
@ -227,7 +227,8 @@ func unquote(token Item) (string, error) {
|
||||||
case ItemBare:
|
case ItemBare:
|
||||||
return token.Val, nil
|
return token.Val, nil
|
||||||
case ItemSingleQuoted:
|
case ItemSingleQuoted:
|
||||||
return token.Val[1:len(token.Val)-1], nil
|
return strings.Replace(token.Val[1:len(token.Val)-1], "''", "'", -1),
|
||||||
|
nil
|
||||||
case ItemDoubleQuoted:
|
case ItemDoubleQuoted:
|
||||||
return strconv.Unquote(token.Val)
|
return strconv.Unquote(token.Val)
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user