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;
}


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to