18 |
core: DependencyGraph.snode, |
core: DependencyGraph.snode, |
19 |
pervasive: DependencyGraph.snode, |
pervasive: DependencyGraph.snode, |
20 |
primitives: (string * DependencyGraph.snode) list, |
primitives: (string * DependencyGraph.snode) list, |
21 |
filepaths: AbsPath.t list } option |
binpaths: AbsPath.t list } option |
22 |
end |
end |
23 |
|
|
24 |
structure BuildInitDG :> BUILD_INIT_DG = struct |
structure BuildInitDG :> BUILD_INIT_DG = struct |
57 |
else SOME (String.tokens sep line, newpos) |
else SOME (String.tokens sep line, newpos) |
58 |
end |
end |
59 |
|
|
60 |
fun loop (split, m, pl, pos) = |
fun loop (split, m, bpl, pos) = |
61 |
case lineIn pos of |
case lineIn pos of |
62 |
NONE => (error (pos, pos) "unexpected end of file"; NONE) |
NONE => (error (pos, pos) "unexpected end of file"; NONE) |
63 |
| SOME (line, newpos) => let |
| SOME (line, newpos) => let |
66 |
val p = AbsPath.standard pcmode |
val p = AbsPath.standard pcmode |
67 |
{ context = context, spec = spec } |
{ context = context, spec = spec } |
68 |
in |
in |
|
(p, |
|
69 |
SmlInfo.info gp { sourcepath = p, |
SmlInfo.info gp { sourcepath = p, |
70 |
group = (specgroup, (pos, newpos)), |
group = (specgroup, (pos, newpos)), |
71 |
share = NONE, |
share = NONE, |
72 |
split = split }) |
split = split } |
73 |
end |
end |
74 |
fun bogus n = |
fun bogus n = |
75 |
DG.SNODE { smlinfo = #2 (sml (n, false)), |
DG.SNODE { smlinfo = sml (n, false), |
76 |
localimports = [], globalimports = [] } |
localimports = [], globalimports = [] } |
77 |
fun look n = |
fun look n = |
78 |
case StringMap.find (m, n) of |
case StringMap.find (m, n) of |
94 |
DG.SB_SNODE n => (n :: li, gi) |
DG.SB_SNODE n => (n :: li, gi) |
95 |
| n as DG.SB_BNODE _ => (li, (NONE, n) :: gi) |
| n as DG.SB_BNODE _ => (li, (NONE, n) :: gi) |
96 |
val (li, gi) = foldr one ([], []) args |
val (li, gi) = foldr one ([], []) args |
97 |
val (p, i) = sml (file, split) |
val i = sml (file, split) |
98 |
val n = DG.SNODE { smlinfo = i, |
val n = DG.SNODE { smlinfo = i, |
99 |
localimports = li, |
localimports = li, |
100 |
globalimports = gi } |
globalimports = gi } |
101 |
val pl' = |
val bpl' = |
102 |
case pl of |
case bpl of |
103 |
NONE => NONE |
NONE => NONE |
104 |
| SOME l => SOME (p :: l) |
| SOME l => SOME (SmlInfo.binpath i :: l) |
105 |
in |
in |
106 |
loop (split, |
loop (split, |
107 |
StringMap.insert (m, name, DG.SB_SNODE n), |
StringMap.insert (m, name, DG.SB_SNODE n), |
108 |
pl', newpos) |
bpl', newpos) |
109 |
end |
end |
110 |
in |
in |
111 |
case line of |
case line of |
112 |
[] => loop (split, m, pl, newpos) |
[] => loop (split, m, bpl, newpos) |
113 |
| ["split"] => loop (true, m, pl, newpos) |
| ["split"] => loop (true, m, bpl, newpos) |
114 |
| ["nosplit"] => loop (false, m, pl, newpos) |
| ["nosplit"] => loop (false, m, bpl, newpos) |
115 |
| ["start"] => loop (split, m, SOME [], newpos) |
| ["start"] => loop (split, m, SOME [], newpos) |
116 |
| ("bind" :: name :: file :: args) => |
| ("bind" :: name :: file :: args) => |
117 |
node (name, file, args) |
node (name, file, args) |
121 |
pervasive = look_snode pervasive, |
pervasive = look_snode pervasive, |
122 |
primitives = |
primitives = |
123 |
map (fn n => (n, look_snode n)) prims, |
map (fn n => (n, look_snode n)) prims, |
124 |
filepaths = rev (getOpt (pl, [])) } |
binpaths = rev (getOpt (bpl, [])) } |
125 |
| _ => (error "malformed line"; NONE) |
| _ => (error "malformed line"; NONE) |
126 |
end |
end |
127 |
in |
in |