From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id B907B7EFC0 for ; Thu, 24 Dec 2015 05:52:29 +0100 (CET) IronPort-PHdr: 9a23:Fx5whBHZQNencaAuHbT8HZ1GYnF86YWxBRYc798ds5kLTJ75oMSwAkXT6L1XgUPTWs2DsrQf27SQ6/iocFdDyKjCmUhKSIZLWR4BhJdetC0bK+nBN3fGKuX3ZTcxBsVIWQwt1Xi6NU9IBJS2PAWK8TWM5DIfUi/yKRBybrysXNWC0YLvj6ibwN76XUZhvHKFe7R8LRG7/036l/I9ps9cEJs30QbDuXBSeu5blitCLFOXmAvgtI/rpMYwuwwZgf8q9tZBXKPmZOx4COUAVHV1e1wyseLivwPCQA/H3XAcX38biFIcDAHP9hD3WtHquSv3rOdn8CafNMzyC7szXGLxwb1sTUrKlSEcMDg2uEXWwph0jrkdrBu7pBJ+2I78b4ScNf44daTYK4BJDVFdV9pcAnQSSri3aJECWq9YZb5V Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=ljs.darkfish@gmail.com; spf=Pass smtp.mailfrom=ljs.darkfish@gmail.com; spf=None smtp.helo=postmaster@mail-ig0-f169.google.com Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of ljs.darkfish@gmail.com) identity=pra; client-ip=209.85.213.169; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="ljs.darkfish@gmail.com"; x-sender="ljs.darkfish@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of ljs.darkfish@gmail.com designates 209.85.213.169 as permitted sender) identity=mailfrom; client-ip=209.85.213.169; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="ljs.darkfish@gmail.com"; x-sender="ljs.darkfish@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-ig0-f169.google.com) identity=helo; client-ip=209.85.213.169; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="ljs.darkfish@gmail.com"; x-sender="postmaster@mail-ig0-f169.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0A8AABJeXtWm6nVVdFehGoPBohTtHsBDYFkhg8CgRkHOBQBAQEBAQEBARABAQEBAQYLCwkhLkEMgWCCBwEBAQMBEhEdARsdAQMBCwYFBAcNKgICIQEBEQEFARwGEyKHdwEDCgihAYExPjGLSIFqgnmIZAoZJw1Wgx8BAQEBAQUBAQEBAQEBFgEFDotHgk+FJIFKBY4uiFaLVoF4jnlEhh2GDRIkgRcgAQGCRiMkgWEdNINKgV4BAQE X-IPAS-Result: A0A8AABJeXtWm6nVVdFehGoPBohTtHsBDYFkhg8CgRkHOBQBAQEBAQEBARABAQEBAQYLCwkhLkEMgWCCBwEBAQMBEhEdARsdAQMBCwYFBAcNKgICIQEBEQEFARwGEyKHdwEDCgihAYExPjGLSIFqgnmIZAoZJw1Wgx8BAQEBAQUBAQEBAQEBFgEFDotHgk+FJIFKBY4uiFaLVoF4jnlEhh2GDRIkgRcgAQGCRiMkgWEdNINKgV4BAQE X-IronPort-AV: E=Sophos;i="5.20,472,1444687200"; d="scan'208";a="193905568" Received: from mail-ig0-f169.google.com ([209.85.213.169]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 24 Dec 2015 05:52:27 +0100 Received: by mail-ig0-f169.google.com with SMTP id jw2so90732388igc.1 for ; Wed, 23 Dec 2015 20:52:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=JShkSKa/LKaSxgiuo0JiItoeR7SOxQqftgmDZCRRPQs=; b=DOwvludcdqy16KNbXH8XRo7t1Pygilu49XRvhPcMOQ7BfYG23uP7o8V8w+g8LS17jf j7nwh1Ou4Ami7brVUGzpLtFgmkxvFxR7JShgUFB0i7utcf8O65VzjzbBSi68UNmkVemM 7KmKN+tc9G5GrZI0pydxwyk3X210RVXNp3FQbSZl5Ua2T8iloLGKtfJYlVG7p9GeUS/t 7X+8HKBylTFUxotqeuvq3d56+tZmY1cqeIyYwQvIpnAs0XyCQnMzU3ZtFz4A+3a2FVvT yLqzGXi4qUamfnzt1ArZL7HMeEN7JBNGX862A7GJj8k6+MvmLzyJRK1c9teV+Nn/EffN cO6A== MIME-Version: 1.0 X-Received: by 10.50.40.34 with SMTP id u2mr33838746igk.79.1450932746493; Wed, 23 Dec 2015 20:52:26 -0800 (PST) Received: by 10.79.38.71 with HTTP; Wed, 23 Dec 2015 20:52:26 -0800 (PST) In-Reply-To: References: Date: Wed, 23 Dec 2015 20:52:26 -0800 Message-ID: From: Junsong Li To: Gabriel Scherer Cc: caml users Content-Type: multipart/alternative; boundary=089e0122f84cf2a76805279d9a89 Subject: Re: [Caml-list] ocamldoc lexer: why tracking line_number and char_number explicitly? --089e0122f84cf2a76805279d9a89 Content-Type: text/plain; charset=UTF-8 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 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 > 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 >> > > --089e0122f84cf2a76805279d9a89 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Gabriel,

Thanks! The line number and char = number in Lexing.position needs to be initialized and updated (by "Lex= ing.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, 201= 5 at 1:34 AM, Gabriel Scherer <gabriel.scherer@gmail.com> wrote:
H= i 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, f= eel free to propose it. If this requires invasive changes with a larger cha= nce of regressions, it's maybe not worth it.

(Note that th= ere seem to be some uses of Lexing.position already in the file, but only i= n some cases. I don't know the detail and you may have some "git l= og" 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 num= ber and char number explicitly. Does this have anything to do with the Unic= ode?

Thanks,
Junsong


--089e0122f84cf2a76805279d9a89--