Re: [RFC] [VOTE] PHP Attributes

From: Date: Wed, 11 May 2016 07:51:31 +0000
Subject: Re: [RFC] [VOTE] PHP Attributes
References: 1 2 3 4 5 6 7 8 9  Groups: php.internals 
Request: Send a blank email to internals+get-93212@lists.php.net to get a copy of this message
On 05/11/2016 10:27 AM, Stanislav Malyshev wrote:
Hi!
Personally, I'm for AST as well, but it's possible to get the same power translating string values of attributes into AST in the hooks.
Extending this, it's also possible to get the same power just extracting phpdocs and applying AST to them. In general yes, but we don't have grammar for doc-comments, and even extracting general string value may be not trivial.
/** * Adds two positive numbers * * @ensures $x + $y >=
 *                  0
* // support for multi-line attribute values? * @on_enter @enter_function(__FUNCTION__); * '@' sign before enter_function() is a silence operator. */ function add($x, $y) {
    return $x + $y;
}

« previous php.internals (#93212) next »