Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78689 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 42859 invoked from network); 4 Nov 2014 22:43:21 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Nov 2014 22:43:21 -0000 Authentication-Results: pb1.pair.com header.from=guilhermeblanco@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=guilhermeblanco@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.223.172 as permitted sender) X-PHP-List-Original-Sender: guilhermeblanco@gmail.com X-Host-Fingerprint: 209.85.223.172 mail-ie0-f172.google.com Received: from [209.85.223.172] ([209.85.223.172:56690] helo=mail-ie0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 61/D6-02095-78659545 for ; Tue, 04 Nov 2014 17:43:20 -0500 Received: by mail-ie0-f172.google.com with SMTP id at20so8613963iec.3 for ; Tue, 04 Nov 2014 14:43:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=aMwDqo0bwApjzgHZlq9iiS2Fqb1sUs5afOhvs7PL+Iw=; b=gm6v0ojoQa1lzsHWNmML3zejJHO2Rfniw0dGNjC8QZ40cynblgM5TxCCiYR4gsspab GVskiffNkShtA/56NJbS7I98ohtNf43B+MxnORcdGXOBo92OQx4h+Bws89UphMgGKtci k8vtFQ9UQzFRGnikLdmoq7gZCPv7+sm4Frm5jRiffLPJBccqbmPrTp7fKk2L9EmR3K4i RBwTDPE+D5TqKfMlLMWEBJsEzafI/xvxeQSrSg+RjkxeqPpaHIQv+GvogFJs1cEIfdEV SrGVaJdWHRSLC9lZq7obynTJRRQvlaOB/sSh6TkmXhFJpnWkad/iaBRK/RFqdc5CgjGo eYkA== X-Received: by 10.107.129.16 with SMTP id c16mr5618586iod.79.1415140997144; Tue, 04 Nov 2014 14:43:17 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.155.5 with HTTP; Tue, 4 Nov 2014 14:42:56 -0800 (PST) In-Reply-To: References: <5457AF2F.90808@php.net> <5457BDB7.8070701@garfieldtech.com> <54589A8D.3020607@sugarcrm.com> <1C3F4FA3-ABD5-4F6F-A898-F63AC1C723D5@ajf.me> <54591A76.8070302@sugarcrm.com> <967E30E5-71CB-40F8-9AE2-733D327DE197@ajf.me> <545945A5.2090204@sugarcrm.com> Date: Tue, 4 Nov 2014 17:42:56 -0500 Message-ID: To: Andrea Faulds Cc: Stas Malyshev , Benjamin Eberlei , Pierre Joye , Levi Morrison , PHP internals , Larry Garfield Content-Type: multipart/alternative; boundary=001a113ecd9a7126bf05071030aa Subject: Re: [PHP-DEV] Annotation PHP 7 From: guilhermeblanco@gmail.com ("guilhermeblanco@gmail.com") --001a113ecd9a7126bf05071030aa Content-Type: text/plain; charset=UTF-8 Hi, By dealing with annotations in docblocks will force the Annotations parser to *much* smarter than you imagine. Currently in Doctrine Annotations implementation, @param and @Param are considered different not only by first character to be uppercased, but rather because a class also exist in that namespace and also because it's an @Annotation. Smarter I mean that you'll have to build a rejection list of non-standardized annotations, such as phpdoc and phpunit. It also makes pretty hard to parse emails. You can see the list of ignored names as part of https://github.com/doctrine/annotations/blob/master/lib/Doctrine/Common/Annotations/AnnotationReader.php#L48 Regards, On Tue, Nov 4, 2014 at 5:20 PM, Andrea Faulds wrote: > > > On 4 Nov 2014, at 21:31, Stas Malyshev wrote: > > > >> This brings the next piece of the puzzle. We have to update lexical and > >> semantical understanding of PHP. Taking Java's approach (@) does not > >> work in PHP, because it conflicts with error supression. Same thing > > > > Except for the mental context, how @ conflicts with errors? Suppression > > is always in runtime context and applied to expressions, annotations are > > always outside of it and apply to declarations. Unless of course you > > want to annotate variables and closures, but I'm not sure annotating > > expressions is such a good idea anyway > > At the top-level, @ is a shift/reduce conflict due to ambiguity between > statement annotation and expression. > > Though it might be possible to work around that with the AST (ew). > > -- > Andrea Faulds > http://ajf.me/ > > > > > -- Guilherme Blanco MSN: guilhermeblanco@hotmail.com GTalk: guilhermeblanco Toronto - ON/Canada --001a113ecd9a7126bf05071030aa--