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

SCM Repository

[smlnj] Annotation of /sml/trunk/src/compiler/ElabData/syntax/absynutil.sml
ViewVC logotype

Annotation of /sml/trunk/src/compiler/ElabData/syntax/absynutil.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 903 - (view) (download)

1 : blume 903 (* absynutil.sml
2 :     *
3 :     * (C) 2001 Lucent Technologies, Bell Labs
4 :     *
5 :     * More stuff from ElabUtil should be moved here eventually.
6 :     *)
7 :     structure AbsynUtil : sig
8 :    
9 :     val unitExp : Absyn.exp
10 :    
11 :     val TUPLEexp : Absyn.exp list -> Absyn.exp
12 :     val TUPLEpat : Absyn.pat list -> Absyn.pat
13 :    
14 :     end = struct
15 :    
16 :     val unitExp = Absyn.RECORDexp []
17 :    
18 :     fun TUPLEexp l = let
19 :     fun build (_, []) = []
20 :     | build (i, e :: es) =
21 :     (Absyn.LABEL { number = i-1, name = Tuples.numlabel i }, e)
22 :     :: build (i+1, es)
23 :     in
24 :     Absyn.RECORDexp (build (1, l))
25 :     end
26 :    
27 :     fun TUPLEpat l = let
28 :     fun build (_, []) = []
29 :     | build (i, e :: es) = (Tuples.numlabel i, e) :: build (i+1, es)
30 :     in
31 :     Absyn.RECORDpat { fields = build (1, l), flex = false,
32 :     typ = ref Types.UNDEFty }
33 :     end
34 :     end

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