HCoop
/
bpt
/
mlt.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
142d9e8
)
Switch to using OS.Path in Compiler
author
Adam Chlipala
<adamc@hcoop.net>
Sun, 11 Feb 2007 21:14:31 +0000
(21:14 +0000)
committer
Adam Chlipala
<adamc@hcoop.net>
Sun, 11 Feb 2007 21:14:31 +0000
(21:14 +0000)
src/compiler.sml
patch
|
blob
|
blame
|
history
diff --git
a/src/compiler.sml
b/src/compiler.sml
index
16d66f8
..
cd03d6c
100644
(file)
--- a/
src/compiler.sml
+++ b/
src/compiler.sml
@@
-33,48
+33,14
@@
struct
flush = fn () => TextIO.flushOut TextIO.stdOut,
linewidth = 80}
flush = fn () => TextIO.flushOut TextIO.stdOut,
linewidth = 80}
- fun getFname path =
- let
- fun look i =
- if i < 0 then
- path
- else if String.sub (path, i) = #"/" then
- String.extract (path, i+1, NONE)
- else
- look (i-1)
- in
- look (size path - 1)
- end
+ val getFname = OS.Path.file
- fun removeExt path =
- let
- val len = size path
-
- fun look i =
- if i >= len then
- path
- else if String.sub (path, i) = #"." then
- String.substring (path, 0, i)
- else
- look (i+1)
- in
- look 0
- end
+ val removeExt = OS.Path.base
fun getExt path =
fun getExt path =
- let
- val len = size path
-
- fun look i =
- if i >= len then
- path
- else if String.sub (path, i) = #"." then
- String.extract (path, i+1, NONE)
- else
- look (i+1)
- in
- look 0
- end
+ case OS.Path.ext path of
+ NONE => path
+ | SOME ext => ext
val upperOffset = ord #"A" - ord #"a"
fun toUpper ch =
val upperOffset = ord #"A" - ord #"a"
fun toUpper ch =