--- sml/trunk/src/cm/paths/abspath.sml 1999/07/07 00:45:56 373 +++ sml/trunk/src/cm/paths/abspath.sml 1999/07/07 02:59:55 374 @@ -62,7 +62,24 @@ | compareId (PRESENT _, ABSENT _) = GREATER | compareId (ABSENT s, ABSENT s') = String.compare (s, s') - fun getId f = (PRESENT (F.fileId f) handle _ => ABSENT f) + (* To maximize our chances of recognizing eqivalent path names to + * non-existing files, we use F.fullPath to expand the largest + * possible prefix of the path. *) + fun expandPath f = let + fun loop { dir, file } = + P.concat (F.fullPath dir, file) + handle _ => let + val { dir = dir', file = file' } = P.splitDirFile dir + in + loop { dir = dir', file = P.concat (file', file) } + end + in + (* An initial call to splitDirFile is ok because we already know + * that the complete path does not refer to an existing file. *) + loop (P.splitDirFile f) + end + + fun getId f = (PRESENT (F.fileId f) handle _ => ABSENT (expandPath f)) type elaboration = { stamp : unit ref, name : string,
Click to toggle
does not end with </html> tag
does not end with </body> tag
The output has ended thus: handle _ => ABSENT (expandPath f)) type elaboration = { stamp : unit ref, name : string,