mirror of
https://github.com/carp-lang/Carp.git
synced 2024-10-11 04:27:55 +03:00
commands: escape chars in macro stringification
This commit is contained in:
parent
b1ee9ac07f
commit
5aa31aa0cb
@ -684,7 +684,10 @@ commandStr :: CommandCallback
|
||||
commandStr xs =
|
||||
return (Right (XObj (Str (join (map f xs))) (Just dummyInfo) (Just StringTy)))
|
||||
where f (XObj (Str s) _ _) = s
|
||||
f x = pretty x
|
||||
f x = escape $ pretty x
|
||||
escape [] = []
|
||||
escape ('\\':y) = "\\\\" ++ escape y
|
||||
escape (x:y) = x : escape y
|
||||
|
||||
commandNot :: CommandCallback
|
||||
commandNot [x] =
|
||||
|
Loading…
Reference in New Issue
Block a user