being more accurate wrt. list syntax
authorhaftmann
Wed, 13 Jan 2010 08:56:16 +0100
changeset 34888 460ec1a99aa2
parent 34887 31209fb24176
child 34889 dcaf6ec84e28
being more accurate wrt. list syntax
src/Tools/Code/code_scala.ML
--- a/src/Tools/Code/code_scala.ML	Wed Jan 13 08:56:16 2010 +0100
+++ b/src/Tools/Code/code_scala.ML	Wed Jan 13 08:56:16 2010 +0100
@@ -409,7 +409,7 @@
   literal_string = quote o translate_string char_scala,
   literal_numeral = fn unbounded => fn k => if k >= 0 then string_of_int k
     else Library.enclose "(" ")" (signed_string_of_int k),
-  literal_list = fn ps => Pretty.block [str "List", enum "," "(" ")" ps],
+  literal_list = fn [] => str "Nil" | ps => Pretty.block [str "List", enum "," "(" ")" ps],
   infix_cons = (6, "::")
 } end;
 
@@ -436,7 +436,7 @@
       "true", "type", "val", "var", "while", "with"
     ]
   #> fold (Code_Target.add_reserved target) [
-      "error", "apply", "List"
+      "error", "apply", "List", "Nil"
     ];
 
 end; (*struct*)