caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Damien Doligez <damien.doligez@inria.fr>
To: skaller@users.sourceforge.net
Cc: caml-list <caml-list@inria.fr>
Subject: Re: [Caml-list] Lexing.lexeme_start_p broken?
Date: Tue, 21 Sep 2004 10:26:38 +0200	[thread overview]
Message-ID: <F4E39A08-0BA7-11D9-A295-00039310CAE8@inria.fr> (raw)
In-Reply-To: <1095691464.2580.554.camel@pelican.wigram>

On Sep 20, 2004, at 16:44, skaller wrote:

> How does that help, if the tokeniser isn't using the lexbuf?
> Here's my parser:
>
> let parse_tokens (parser:'a parser_t) (tokens: Flx_parse.token list) =
>   let toker = (new tokeniser tokens) in
>   try
>     parser (toker#token_src) (Lexing.from_string "dummy" )
>   with _ ->
>     toker#report_syntax_error;
>     raise (Flx_exceptions.ParseError "Parsing Tokens")
>
> The token supplying function never looks at the lexbuf.
> The parser does, to report errors, so I have to trash
> the parser exceptions, since the locations are wrong.

The token supplying function is supposed to _update_ the lexbuf, if
you want the parser to report the correct locations.  ocamllex does
some of the work by updating the char count, the rest is up to the
lexer itself.

-- Damien

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


  reply	other threads:[~2004-09-21  8:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-17 22:07 Scott Duckworth
2004-09-20  9:23 ` Jean-Christophe Filliatre
2004-09-20 14:44   ` skaller
2004-09-21  8:26     ` Damien Doligez [this message]
2004-09-21  9:25       ` skaller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=F4E39A08-0BA7-11D9-A295-00039310CAE8@inria.fr \
    --to=damien.doligez@inria.fr \
    --cc=caml-list@inria.fr \
    --cc=skaller@users.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).