From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30270 invoked by alias); 1 Dec 2009 10:21:57 -0000 Received: (qmail 30218 invoked by uid 48); 1 Dec 2009 10:21:45 -0000 Date: Tue, 01 Dec 2009 10:21:00 -0000 From: "mjw at redhat dot com" To: systemtap@sources.redhat.com Message-ID: <20091201102145.11038.mjw@redhat.com> Reply-To: sourceware-bugzilla@sourceware.org Subject: [Bug translator/11038] New: 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/msg00766.txt.bz2 semicolons (;) are optional, the parser really uses whitespace as separator of statements. This is slightly confusing since semicolons are treated as null-statements. This causes some confusion when writing code like: probe begin {if (1 > 0) log("foo"); else log ("bar");}' There will be an error for the else saying: parse error: expected statement saw: keyword at :1:37 source: probe begin {if (1 > 0) log("foo"); else log ("bar");} After encountering this a couple of time it dawns that one either has to put braces around the then part or remove the semicolon. It would (imho) be better if the null-statement following another statement expression was really silent and optional. -- Summary: Trailing semicolon as null-statement confusing Product: systemtap Version: unspecified Status: NEW Severity: normal Priority: P2 Component: translator AssignedTo: systemtap at sources dot redhat dot com ReportedBy: mjw at redhat dot com 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.