/[mojave]/metaprl/library/ascii_scan.ml
ViewVC logotype

Diff of /metaprl/library/ascii_scan.ml

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

revision 2921 by nogin, Fri Oct 22 01:07:59 1999 UTC revision 2922 by lolorigo, Thu Mar 16 19:52:02 2000 UTC
# Line 136  Line 136 
136  let scan_at_char_p s c = (not (scan_at_eof_p s)) & (s.cchar = c) & not (scan_escape_p s)  let scan_at_char_p s c = (not (scan_at_eof_p s)) & (s.cchar = c) & not (scan_escape_p s)
137    
138  let scan_char s c =  let scan_char s c =
139   if (scan_at_char_p s c)   if scan_at_char_p s c
140      then scan_next s      then scan_next s
141   else if (scan_at_eof_p s)   else if scan_at_eof_p s
142      then  error ["scanner"; "char"; Char.escaped c; "eof"] [] []      then error ["scanner"; "char"; Char.escaped c; "eof"] [] []
143   else error ["scanner"; "char"; (Char.escaped c); (Char.escaped s.cchar)] [] []   else error ["scanner"; "char"; (Char.escaped c); (Char.escaped s.cchar)] [] []
144   ; ()   ; ()
145    
# Line 148  Line 148 
148  let scan_at_byte_p s c = (not (scan_at_eof_p s)) & (code s.cchar) = c  & not (scan_escape_p s)  let scan_at_byte_p s c = (not (scan_at_eof_p s)) & (code s.cchar) = c  & not (scan_escape_p s)
149    
150  let scan_byte s c =  let scan_byte s c =
151   if (scan_at_byte_p s c)   if scan_at_byte_p s c
152      then scan_next s      then scan_next s
153    
154     else if (scan_at_eof_p s)     else if scan_at_eof_p s
155              then  error ["scanner"; "char"; Char.escaped (chr c); "eof"] [] []              then  error ["scanner"; "byte"; Char.escaped (chr c); "eof"] [] []
156     else error ["scanner"; "char"; Char.escaped (chr c); Char.escaped s.cchar] [] []     else error ["scanner"; "byte"; Char.escaped (chr c); Char.escaped s.cchar] [] []
157    
158    
159  let numeric_digits = ['0'; '1'; '2'; '3'; '4'; '5'; '6'; '7'; '8'; '9']  let numeric_digits = ['0'; '1'; '2'; '3'; '4'; '5'; '6'; '7'; '8'; '9']
# Line 224  Line 224 
224    
225   scan_byte s ld;   scan_byte s ld;
226    
227   if (scan_at_byte_p s rd) then (scan_byte s rd; [])   if scan_at_byte_p s rd then (scan_byte s rd; [])
228   else let acc = ref [(itemf ())] in   else let acc = ref [(itemf ())] in
229          while (scan_at_byte_p s sep)          while (scan_at_byte_p s sep)
230            do (scan_byte s sep); acc := (itemf ()) :: !acc            do (scan_byte s sep); acc := (itemf ()) :: !acc

Legend:
Removed from v.2921  
changed lines
  Added in v.2922

  ViewVC Help
Powered by ViewVC 1.1.26