diff options
Diffstat (limited to 'test/prism/fixtures/arrays.txt')
-rw-r--r-- | test/prism/fixtures/arrays.txt | 122 |
1 files changed, 122 insertions, 0 deletions
diff --git a/test/prism/fixtures/arrays.txt b/test/prism/fixtures/arrays.txt new file mode 100644 index 0000000000..2897189518 --- /dev/null +++ b/test/prism/fixtures/arrays.txt @@ -0,0 +1,122 @@ +[*a] + +foo[bar, baz] = 1, 2, 3 + +[a: [:b, :c]] + + + +[:a, :b, +:c,1, + + + +:d, +] + + +[:a, :b, +:c,1, + + + +:d + + +] + +[foo => bar] + +foo[bar][baz] = qux + +foo[bar][baz] + +[ +] + +foo[bar, baz] + +foo[bar, baz] = qux + +foo[0], bar[0] = 1, 2 + +foo[bar[baz] = qux] + +foo[bar] + +foo[bar] = baz + +[**{}] + +[**kw] + +[1, **kw] + +[1, **kw, **{}, **kw] + +[ + foo => bar, +] + + +%i#one two three# + +%w#one two three# + +%x#one two three# + + +%i@one two three@ + +%w@one two three@ + +%x@one two three@ + + +%i{one two three} + +%w{one two three} + +%x{one two three} + +%w[\C:] + +foo[] += 1 + +foo[] ||= 1 + +foo[] &&= 1 + +foo.foo[] += 1 + +foo.foo[] ||= 1 + +foo.foo[] &&= 1 + +foo[bar] += 1 + +foo[bar] ||= 1 + +foo[bar] &&= 1 + +foo.foo[bar] += 1 + +foo.foo[bar] ||= 1 + +foo.foo[bar] &&= 1 + +def f(*); a[*]; end + +def f(*); a[1, *]; end + +def f(*); a[*] = 1; end + +def f(*); a[1, *] = 1; end + +def f(*); a[*] += 1; end + +def f(*); a[1, *] &&= 1; end + +def f(*); rescue => a[*]; end + +def f(*); rescue => a[1, *]; end |