Version française
Home     About     Download     Resources     Contact us    
Browse thread
lexing from a sub-string with an explicit position
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Nicolas Pouillard <nicolas.pouillard@g...>
Subject: Re: [Caml-list] lexing from a sub-string with an explicit position
On 2/16/06, Basile STARYNKEVITCH <basile@starynkevitch.net> wrote:
>
> Dear All,
Hi,

[...]

>   let lxbu = Lexing.from_function stread in
>     lxbu.Lexing.lex_start_p <- lpos;
>     lxbu.Lexing.lex_curr_p <- lpos;
>     lxbu
> ;;

Setting these fields is alas not sufficent, add this assignment should
help (it works fine for me):

    lxbu.Lexing.lex_abs_pos <- lpos.Lexing.pos_cnum;

Best regards,

--
Nicolas Pouillard