Re: [RFC] PHP Attributes

From: Date: Thu, 21 Apr 2016 23:02:26 +0000
Subject: Re: [RFC] PHP Attributes
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-92618@lists.php.net to get a copy of this message
On Thu, Apr 21, 2016 at 4:51 PM, Dmitry Stogov <dmitry@zend.com> wrote: > > >> About expressions, isn't there an ambigoutiy? <<test(1)>> is a >> "plain" >> name, value based attribute. But it could also be an ast\node of a function >> call to "test(1)" >> > even in AST scalars are scalars. > so <<test(1+2)>> would return: ast\node "+" with two children int(1) and > int(2). > > I am wondering if they shouldn't get their own start/end signs to clear >> that up, <<<test(1)>> vs <<test(1)>>. >> > > no need for extra complication. > > Since the encapsulated meta-data is an AST, and as you say any valid php expression will be valid here, what about bit shifting? <<Test(FOO >> BAR)>> Are there concerns about finding the T_SR token, which is also the end annotation symbol? I've not done any work in the parser, so excuse me if that is an insanely stupid question :) Otherwise, I think this RFC looks great, and appreciate your work on this :) Ryan

« previous php.internals (#92618) next »