]> CRI, Mines Paris - PSL - Faustine.git/blobdiff - interpreter/aux.ml
Bugs fixed for stdin and stdout.
[Faustine.git] / interpreter / aux.ml
index 5321349aed145a1ecc61b8779a9f05ffe63acdf2..0564c303b447f5a4faa3a249b47662ef111afd61 100644 (file)
@@ -34,3 +34,9 @@ let remainder_float : float -> float -> float =
     if (abs_float r) > ((abs_float f2) /. 2.) then
       (if r *. f2 > 0. then (r -. f2) else (r +. f2))
     else r;;
+
+let format_of_file : string -> string = 
+  fun (path : string) ->
+    let fragments = Str.split (Str.regexp "\.") path in
+       let n = List.length fragments in
+       List.nth fragments (n - 1);;