Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /trunk/src/compiler/fields/raw-types.sml
ViewVC logotype

Diff of /trunk/src/compiler/fields/raw-types.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 281, Fri Aug 13 17:40:53 2010 UTC revision 282, Fri Aug 13 19:20:23 2010 UTC
# Line 18  Line 18 
18        | RT_Int64 | RT_UInt64        | RT_Int64 | RT_UInt64
19        | RT_Float | RT_Double        | RT_Float | RT_Double
20    
21        fun same (a : ty, b) = (a = b)
22    
23        fun hash RT_Int8    = 0w17
24          | hash RT_UInt8   = 0w59
25          | hash RT_Int16   = 0w103
26          | hash RT_UInt16  = 0w157
27          | hash RT_Int32   = 0w211
28          | hash RT_UInt32  = 0w269
29          | hash RT_Int64   = 0w331
30          | hash RT_UInt64  = 0w389
31          | hash RT_Float   = 0w449
32          | hash RT_Double  = 0w509
33    
34      fun fromString ty = (case ty      fun fromString ty = (case ty
35             of "signed char" => RT_Int8             of "signed char" => RT_Int8
36              | "unsigned char" => RT_UInt8              | "unsigned char" => RT_UInt8
# Line 32  Line 45 
45              | _ => raise Fail("unknown raw type "^ty)              | _ => raise Fail("unknown raw type "^ty)
46            (* end case *))            (* end case *))
47    
48        fun toString ty = (case ty
49               of RT_Int8 => "signed char"
50                | RT_UInt8 => "unsigned char"
51                | RT_Int16 => "short"
52                | RT_UInt16 => "unsigned short"
53                | RT_Int32 => "int"
54                | RT_UInt32 => "unsigned int"
55                | RT_Int64 => "long long int"
56                | RT_UInt64 => "unsigned long long int"
57                | RT_Float => "float"
58                | RT_Double => "double"
59              (* end case *))
60    
61    end    end

Legend:
Removed from v.281  
changed lines
  Added in v.282

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0