Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] ocamllex problem
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jonathan Roewen <jonathan.roewen@g...>
Subject: [Caml-list] ocamllex problem
Hi,

Here's my .mll file, to match IRC strings. The problem is that it's
including spaces, which I assume it shouldn't.

let letter = [^' ']

rule token = parse
        | ':'((letter|' ')* as s)       { STRING s }
        | letter+ as s                  { STRING s }
        | [' ']+                        { token lexbuf }
        | eof                           { EOL }

(BTW, this is for matching rule 2). Maybe I'm just retarded, but this
should work, correct?

Jonathan