Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
* lexer function .
@ 1996-10-31 10:25 Olivier Pons
  1996-11-04 16:45 ` Xavier Leroy
  0 siblings, 1 reply; 2+ messages in thread
From: Olivier Pons @ 1996-10-31 10:25 UTC (permalink / raw)
  To: caml-list



	hello !


I have a little problem with the lexer function generated by make_lexer
in the example below:

   let lexer = make_lexer ["("; ")"; "/\\"; "\//"; "~"; "->"];; 

   let a =  (lexer(stream_of_string"a/\~a"));; (* there is no blank*)
   a : token stream = <abstr>
   #let b = (lexer(stream_of_string"a/\ ~a"));;(* there is a blank*)
   b : token stream = <abstr>

and now I just inspect  the token stream generated

   #stream_next a;;                                              
   - : token = Ident "a"
   #stream_next b;;                            
   - : token = Ident "a"

but in the next call 

   #stream_next a;;
   - : token = Ident "/\\~"

   #stream_next b;;
   - : token = Kwd "/\\

   #stream_next a;;
   - : token = Ident "a"

   #stream_next b;;
   - : token = Kwd "~"
   .......

I don't understand why in the first case the keywords /\\ and ~  are not recognized ?

thank in advance


Olivier






^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1996-11-05  8:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-10-31 10:25 lexer function Olivier Pons
1996-11-04 16:45 ` Xavier Leroy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox