Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:74440 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 47118 invoked from network); 23 May 2014 06:40:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 May 2014 06:40:23 -0000 Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.47 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.192.47 mail-qg0-f47.google.com Received: from [209.85.192.47] ([209.85.192.47:37213] helo=mail-qg0-f47.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C0/6A-63132-65DEE735 for ; Fri, 23 May 2014 02:40:22 -0400 Received: by mail-qg0-f47.google.com with SMTP id j107so7415802qga.34 for ; Thu, 22 May 2014 23:40:20 -0700 (PDT) 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:content-transfer-encoding; bh=FhrhnZUoLd4AdXYpKJBw7ioU72uXYyNoqenZlo8og5U=; b=UXYG5uSqXa2ih3nN8ZB5k2azK00gXdggICIKxRamdmCv1Pi4G1JGc05S9jR5ZihPpi lMoW0PkoSvC7Q1ej/kvpIIehRoTAKKpn82Q51dZNXCXaGg6nVDAtcIXOs39SaxTborkO 2id0Bd18cUQGEmEa/n5dypu5qD2D/gB50jY+Vg+dFcNLe5ubRhmWHvxw2FHkQ9tjhI+J rKQg7DqtG//9ihX667OOBNTvhDf9FJcniTW4eVPhZV3sExjaRrZlhs7+ibb8PtUQmHOR 0WmH27xNqn3wBUq/KN3wK4XYUZp7KmQO/SURpV2IGSU+4TbMQghDgH7SUxJ0b0N/oSov Nhuw== MIME-Version: 1.0 X-Received: by 10.140.101.99 with SMTP id t90mr3136334qge.115.1400827220008; Thu, 22 May 2014 23:40:20 -0700 (PDT) Received: by 10.140.47.231 with HTTP; Thu, 22 May 2014 23:40:19 -0700 (PDT) In-Reply-To: References: <2DC459EE-AE98-4CAE-977A-6FB918FDEF54@bafford.com> <537EA42B.4000000@lerdorf.com> Date: Fri, 23 May 2014 08:40:19 +0200 Message-ID: To: John Bafford Cc: Rasmus Lerdorf , PHP internals Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Bison 3 support for PHP 5.5 From: pierre.php@gmail.com (Pierre Joye) Hi John, On Fri, May 23, 2014 at 3:44 AM, John Bafford wrote: > Hi Rasmus, > > On May 22, 2014, at 20:28, Rasmus Lerdorf wrote: > >> On 5/22/14, 6:01 PM, John Bafford wrote: >>> Hi, >>> >>> I=E2=80=99ve submitted a PR (https://github.com/php/php-src/pull/683) t= o add support for Bison 3.0 to PHP 5.5. >>> >>> I=E2=80=99ve run the tests on this patch, with no unexpected errors, wi= th Bison 2.4 (minimum version for PHP 5.5 and 5.6), 2.7, and 3.0, with and = without --enable-maintainer-zts against the current PHP-5.5 and (with minor= changes) master branches. >> >> Could you explain your changes a bit? You removed %pure-parser, for >> example, and you shuffled globals around. This looks like more than just >> adding support for Bison 3. >> >> -Rasmus > > I replaced %pure-parser (which was deprecated) with %pure_parser (its rep= lacement). (Also, YYERROR_VERBOSE, which also was deprecated, with %error-v= erbose.) > > Most of the changes in the PR revolve around this change in Zend/zend_lan= guage_parser.y: > -%code requires { > -#ifdef ZTS > -# define YYPARSE_PARAM tsrm_ls > -# define YYLEX_PARAM tsrm_ls > -#endif > -} > +%parse-param { void *tsrm_ls } > +%lex-param { void *tsrm_ls } > > YYPARSE_PARAM and YYLEX_PARAM were deprecated, and then removed, and repl= aced with %parse-param and %lex-param. However, you cannot (or I did not se= e a way to) conditionally define parameters, as PHP was previously doing he= re. > > So instead, I created the TSRMLS_DN and TSRMLS_CN macros which, in the ZT= S case, work like TSRMLS_D/TSRMLS_C, but when ZTS is off, still resolve to = a parameter (that must always be present), which is passed NULL. Thanks for your work, always good to support less archaic version of bison. Some comments: - does it still work with previous versions? If yes, do you know which or which minimum version we should then require? - 5.5 is stable, I am not sure it is a good idea to do these changes there. 5.6 may be a good candidate (but has to be done quickly, RMs can confirm if it is still possible) Cheers, --=20 Pierre @pierrejoye | http://www.libgd.org