CVS: sml-dist/src/ml-flex/src/BackEnds expand-file.sml,1.1,1.2
Matthias Blume <[email protected]>
| Newsgroups | gmane.comp.lang.sml.smlnj.commits |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/smlnj/sml-dist/src/ml-flex/src/BackEnds
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10568/src/ml-flex/src/BackEnds
Modified Files:
expand-file.sml
Log Message:
ml-flex installation should now work
Index: expand-file.sml
===================================================================
RCS file: /cvsroot/smlnj/sml-dist/src/ml-flex/src/BackEnds/expand-file.sml,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** expand-file.sml 24 Feb 2006 22:23:53 -0000 1.1
--- expand-file.sml 27 Feb 2006 05:25:47 -0000 1.2
***************
*** 18,29 ****
structure TIO = TextIO
structure SS = Substring
structure RE = RegExpFn (
structure P = AwkSyntax
structure E = BackTrackEngine)
structure M = MatchTree
type hook = TextIO.outstream -> unit
! val placeholderRE = RE.compileString "[\\t ]*@([a-zA-Z][-a-zA-Z0-9_]*)@[\\t ]*"
val prefixPlaceholder = RE.prefix placeholderRE SS.getc
--- 18,32 ----
structure TIO = TextIO
structure SS = Substring
+ (*
structure RE = RegExpFn (
structure P = AwkSyntax
structure E = BackTrackEngine)
structure M = MatchTree
+ *)
type hook = TextIO.outstream -> unit
! (*
! val placeholderRE = RE.compileString "[\\t ]*@([a-zA-Z][-a-zA-Z0-9_]* )@[\\t ]*"
val prefixPlaceholder = RE.prefix placeholderRE SS.getc
***************
*** 33,36 ****
--- 36,51 ----
| _ => NONE
(* end case *))
+ *)
+
+ fun findPlaceholder s = let
+ val trim = SS.dropr Char.isSpace (SS.dropl Char.isSpace (SS.full s))
+ val size = SS.size trim
+ in if size > 2 andalso
+ SS.isPrefix "@" trim andalso
+ SS.isSuffix "@" trim then
+ SOME (SS.string (SS.slice (trim, 1, SOME (size - 2))))
+ else
+ NONE
+ end
(* copy from inStrm to outStrm expanding placeholders *)
***************
*** 70,71 ****
--- 85,88 ----
end
+
+
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642