Version française
Home     About     Download     Resources     Contact us    
Browse thread
ocamllex and python-style indentation
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Andreas Rossberg <rossberg@m...>
Subject: Re: [Caml-list] ocamllex and python-style indentation
I wrote:
> ------------------------------------------------
> let error l s = (* ... *)
> let commentDepth = ref 0
> let start = ref 0
> let loc length = let pos = !start in (pos, pos+length)
>
> rule lex =
>    parse eof            { EOF }
>    (* | ... *)
>    | "{-"            { start := pos lexbuf;
>                  lexNestComment lexbuf }

Sorry, the "{-" should be "(*" for ML. And the (* | ... *) is supposed 
to stand for all other tokens in your lexer.

- Andreas