[allow characters to be stored in the sptr_t directly, print them out nicely in the source code when possible
John Meacham <john@repetae.net>**20080322232116] hunk ./C/FromGrin2.hs 8
+import Data.Char
hunk ./C/FromGrin2.hs 22
+import Cmm.Number
hunk ./C/FromGrin2.hs 74
-    cpr = Set.fromList [ a | (a,TyTy { tySlots = [s], tySiblings = Just [a'] }) <- Map.assocs tmap, a == a', isJust (good s) ]
+    cpr = Set.insert cChar $ Set.fromList [ a | (a,TyTy { tySlots = [s], tySiblings = Just [a'] }) <- Map.assocs tmap, a == a', isJust (good s) ]
hunk ./C/FromGrin2.hs 763
-    if a `Set.notMember` cpr then return Nothing else do
-        v <- convertVal v
-        return $ Just (f_VALUE v)
+    if a `Set.notMember` cpr then return Nothing else
+        case v of
+            Lit i ty | a == cChar, Just c <- ch -> return $ Just (f_VALUE (toExpression c)) where
+                ch = do
+                    c <- fmap toEnum $toIntegral i
+                    guard $ isPrint c && isAscii c
+                    return c
+            _ -> do
+                v <- convertVal v
+                return $ Just (f_VALUE v)
hunk ./C/Generate.hs 676
+
+instance ToExpression Char where
+    toExpression c = constant $ character c
hunk ./Grin/Val.hs 6
+    cChar,
+    cInt,