This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[Bug translator/11038] New: Trailing semicolon as null-statement confusing
- From: "mjw at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: systemtap at sources dot redhat dot com
- Date: 1 Dec 2009 10:21:45 -0000
- Subject: [Bug translator/11038] New: Trailing semicolon as null-statement confusing
- Reply-to: sourceware-bugzilla at sourceware dot org
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 <input>: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.