Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/src/eXene/widgets/util/attrs.sml
ViewVC logotype

Diff of /sml/trunk/src/eXene/widgets/util/attrs.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1861, Mon Nov 7 18:17:09 2005 UTC revision 1862, Mon Nov 7 23:03:18 2005 UTC
# Line 130  Line 130 
130    
131    (* strip leading and trailing whitespace from a string. *)    (* strip leading and trailing whitespace from a string. *)
132      fun sstrip s =      fun sstrip s =
133            SS.dropr Char.isSpace (SS.dropl Char.isSpace (SS.all s))            SS.dropr Char.isSpace (SS.dropl Char.isSpace (SS.full s))
134      fun strip s = SS.string (sstrip s)      fun strip s = SS.string (sstrip s)
135      fun skipWS s = SS.dropl Char.isSpace (SS.all s)      fun skipWS s = SS.dropl Char.isSpace (SS.full s)
136    
137      fun cvtBool s = (case (strip s)      fun cvtBool s = (case (strip s)
138             of ("true"|"yes"|"Yes"|"on"|"On") => true             of ("true"|"yes"|"Yes"|"on"|"On") => true
# Line 141  Line 141 
141            (* end case *))            (* end case *))
142    
143      fun cvtInt s = let      fun cvtInt s = let
144            val s = StringCvt.skipWS SS.getc (SS.all s)            val s = StringCvt.skipWS SS.getc (SS.full s)
145            val start = if Char.isDigit(SS.sub (s, 0)) then 0 else 1            val start = if Char.isDigit(SS.sub (s, 0)) then 0 else 1
146            val rad = if (SS.sub(s, start) = #"0")            val rad = if (SS.sub(s, start) = #"0")
147                        then (case SS.sub(s, start+1)                        then (case SS.sub(s, start+1)

Legend:
Removed from v.1861  
changed lines
  Added in v.1862

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0