File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed
language-nix/src/Language/Nix Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -109,16 +109,20 @@ parseQuotedIdentifier = Identifier <$> qstring
109109 where
110110 qstring :: CharParser st tok m String
111111 qstring = do txt <- between (P. char ' "' ) (P. char ' "' ) (many qtext)
112- return ( read ( ' " ' : concat txt ++ [ ' " ' ]))
112+ return txt
113113
114- qtext :: CharParser st tok m String
115- qtext = quotedPair <|> many1 ( P. noneOf " \\\" " )
114+ qtext :: CharParser st tok m Char
115+ qtext = quotedPair <|> P. noneOf " \\\" "
116116
117- quotedPair :: CharParser st tok m String
117+ quotedPair :: CharParser st tok m Char
118118 quotedPair = do
119- c1 <- P. char ' \\ '
120- c2 <- anyChar
121- return [c1,c2]
119+ _ <- P. char ' \\ '
120+ c <- anyChar
121+ return $ case c of
122+ ' n' -> ' \n '
123+ ' t' -> ' \t '
124+ ' r' -> ' \r '
125+ _ -> c
122126
123127-- | Checks whether a given string needs quoting when interpreted as an
124128-- 'Identifier'.
You can’t perform that action at this time.
0 commit comments