1
0
forked from GitHub/gf-core

Fix in Prolog output of the atom "'"

This commit is contained in:
peb
2008-11-17 13:33:53 +00:00
parent ce50264e91
commit fae330f733

View File

@@ -207,7 +207,7 @@ plVar = varPrefix . concatMap changeNonAlphaNum
plAtom :: String -> String plAtom :: String -> String
plAtom "" = "''" plAtom "" = "''"
plAtom atom@(c:cs) | isAsciiLower c && all isAlphaNumUnderscore cs plAtom atom@(c:cs) | isAsciiLower c && all isAlphaNumUnderscore cs
|| c == '\'' && last cs == '\'' = atom || c == '\'' && cs /= "" && last cs == '\'' = atom
| otherwise = "'" ++ concatMap changeQuote atom ++ "'" | otherwise = "'" ++ concatMap changeQuote atom ++ "'"
where changeQuote '\'' = "\\'" where changeQuote '\'' = "\\'"
changeQuote c = [c] changeQuote c = [c]