22 |
-> SrcPath.t * (* grouppath *) |
-> SrcPath.t * (* grouppath *) |
23 |
DG.sbnode list * (* export_nodes *) |
DG.sbnode list * (* export_nodes *) |
24 |
(SrcPath.t * GG.group) list * (* sublibs *) |
(SrcPath.t * GG.group) list * (* sublibs *) |
25 |
SrcPathSet.set (* groups *) |
SrcPathSet.set * (* groups *) |
26 |
|
Version.t option |
27 |
-> bool |
-> bool |
28 |
val verify : GP.info -> exportmap -> GG.group -> bool |
val verify : GP.info -> exportmap -> GG.group -> bool |
29 |
end |
end |
32 |
|
|
33 |
type exportmap = SmlInfo.info StableMap.map |
type exportmap = SmlInfo.info StableMap.map |
34 |
|
|
35 |
fun verify' (gp: GP.info) em (grouppath, export_nodes, sublibs, groups) = |
fun verify' (gp: GP.info) em args = let |
36 |
let val groups = SrcPathSet.add (groups, grouppath) |
val (grouppath, export_nodes, sublibs, groups, version) = args |
37 |
|
val groups = SrcPathSet.add (groups, grouppath) |
38 |
val policy = #fnpolicy (#param gp) |
val policy = #fnpolicy (#param gp) |
39 |
fun sname p = FilenamePolicy.mkStableName policy p |
val stablename = |
40 |
val stablename = sname grouppath |
FilenamePolicy.mkStableName policy (grouppath, version) |
41 |
|
|
42 |
fun invalidMember stab_t i = let |
fun invalidMember stab_t i = let |
43 |
val p = SmlInfo.sourcepath i |
val p = SmlInfo.sourcepath i |
51 |
| _ => true |
| _ => true |
52 |
end |
end |
53 |
|
|
54 |
fun nonstabSublib (_, GG.GROUP { kind = GG.STABLELIB _, ... }) = false |
fun nonstabSublib (_, GG.GROUP { kind = GG.LIB { kind = GG.STABLE _, |
55 |
|
... }, ... }) = false |
56 |
| nonstabSublib _ = true |
| nonstabSublib _ = true |
57 |
|
|
58 |
fun invalidGroup stab_t p = |
fun invalidGroup stab_t p = |
70 |
(* The group itself is included in "groups"... *) |
(* The group itself is included in "groups"... *) |
71 |
not (SrcPathSet.exists (invalidGroup st) groups) andalso |
not (SrcPathSet.exists (invalidGroup st) groups) andalso |
72 |
not (List.exists nonstabSublib sublibs) andalso |
not (List.exists nonstabSublib sublibs) andalso |
73 |
validStamp (grouppath, export_nodes, sublibs) andalso |
validStamp ((grouppath, export_nodes, sublibs), version) |
74 |
not (SmlInfoSet.exists (invalidMember st) m) |
andalso not (SmlInfoSet.exists (invalidMember st) m) |
75 |
end |
end |
76 |
| _ => false |
| _ => false |
77 |
in |
in |
83 |
|
|
84 |
fun verify _ _ GG.ERRORGROUP = false |
fun verify _ _ GG.ERRORGROUP = false |
85 |
| verify gp em (group as GG.GROUP g) = let |
| verify gp em (group as GG.GROUP g) = let |
86 |
val { exports, grouppath, sublibs, ... } = g |
val { exports, grouppath, sublibs, kind, ... } = g |
87 |
val groups = Reachable.groupsOf group |
val groups = Reachable.groupsOf group |
88 |
|
val version = |
89 |
|
case kind of |
90 |
|
GG.NOLIB _ => NONE |
91 |
|
| GG.LIB { version, ... } => version |
92 |
in |
in |
93 |
verify' gp em (grouppath, |
verify' gp em (grouppath, |
94 |
map (#2 o #1) (SymbolMap.listItems exports), |
map (#2 o #1) (SymbolMap.listItems exports), |
95 |
sublibs, groups) |
sublibs, groups, version) |
96 |
end |
end |
97 |
end |
end |
98 |
end |
end |