This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
RE: Re: Global constants
- From: "Stone, Joshua I" <joshua dot i dot stone at intel dot com>
- To: "Frank Ch. Eigler" <fche at redhat dot com>
- Cc: <systemtap at sources dot redhat dot com>
- Date: Mon, 13 Feb 2006 13:50:34 -0800
- Subject: RE: Re: Global constants
Frank Ch. Eigler wrote:
> joshua.i.stone wrote:
>
>> [...] I find it unfortunate that the language is designed such that
>> the semicolon is "usually-not but sometimes" needed.
>
> It's more like "almost never" needed. According to my recollection
> and testsuite/parseok/elven.stp, it's only needed for disambiguating
> overloaded (unary and binary) "+" and "-" operators.
There's also an ambiguity with '++' and '--', but the testcase
unfortunately doesn't catch it. Consider this subset of
testsuite/parseok/eleven.stp:
a % b
a ++
a --
-- a
++ a
This parses to the sequence you would probably expect:
(a) % (b)
(a)++
(a)--
--(a)
++(a)
If I mix it up a little:
a % b
-- a
++ a
a ++
a --
This now parses as:
(a) % ((b)--)
(a)++
a
(a)++
(a)--
This is a valid interpretation, but not what you probably want - thus
the ambiguity. The only way to see that this is "wrong" is to compare
it to the desired output.
I had thought this ambiguity was a known behavior, thus my annoyance and
why I never reported it as an issue. But given your statement, I
suspect you'll be surprised to see this behavior.
Josh