Dear Internals

Ok... So i figured out that the way to make a scala style multi line
function declaration was simply to do this:

### zend_language_parser.y ###
unticked_function_declaration_statement:
               function is_reference T_STRING {
zend_do_begin_function_declaration(&$1, &$3, 0, $2.op_type, NULL
TSRMLS_CC); }
                       '(' parameter_list ')' '=' '{' inner_statement_list '}' {
zend_do_end_function_declaration(&$1 TSRMLS_CC); }
;

### PHP ###
def new_function() = {
 echo "It works!\n";
}

But I have been stuck the last couple of hours trying to make support
for a one line function declaration without the '{}'. Example:

def double($x) = return 2 * $x;

I cant seem to find out what token to use for a new line? Any thoughts?

Thx a lot from confused guy
Rune Kaagaard
Denmark

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

Reply via email to