caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Junsong Li <ljs.darkfish@gmail.com>
To: Gabriel Scherer <gabriel.scherer@gmail.com>
Cc: caml users <caml-list@inria.fr>
Subject: Re: [Caml-list] ocamldoc lexer: why tracking line_number and char_number explicitly?
Date: Wed, 23 Dec 2015 20:52:26 -0800	[thread overview]
Message-ID: <CA+kGxtPxnYVsAP16VV2EYa5=sPn+W1Vq5dHDj07C--rAAE7rtA@mail.gmail.com> (raw)
In-Reply-To: <CAPFanBH=QMSZ6EBqNLxxM36zmHGJapdhA6nF4+ADL4+B40VYMA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1219 bytes --]

Hi Gabriel,

Thanks! The line number and char number in Lexing.position needs to be
initialized and updated (by "Lexing.new_line lexbuf"). This feature only
exists in 3.11 and above. So It could be historic reason. I'll dig more
into it.

On Wed, Dec 23, 2015 at 1:34 AM, Gabriel Scherer <gabriel.scherer@gmail.com>
wrote:

> Hi Junsong,
>
> I suspect that this simply comes from the fact that ocamldoc started out
> as a separate project and thus had to develop its own location handling. If
> there is a clean patch to move to Lexing.position, feel free to propose it.
> If this requires invasive changes with a larger chance of regressions, it's
> maybe not worth it.
>
> (Note that there seem to be some uses of Lexing.position already in the
> file, but only in some cases. I don't know the detail and you may have some
> "git log" mining to understand them.)
>
> On Wed, Dec 23, 2015 at 6:52 AM, Junsong Li <ljs.darkfish@gmail.com>
> wrote:
>
>> Dear list,
>>
>> I am wondering why ocamldoc lexers (odoc_lexer.mll and
>> odoc_text_lexer.mll) do not use Lexing.position but keep tracking line
>> number and char number explicitly. Does this have anything to do with the
>> Unicode?
>>
>> Thanks,
>> Junsong
>>
>
>

[-- Attachment #2: Type: text/html, Size: 1980 bytes --]

      reply	other threads:[~2015-12-24  4:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-23  5:52 Junsong Li
2015-12-23  9:34 ` Gabriel Scherer
2015-12-24  4:52   ` Junsong Li [this message]

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='CA+kGxtPxnYVsAP16VV2EYa5=sPn+W1Vq5dHDj07C--rAAE7rtA@mail.gmail.com' \
    --to=ljs.darkfish@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=gabriel.scherer@gmail.com \
    /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).