Mercurial > urweb
comparison src/prim.sml @ 1257:fd1a49b51db5
Fix C-mangling of datatype names
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Sun, 16 May 2010 15:34:24 -0400 |
parents | d7d5b167f267 |
children | 4d04cb89649b |
comparison
equal
deleted
inserted
replaced
1256:d7d5b167f267 | 1257:fd1a49b51db5 |
---|---|
72 if size s >= n then | 72 if size s >= n then |
73 s | 73 s |
74 else | 74 else |
75 str ch ^ pad (n-1, ch, s) | 75 str ch ^ pad (n-1, ch, s) |
76 | 76 |
77 val gccify = String.toCString | |
78 | |
79 fun p_t_GCC t = | 77 fun p_t_GCC t = |
80 case t of | 78 case t of |
81 Int n => string (int2s n) | 79 Int n => string (int2s n) |
82 | Float n => string (float2s n) | 80 | Float n => string (float2s n) |
83 | String s => box [string "\"", string (gccify s), string "\""] | 81 | String s => box [string "\"", string (String.toCString s), string "\""] |
84 | Char ch => box [string "'", string (gccify (str ch)), string "'"] | 82 | Char ch => box [string "'", string (Char.toCString ch), string "'"] |
85 | 83 |
86 fun equal x = | 84 fun equal x = |
87 case x of | 85 case x of |
88 (Int n1, Int n2) => n1 = n2 | 86 (Int n1, Int n2) => n1 = n2 |
89 | (Float n1, Float n2) => Real64.== (n1, n2) | 87 | (Float n1, Float n2) => Real64.== (n1, n2) |