comparison src/compiler.sml @ 1340:caff0a4d5fc1

Allow use of path variables in strings with no slashes
author Adam Chlipala <adam@chlipala.net>
date Tue, 14 Dec 2010 10:59:17 -0500
parents 8c1996489265
children 0a2b630f2463
comparison
equal deleted inserted replaced
1339:43677a8a20e9 1340:caff0a4d5fc1
389 if size fname > 0 andalso String.sub (fname, 0) = #"$" then 389 if size fname > 0 andalso String.sub (fname, 0) = #"$" then
390 let 390 let
391 val fname' = Substring.extract (fname, 1, NONE) 391 val fname' = Substring.extract (fname, 1, NONE)
392 val (befor, after) = Substring.splitl (fn ch => ch <> #"/") fname' 392 val (befor, after) = Substring.splitl (fn ch => ch <> #"/") fname'
393 in 393 in
394 if Substring.isEmpty after then 394 case M.find (!pathmap, Substring.string befor) of
395 fname 395 NONE => fname
396 else 396 | SOME rep => rep ^ Substring.string after
397 case M.find (!pathmap, Substring.string befor) of
398 NONE => fname
399 | SOME rep => rep ^ Substring.string after
400 end 397 end
401 else 398 else
402 fname 399 fname
403 400
404 fun relify fname = 401 fun relify fname =