58 |
| SOME NONE => let (* cycle found --> error message *) |
| SOME NONE => let (* cycle found --> error message *) |
59 |
val f = SmlInfo.sourcepath i |
val f = SmlInfo.sourcepath i |
60 |
fun pphist pps = let |
fun pphist pps = let |
61 |
fun recur [] = () (* shouldn't happen *) |
fun recur (_, []) = () (* shouldn't happen *) |
62 |
| recur ((s, i') :: r) = let |
| recur (n'', (s, i') :: r) = let |
63 |
val f' = SmlInfo.sourcepath i' |
val f' = SmlInfo.sourcepath i' |
64 |
|
val n' = AbsPath.spec f' |
65 |
val _ = |
val _ = |
66 |
if SmlInfo.eq (i, i') then () |
if SmlInfo.eq (i, i') then () |
67 |
else recur r |
else recur (n', r) |
|
val n' = AbsPath.name f' |
|
68 |
val l = |
val l = |
69 |
n' :: " refers to " :: |
n' :: " refers to " :: |
70 |
symDesc (s, [" defined in ..."]) |
symDesc (s, [" defined in ", n'']) |
71 |
in |
in |
72 |
app (PrettyPrint.add_string pps) l; |
app (PrettyPrint.add_string pps) l; |
73 |
PrettyPrint.add_newline pps |
PrettyPrint.add_newline pps |
74 |
end |
end |
75 |
in |
in |
76 |
recur history; |
PrettyPrint.add_newline pps; |
77 |
PrettyPrint.add_string pps (AbsPath.name f); |
recur (AbsPath.spec f, history); |
78 |
|
PrettyPrint.add_string pps "..."; |
79 |
PrettyPrint.add_newline pps |
PrettyPrint.add_newline pps |
80 |
end |
end |
81 |
in |
in |
152 |
case SM.find (subexports, s) of |
case SM.find (subexports, s) of |
153 |
SOME (farn, e) => (globalImport farn; e) |
SOME (farn, e) => (globalImport farn; e) |
154 |
| NONE => (SmlInfo.error i |
| NONE => (SmlInfo.error i |
155 |
(concat (AbsPath.name f :: |
(concat (AbsPath.spec f :: |
156 |
": reference to unknown " :: |
": reference to unknown " :: |
157 |
symDesc (s, []))) |
symDesc (s, []))) |
158 |
EM.nullErrorBody; |
EM.nullErrorBody; |