'\xd7af' -> 0xd7af
authorunc0rr
Sun, 13 May 2012 21:46:50 +0400
changeset 7075 6bd7e5ad3f2b
parent 7074 3f23bd0f2af2
child 7076 fed718e7851d
'\xd7af' -> 0xd7af
tools/pas2c.hs
--- a/tools/pas2c.hs	Sun May 13 21:39:20 2012 +0400
+++ b/tools/pas2c.hs	Sun May 13 21:46:50 2012 +0400
@@ -745,7 +745,7 @@
 expr2C (CharCode a) = do
     modify(\s -> s{lastType = BTChar})
     return $ quotes $ text "\\x" <> text (showHex (read a) "")
-expr2C (HexCharCode a) = return $ quotes $ text "\\x" <> text (map toLower 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 " | ")
 
 expr2C (BuiltInFunCall [e] (SimpleReference (Identifier "low" _))) = do