Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:90188 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 4038 invoked from network); 6 Jan 2016 09:22:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Jan 2016 09:22:52 -0000 Authentication-Results: pb1.pair.com header.from=derick@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=derick@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 82.113.146.227 as permitted sender) X-PHP-List-Original-Sender: derick@php.net X-Host-Fingerprint: 82.113.146.227 xdebug.org Linux 2.6 Received: from [82.113.146.227] ([82.113.146.227:52449] helo=xdebug.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 11/2D-21755-8ECDC865 for ; Wed, 06 Jan 2016 04:22:48 -0500 Received: from localhost (localhost [IPv6:::1]) by xdebug.org (Postfix) with ESMTPS id 01F0910C057; Wed, 6 Jan 2016 09:22:44 +0000 (GMT) Date: Wed, 6 Jan 2016 09:22:44 +0000 (GMT) X-X-Sender: derick@whisky.home.derickrethans.nl To: Fred Emmott cc: PHP internals In-Reply-To: Message-ID: References: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="8323329-1541093827-1452072165=:4541" Subject: Re: [PHP-DEV] token_get_all(): additional location information, and raw tokens From: derick@php.net (Derick Rethans) --8323329-1541093827-1452072165=:4541 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE On Tue, 5 Jan 2016, Fred Emmott wrote: > I=E2=80=99m planning on adding this functionality in some form to HHVM,= =20 > however if it=E2=80=99s also wanted in PHP, I=E2=80=99d rather not add so= mething=20 > HHVM-specific and will be happy to put up RFCs :) >=20 > Location Information > =E2=80=94=E2=80=94=E2=80=94=E2=80=94 >=20 > token_get_all() returns a line number for some tokens. I propose=20 > adding an additional TOKEN_EXTENDED_LOCATION flag, that would include: >=20 > - starting line and character number within that line > - ending line and character number within that line That'd be nice to have... but I don't think the parser keeps that=20 information currently. =20 > T_ENCAPSED_AND_WHITESPACE and T_INLINE_HTML seem to be the most common=20 > cases of start line !=3D=3D end line. I would probably only include the ending line number if it is different?=20 Saves on a whole lot of memory allocations and usage... and it's trivial=20 to detect in consuming code. cheers, Derick --8323329-1541093827-1452072165=:4541--