src/Tools/Code/code_scala.ML
changeset 37958 9728342bcd56
parent 37932 d00a3f47b607
child 38059 72f4630d4c43
     1.1 --- a/src/Tools/Code/code_scala.ML	Fri Jul 23 18:42:46 2010 +0200
     1.2 +++ b/src/Tools/Code/code_scala.ML	Sat Jul 24 18:08:41 2010 +0200
     1.3 @@ -402,7 +402,7 @@
     1.4      else let val k = ord c
     1.5      in if k < 32 orelse k > 126 then "\\" ^ radixstring (8, "0", k) else c end
     1.6    fun numeral_scala k = if k < 0
     1.7 -    then if k <= 2147483647 then "- " ^ string_of_int (~ k)
     1.8 +    then if k > ~ 2147483647 then "- " ^ string_of_int (~ k)
     1.9        else quote ("- " ^ string_of_int (~ k))
    1.10      else if k <= 2147483647 then string_of_int k
    1.11        else quote (string_of_int k)
    1.12 @@ -411,8 +411,8 @@
    1.13    literal_string = quote o translate_string char_scala,
    1.14    literal_numeral = fn k => "BigInt(" ^ numeral_scala k ^ ")",
    1.15    literal_positive_numeral = fn k => "Nat(" ^ numeral_scala k ^ ")",
    1.16 -  literal_naive_numeral = fn k => if k >= 0
    1.17 -    then string_of_int k else "(- " ^ string_of_int (~ k) ^ ")",
    1.18 +  literal_alternative_numeral = fn k => "Natural(" ^ numeral_scala k ^ ")",
    1.19 +  literal_naive_numeral = fn k => "BigInt(" ^ numeral_scala k ^ ")",
    1.20    literal_list = fn [] => str "Nil" | ps => Pretty.block [str "List", enum "," "(" ")" ps],
    1.21    infix_cons = (6, "::")
    1.22  } end;