Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/src/ml-nlffigen/gen.sml
ViewVC logotype

Diff of /sml/trunk/src/ml-nlffigen/gen.sml

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

revision 1558, Thu Jul 22 22:30:55 2004 UTC revision 1559, Fri Jul 23 23:06:44 2004 UTC
# Line 71  Line 71 
71      fun EString s = EVar (concat ["\"", String.toString s, "\""])      fun EString s = EVar (concat ["\"", String.toString s, "\""])
72    
73      fun warn m = TextIO.output (TextIO.stdErr, "warning: " ^ m)      fun warn m = TextIO.output (TextIO.stdErr, "warning: " ^ m)
74        fun err m = raise Fail (concat ("gen: " :: m))
75    
76      fun unimp what = raise Fail ("unimplemented type: " ^ what)      fun unimp what = raise Fail ("unimplemented type: " ^ what)
77      fun unimp_arg what = raise Fail ("unimplemented argument type: " ^ what)      fun unimp_arg what = raise Fail ("unimplemented argument type: " ^ what)
# Line 663  Line 664 
664                | encode (S.ARR _) = raise Fail "unexpected array"                | encode (S.ARR _) = raise Fail "unexpected array"
665                | encode (S.ENUM _) = E_sint                | encode (S.ENUM _) = E_sint
666                | encode (S.STRUCT t) =                | encode (S.STRUCT t) =
667                    encode_fields Unit (#fields (valOf ($? (structs, t))))                    (case $? (structs, t) of
668                           SOME s => encode_fields Unit (#fields s)
669                         | NONE => err ["incomplete struct argument: struct ", t])
670                | encode (S.UNION t) =                | encode (S.UNION t) =
671                    encode_fields E_sint (#all (valOf ($? (unions, t))))                    (case $? (unions, t) of
672                           SOME u => encode_fields E_sint (#all u)
673                         | NONE => err ["incomplete union argument: union", t])
674    
675              and encode_fields dummy fields = let              and encode_fields dummy fields = let
676                  fun f0 (S.ARR { t, d = 0, ... }, a) = a                  fun f0 (S.ARR { t, d = 0, ... }, a) = a

Legend:
Removed from v.1558  
changed lines
  Added in v.1559

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