src/Pure/General/path.ML
changeset 33957 e9afca2118d4
parent 33955 fff6f11b1f09
child 36135 89d1903fbd50
equal deleted inserted replaced
33956:6f549f5e7066 33957:e9afca2118d4
   137   | ext e path = split_path (fn (prfx, s) => append (Path prfx) (basic (s ^ "." ^ e))) path;
   137   | ext e path = split_path (fn (prfx, s) => append (Path prfx) (basic (s ^ "." ^ e))) path;
   138 
   138 
   139 val split_ext = split_path (fn (prfx, s) => apfst (append (Path prfx))
   139 val split_ext = split_path (fn (prfx, s) => apfst (append (Path prfx))
   140   (case take_suffix (fn c => c <> ".") (explode s) of
   140   (case take_suffix (fn c => c <> ".") (explode s) of
   141     ([], _) => (Path [Basic s], "")
   141     ([], _) => (Path [Basic s], "")
   142   | (cs, e) => (Path [Basic (implode ((uncurry take) (length cs - 1, cs)))], implode e)));
   142   | (cs, e) => (Path [Basic (implode (take (length cs - 1) cs))], implode e)));
   143 
   143 
   144 
   144 
   145 (* expand variables *)
   145 (* expand variables *)
   146 
   146 
   147 fun eval (Variable s) =
   147 fun eval (Variable s) =