mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-13 09:57:51 +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:
|
||||
return token.Val, nil
|
||||
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:
|
||||
return strconv.Unquote(token.Val)
|
||||
default:
|
||||
|
|
Loading…
Reference in New Issue
Block a user