jmacro 0.5.7 → 0.5.8
raw patch · 2 files changed
+9/−9 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- Language/Javascript/JMacro/QQ.hs +8/−8
- jmacro.cabal +1/−1
Language/Javascript/JMacro/QQ.hs view
@@ -747,7 +747,7 @@ _ <- char t x <- concat <$> many myChar _ <- char t- return $ decodeJson x+ decodeJson x where myChar = do c <- noneOf [t] case c of@@ -757,7 +757,7 @@ _ -> return [c] -- Taken from json package by Sigbjorn Finne.-decodeJson :: String -> String+decodeJson :: String -> JMParser String decodeJson x = parse [] x where parse rs cs =@@ -765,12 +765,12 @@ '\\' : c : ds -> esc rs c ds c : ds | c >= '\x20' && c <= '\xff' -> parse (c:rs) ds- | c < '\x20' -> error $ "Illegal unescaped character in string: " ++ x+ | c < '\x20' -> fail $ "Illegal unescaped character in string: " ++ x | i <= 0x10ffff -> parse (c:rs) ds- | otherwise -> error $ "Illegal unescaped character in string: " ++ x+ | otherwise -> fail $ "Illegal unescaped character in string: " ++ x where i = (fromIntegral (fromEnum c) :: Integer)- [] -> reverse rs+ [] -> return $ reverse rs esc rs c cs = case c of '\\' -> parse ('\\' : rs) cs@@ -786,9 +786,9 @@ case readHex [d1,d2,d3,d4] of [(n,"")] -> parse (toEnum n : rs) cs' - x -> error $ "Unable to parse JSON String: invalid hex: " ++ (show x)- _ -> error $ "Unable to parse JSON String: invalid hex: " ++ cs- _ -> error $ "Unable to parse JSON String: invalid escape char: " ++ [c]+ x -> fail $ "Unable to parse JSON String: invalid hex: " ++ (show x)+ _ -> fail $ "Unable to parse JSON String: invalid hex: " ++ cs+ _ -> fail $ "Unable to parse JSON String: invalid escape char: " ++ [c] --tricky bit to deal with regex literals and comments / / -- if we hit // inside, then we fail, since that isn't ending the regex but introducing a comment, and thus the initial / could not have introduced a regex. regexLiteral :: JMParser String
jmacro.cabal view
@@ -1,5 +1,5 @@ name: jmacro-version: 0.5.7+version: 0.5.8 synopsis: QuasiQuotation library for programmatic generation of Javascript code. description: Javascript syntax, functional syntax, hygienic names, compile-time guarantees of syntactic correctness, limited typechecking. Additional documentation available at <http://www.haskell.org/haskellwiki/Jmacro> category: Language