From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23680 invoked by alias); 1 Dec 2009 17:11:13 -0000 Received: (qmail 23627 invoked by uid 48); 1 Dec 2009 17:11:00 -0000 Date: Tue, 01 Dec 2009 17:11:00 -0000 Message-ID: <20091201171100.23626.qmail@sourceware.org> From: "jistone at redhat dot com" To: systemtap@sources.redhat.com In-Reply-To: <20091201102145.11038.mjw@redhat.com> References: <20091201102145.11038.mjw@redhat.com> Reply-To: sourceware-bugzilla@sourceware.org Subject: [Bug translator/11038] Trailing semicolon as null-statement confusing X-Bugzilla-Reason: AssignedTo Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2009-q4/txt/msg00770.txt.bz2 ------- Additional Comments From jistone at redhat dot com 2009-12-01 17:11 ------- (In reply to comment #1) > Created an attachment (id=4433) --> (http://sourceware.org/bugzilla/attachment.cgi?id=4433&action=view) > Patch to make null-statement really silent As far as I can see, this won't change the behavior of any previously valid scripts; it will only make a difference in this if-else case that currently gives an error. So in that sense, your patch seems harmless. However, I find it a little weird to squash the ';' on blocks and other "compound" statements (if, for, foreach, while). For blocks, I think we do want to parse "{...};" as two statements, even though it shouldn't make much difference. For the others, a singleton body should already eat one semicolon, so you're also eating a second. That means you could do this: if (x) if (y) foo();; else bar() and it will attach the 'else' to the outer 'if'. Normally you can't do that without using braces. Perhaps that's an interesting feature, but I think explaining the ';' rules involved would make it too weird to be very useful. So, I think we shouldn't squash semicolons after blocks, if, for, foreach, and while, and then the patch looks ok to me. -- http://sourceware.org/bugzilla/show_bug.cgi?id=11038 ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee.