diff options
author | Ziv Scully <ziv@mit.edu> | 2015-03-27 11:26:06 -0400 |
---|---|---|
committer | Ziv Scully <ziv@mit.edu> | 2015-03-27 11:26:06 -0400 |
commit | 0b941d68e7ceba9302d57eb8083e8244602a09ce (patch) | |
tree | f74a786d667b2b1c70bb39e9a1bfb5c8f58bd5d5 /src/compiler.sml | |
parent | bef4dd04f19c2001561e9e889116f5a2f8905bc0 (diff) | |
parent | 8e114ff992a3e730f2eb42095267969eebf75c36 (diff) |
Merge.
Diffstat (limited to 'src/compiler.sml')
-rw-r--r-- | src/compiler.sml | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/compiler.sml b/src/compiler.sml index fc4067a4..a45b8c69 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"}) @@ -693,8 +692,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 +708,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 +794,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 |