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]

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


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