tools/pas2c/Pas2C.hs
branchwebgl
changeset 9964 12b0ed9910cd
parent 9954 bf51bc7e2808
child 9982 24ea101fdc7f
--- a/tools/pas2c/Pas2C.hs	Tue Jan 07 00:02:58 2014 +0400
+++ b/tools/pas2c/Pas2C.hs	Tue Jan 07 01:58:23 2014 +0400
@@ -651,7 +651,7 @@
 initExpr2C' (InitHexNumber s) = return $ text "0x" <> (text . map toLower $ s)
 initExpr2C' (InitString [a]) = return . quotes $ text [a]
 initExpr2C' (InitString s) = return $ strInit s
-initExpr2C' (InitChar a) = return $ quotes $ text "\\x" <> text (showHex (read a) "")
+initExpr2C' (InitChar a) = return $ text "0x" <> text (showHex (read a) "")
 initExpr2C' (InitReference i) = id2C IOLookup i
 initExpr2C' (InitRecord fields) = do
     (fs :: [Doc]) <- mapM (\(Identifier a _, b) -> liftM (text "." <> text a <+> equals <+>) $ initExpr2C b) fields
@@ -998,7 +998,7 @@
 expr2C Null = return $ text "NULL"
 expr2C (CharCode a) = do
     modify(\s -> s{lastType = BTChar})
-    return $ quotes $ text "\\x" <> text (showHex (read a) "")
+    return $ text "0x" <> text (showHex (read a) "")
 expr2C (HexCharCode a) = if length a <= 2 then return $ quotes $ text "\\x" <> text (map toLower a) else expr2C $ HexNumber a
 expr2C (SetExpression ids) = mapM (id2C IOLookup) ids >>= return . parens . hcat . punctuate (text " | ")