Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:45740 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 61613 invoked from network); 12 Oct 2009 11:51:14 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Oct 2009 11:51:14 -0000 Authentication-Results: pb1.pair.com header.from=rumi.kg@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=rumi.kg@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.225 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: rumi.kg@gmail.com X-Host-Fingerprint: 209.85.220.225 mail-fx0-f225.google.com Received: from [209.85.220.225] ([209.85.220.225:47066] helo=mail-fx0-f225.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AF/31-54920-13813DA4 for ; Mon, 12 Oct 2009 07:51:14 -0400 Received: by fxm25 with SMTP id 25so8553294fxm.24 for ; Mon, 12 Oct 2009 04:51:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=X4Z3cAjLNuRnUMgzUhSvV0j44NIqAFomDgfE8tNksW0=; b=OQ2f56baGNoWOL/PZwhbjxFinfsgZHkJaWv5K502LPURsP4ruwplGOZNbLf6I5Osca y33g/JuSVZdw6JlDAg+fZEhY1dZpge7Mo6Mj+3IK52YPqZTKWd8oh63unNV4PCUQhwQr gAMgOzV2ofmjiUUUeQRUNOIxIKTDZA55BTsk4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=fCFmIrnnSrjQCH4+ctZF9cF8YBFBToEC1aUNQhOw5qO4pNWE7Zk5bF5VC8GfqKKlKA ERxSesFHV1yAhAb4nSbOF8Iza+c5QNvrYTa6qIVhjfUSxdLpfMJ/lpnYhtIbATsJ8FSU n9rlq/RIp66a+ITz87VThvMd0MZuNc38KSEBc= MIME-Version: 1.0 Received: by 10.204.154.209 with SMTP id p17mr4979822bkw.104.1255348270476; Mon, 12 Oct 2009 04:51:10 -0700 (PDT) In-Reply-To: <9db916bc0910101434x507e05b9r2651eaa67f833164@mail.gmail.com> References: <9db916bc0910101434x507e05b9r2651eaa67f833164@mail.gmail.com> Date: Mon, 12 Oct 2009 13:51:10 +0200 Message-ID: <9db916bc0910120451q56db05b5xe527b6b48b346324@mail.gmail.com> To: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: Creating an experimental syntax From: rumi.kg@gmail.com (Rune Kaagaard) 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