Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:20697 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 75426 invoked by uid 1010); 28 Nov 2005 08:18:36 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 75411 invoked from network); 28 Nov 2005 08:18:36 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Nov 2005 08:18:36 -0000 X-Host-Fingerprint: 81.169.182.136 ajaxatwork.net Linux 2.4/2.6 Received: from ([81.169.182.136:57275] helo=strato.aixcept.de) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 9E/C5-56276-A5DBA834 for ; Mon, 28 Nov 2005 03:18:34 -0500 Received: from [192.168.1.3] (dslb-084-063-039-255.pools.arcor-ip.net [84.63.39.255]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by strato.aixcept.de (Postfix) with ESMTP id E6399610282; Mon, 28 Nov 2005 09:24:59 +0100 (CET) Date: Mon, 28 Nov 2005 09:16:41 +0100 Reply-To: Marcus Boerger X-Priority: 3 (Normal) Message-ID: <894304898.20051128091641@marcus-boerger.de> To: Sara Golemon Cc: internals@lists.php.net In-Reply-To: <005b01c5f07e$cfa28f90$5c8be5a9@ohr.berkeley.edu> References: <005b01c5f07e$cfa28f90$5c8be5a9@ohr.berkeley.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Labeled Breaks (not the G-word) From: helly@php.net (Marcus Boerger) Hello Sara, sorry to jump in, i didn'T read the thread but i have more ideas. From=20my point of view view should have the whole thing support any target. So idefinitively want to call it goto and if it cannot be goto i want to favor log_jump or long_goto or hey what about 'bad'. Also can't we do goto as an operator? I would suggest one of '=3D=3D>' or '>>>' or '=3D>>'. Just kidding. But the only way to drop this feature down seems to be the bulshitting tactics that was used for other features like the thing called ifsetor. Further more goto would only be for the advantage of very skillfulled people. To everyone else it simply would make the code bad n the sense of not understandabele, unmaintainable and error prone. best regards marcus p.s.: '=3D>>' would be a conflict. Wednesday, November 23, 2005, 11:39:30 PM, you wrote: > http://libssh2.org/patches/labeled_break.diff > A few notes about the implementation: > * The parser is modified slightly to catch T_BREAK T_LNUMBER ';' and T_BR= EAK > T_STRING ';' specifically. This is in-line with the decision to remove t= he > ability to jump to variable targets. e.g. `break $foo;` will result in an > E_PARSE. > * current break container is moved from op1.u.opline_num to extended_value > (This means updating continue; as well) > * op1 is used to store the label's name until pass_two(), at that point i= t's > converted to a jmp_addr. Non-labeled breaks leave op1 unused and jmp_addr > explicitly set to NULL > * zend_brk opcode handler updated to use op1->u.jmp_addr if available > (labeled breaks), or el->brk (numbered breaks) if not. zend_brk and > zend_cont both updated per current break container change above. > * Labeled breaks must target the same break container or higher within the > same op_array, and must only jump "forward" in execution. These checks a= re > handled in pass_two() which is the earliest point at which all labeled are > declared. > * Label hash is only allocated/initialized if labels are declared. > Known Issues: > * When an error is thrown from pass_two(), the error message states it's = in > Unknown on line 0. Gotta find a better way to handle that.... > * This adds an element to zend_op_array so be sure to either `make clean`= or > at least `touch Zend/*.c` after applying it otherwise you'll be in segfau= lt > country. > -Sara Best regards, Marcus