remove empty dir
[ghc-hetmet.git] / ghc / compiler / javaGen / PrintJava.lhs
index 02118da..eb2811d 100644 (file)
@@ -81,11 +81,6 @@ clazz = \mfs -> \n -> \x -> \is -> \ms ->
   $$ indent ms 
   $$ text "}"
 
-staticblock = \ss ->
-  text "static" <+> text "{"
-  $$ indent ss
-  $$ text "}"
-    
 modifiers mfs = hsep (map modifier mfs)
     
 modifier mf = text $ map toLower (show mf)
@@ -179,6 +174,8 @@ expr = \e ->
    ; Access e n -> expr e <> text "." <> name n
    ; Assign l r -> assign (expr l) r
    ; New n es ds -> new (typ n) es (maybeClass ds)
+   ; Raise n es  -> text "raise" <+> text n
+                       <+> parens (hsep (punctuate comma (map expr es)))
    ; Call e n es -> call (expr e) (name n) es
    ; Op e1 o e2 -> op e1 o e2
    ; InstanceOf e t -> expr e <+> text "instanceof" <+> typ t
@@ -218,8 +215,8 @@ call e n es = e <> dot <> n <> parens (hsep (punctuate comma (map expr es)))
 literal = \l ->
   case l of
     { IntLit i    -> text (show i)
-    ; CharLit c   -> text (show c)
-    ; StringLit s -> text (show s)
+    ; CharLit c   -> text "(char)" <+> text (show c)
+    ; StringLit s -> text ("\"" ++ s ++ "\"")  -- strings are already printable
     }
 
 maybeClass Nothing   = Nothing