diff src/compiler.sml @ 2226:e10881cd92da

Merge.
author Ziv Scully <ziv@mit.edu>
date Fri, 27 Mar 2015 11:26:06 -0400
parents 365727ff68f4 c15f35e507b5
children 2b1af5dc6dee
line wrap: on
line diff
--- a/src/compiler.sml	Fri Mar 27 11:19:15 2015 -0400
+++ b/src/compiler.sml	Fri Mar 27 11:26:06 2015 -0400
@@ -461,14 +461,13 @@
          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 @@
                            | _ => (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 @@
                            | _ => (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 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