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: Language Reference, updated


josh wrote:

> The semicolon is necessary because it's optional.  :-/ [...]
> 
> Said with less tongue-in-cheek: There are certain grammatical
> ambiguities that are due to the fact that the language has no statement
> separator.  

Yes. (Or, alternately, because it has both prefix and postfix operators.)

> [...] The spacing indicates what I want to happen, but the actual
> parsing will produce this:
>   probe foo {
>     (a) = ((b)++)
>     c
>   }
> Surprise!  [...]

We could have a "DWIM" post-parse pass, which would emit warnings if
suspicious line spans occur in expression statements.

> You might conclude that it's best to always include a semicolon as a
> statement separator, but even that can backfire.  [if () foo; else bar; ]
> This will give you "parse error: expected statement" [...]

I'm ambivalent about how problematic this is.  Awk and tcl, for
example are newline sensitive (";" is a separator for multiple
statements on a single line).  We all know how python feels.  IIRC
dtrace takes the C route.

- FChE


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