This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug translator/11038] New: Trailing semicolon as null-statement confusing


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]