mirror of
https://github.com/zeek/zeek.git
synced 2025-10-08 01:28:20 +00:00
stmt: Support iterating over vector values
I ran into wanting to iterate over just the values of a vector and wondering whether that could just work. This adds support for the following, where v will be value of vec[i]. local vec = vector("zero", "one", "two"); for ( i, v in vec ) print i, v;
This commit is contained in:
parent
0f8e675a49
commit
f334df3b79
4 changed files with 66 additions and 16 deletions
13
testing/btest/Baseline/language.vector-for-value/out
Normal file
13
testing/btest/Baseline/language.vector-for-value/out
Normal file
|
@ -0,0 +1,13 @@
|
|||
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
||||
0, zero
|
||||
1, one
|
||||
2, two
|
||||
4, four
|
||||
0, zero
|
||||
1, one
|
||||
2, two
|
||||
4, four
|
||||
zero
|
||||
one
|
||||
two
|
||||
four
|
Loading…
Add table
Add a link
Reference in a new issue