From 80e5288d76eaf9fa4ac264e34fd1299d8e4c0642 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Wed, 24 Dec 2014 12:35:20 -0500 Subject: Broaden handling of wildcard rewrites --- src/compiler.sml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'src/compiler.sml') diff --git a/src/compiler.sml b/src/compiler.sml index b46643ff..49b251ba 100644 --- a/src/compiler.sml +++ b/src/compiler.sml @@ -693,8 +693,8 @@ fun parseUrp' accLibs fname = | _ => (ErrorMsg.error "Bad path kind spec"; Settings.Any) - fun parseFrom s = - if size s > 1 andalso String.sub (s, size s - 2) = #"/" andalso String.sub (s, size s - 1) = #"*" then + fun parsePattern s = + if size s > 0 andalso String.sub (s, size s - 1) = #"*" then (Settings.Prefix, String.substring (s, 0, size s - 1)) else (Settings.Exact, s) @@ -709,12 +709,6 @@ fun parseUrp' accLibs fname = | _ => (ErrorMsg.error "Bad filter kind"; url) - fun parsePattern s = - if size s > 0 andalso String.sub (s, size s - 1) = #"*" then - (Settings.Prefix, String.substring (s, 0, size s - 1)) - else - (Settings.Exact, s) - fun read () = case inputCommentableLine inf of EndOfFile => finish [] @@ -801,7 +795,7 @@ fun parseUrp' accLibs fname = fun doit (pkind, from, to, hyph) = let val pkind = parsePkind pkind - val (kind, from) = parseFrom from + val (kind, from) = parsePattern from in rewrites := {pkind = pkind, kind = kind, from = from, to = to, hyphenate = hyph} :: !rewrites end -- cgit v1.2.3 From bcc8158595c16afd34ad043fd4d9b80c4c4a1c3d Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Tue, 10 Feb 2015 09:58:20 -0500 Subject: Fix resolution of 'file' paths --- src/compiler.sml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/compiler.sml') diff --git a/src/compiler.sml b/src/compiler.sml index 49b251ba..388cc7d2 100644 --- a/src/compiler.sml +++ b/src/compiler.sml @@ -461,14 +461,13 @@ fun parseUrp' accLibs fname = end else let - val thisPath = OS.Path.dir fname - val pathmap = ref (!pathmap) val bigLibs = ref [] fun pu filename = let val filename = OS.Path.mkAbsolute {path = filename, relativeTo = OS.FileSys.getDir ()} + val thisPath = OS.Path.dir filename val dir = OS.Path.dir filename fun opener () = TextIO.openIn (OS.Path.joinBaseExt {base = filename, ext = SOME "urp"}) -- cgit v1.2.3