Debian Codegraph @

testsuite/parseok/autocast03.stp

raw
1 #! stap -p1
2
3 probe begin {
4 // The autocast operators have higher precedence than array_in, so the first
5 // two mean the same thing, and the third overrides precedence.
6 ( & foo in bar )
7 ( & (foo) in bar )
8 ( & (foo in bar) )
9
10 // These are all the same, as precedence collects it all before array_in.
11 ( foo -> baz in bar )
12 ( (foo) -> baz in bar )
13 ( (foo -> baz) in bar )
14
15
16 // You can override precedence with parentheses to apply trailing autocast
17 // operators to the array_in itself. Without the parentheses, "-> baz"
18 // should apply to the RHS "bar", but autocast isn't indexable, so that's a
19 // parse error. (see parseko/autocast03.stp)
20 ( (foo in bar) -> baz )
21 }
22