diff options
author | fche <fche> | 2005-06-02 19:43:55 +0000 |
---|---|---|
committer | fche <fche> | 2005-06-02 19:43:55 +0000 |
commit | 69c68955b910a9f284fa25b9ebb30eff5c040e0b (patch) | |
tree | 3fa502458891d0b54150d678368f7a2dee18fa0f /testsuite/semko | |
parent | f37b5c92191dd81aad57ade2899a4999099a3e35 (diff) | |
download | systemtap-steved-69c68955b910a9f284fa25b9ebb30eff5c040e0b.tar.gz systemtap-steved-69c68955b910a9f284fa25b9ebb30eff5c040e0b.tar.xz systemtap-steved-69c68955b910a9f284fa25b9ebb30eff5c040e0b.zip |
2005-06-02 Frank Ch. Eigler <fche@redhat.com>
Parse foreach construct. Added fuller copyright notices throughout.
* staptree.h (foreach_loop): New tree node type.
* staptree.cxx: Print it, visit it, love it, leave it.
* parse.cxx: Parse it.
(parse_stmt_block): Don't require ";" separators between statements.
(parse_array_in): Use [] as index group operator instead of ().
* elaborate.cxx (visit_foreach_loop): New code.
* translate.cxx: Slightly tighten errorcount/actioncount handling.
* main.cxx: Accept "-" as script file name standing for stdin.
(visit_arrayindex): Switch to simpler set_arity call.
* configure.ac: Generate DATE macro.
* Makefile.in, configure, config.in: Regenerated.
* testsuite/*: New/updated tests for syntax changes, foreach ().
Diffstat (limited to 'testsuite/semko')
-rwxr-xr-x | testsuite/semko/eleven.stp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/testsuite/semko/eleven.stp b/testsuite/semko/eleven.stp new file mode 100755 index 00000000..34dfa225 --- /dev/null +++ b/testsuite/semko/eleven.stp @@ -0,0 +1,15 @@ +#! stap -p2 + +global arr,rra + +probe begin { + arr[0]="value" + rra["key"]=0 +} +probe end { + # confirm that typechecking works the same way for all array indexing + if (k in arr) { k.""; arr[k]+0 } + foreach (l in arr) { l.""; arr[l]+0 } + if (m in rra) { m+1; rra[m]."" } + foreach (n in rra) { n+0; rra[n]."" } +} |