diff options
Diffstat (limited to 'test/prism/fixtures')
914 files changed, 6499 insertions, 0 deletions
diff --git a/test/prism/fixtures/alias.txt b/test/prism/fixtures/alias.txt new file mode 100644 index 0000000000..376dacd7cc --- /dev/null +++ b/test/prism/fixtures/alias.txt @@ -0,0 +1,23 @@ +alias :foo :bar + +alias %s[abc] %s[def] + +alias :'abc' :'def' + +alias :"abc#{1}" :'def' + +alias $a $' + +alias foo bar + +alias $foo $bar + +alias foo if + +alias foo <=> + +alias :== :eql? + +alias A B + +alias :A :B diff --git a/test/prism/fixtures/arithmetic.txt b/test/prism/fixtures/arithmetic.txt new file mode 100644 index 0000000000..b1e1267b95 --- /dev/null +++ b/test/prism/fixtures/arithmetic.txt @@ -0,0 +1,13 @@ +foo !bar + +-foo*bar + ++foo**bar + +foo ~bar + +foo << bar << baz + +-1**2 + +-1.zero? diff --git a/test/prism/fixtures/arrays.txt b/test/prism/fixtures/arrays.txt new file mode 100644 index 0000000000..057a73abf6 --- /dev/null +++ b/test/prism/fixtures/arrays.txt @@ -0,0 +1,82 @@ +[*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:] diff --git a/test/prism/fixtures/begin_ensure.txt b/test/prism/fixtures/begin_ensure.txt new file mode 100644 index 0000000000..6cfb627453 --- /dev/null +++ b/test/prism/fixtures/begin_ensure.txt @@ -0,0 +1,21 @@ +begin +a +ensure +b +end + +begin; a; ensure; b; end + +begin a + ensure b + end + +begin a; ensure b; end + +begin begin:s.l begin ensure Module.new do + begin + break + ensure Module.new do + end + end +end end end end diff --git a/test/prism/fixtures/begin_rescue.txt b/test/prism/fixtures/begin_rescue.txt new file mode 100644 index 0000000000..0a56fbef9f --- /dev/null +++ b/test/prism/fixtures/begin_rescue.txt @@ -0,0 +1,79 @@ +begin; a; rescue; b; else; c; end + +begin; a; rescue; b; else; c; ensure; d; end + +begin +a +end + +begin; a; end + +begin a + end + +begin a; end + +begin +a +rescue +b +rescue +c +rescue +d +end + +begin + a +rescue Exception => ex + b +rescue AnotherException, OneMoreException => ex + c +end + +begin + a +rescue Exception => ex + b +ensure + b +end + +%!abc! + +begin +a +rescue +b +end + +begin;a;rescue;b;end + +begin +a;rescue +b;end + +begin +a +rescue Exception +b +end + +begin +a +rescue Exception, CustomException +b +end + +begin + a +rescue Exception, CustomException => ex + b +end + +begin + a +rescue Exception => ex + b +end + diff --git a/test/prism/fixtures/blocks.txt b/test/prism/fixtures/blocks.txt new file mode 100644 index 0000000000..e33d95c150 --- /dev/null +++ b/test/prism/fixtures/blocks.txt @@ -0,0 +1,54 @@ +foo[bar] { baz } + +foo[bar] do +baz +end + +x.reduce(0) { |x, memo| memo += x } + +foo do end + +foo bar, (baz do end) + +foo bar do end + +foo bar baz do end + +foo do |a = b[1]| +end + +foo do +rescue +end + +foo do + bar do + baz do + end + end +end + +foo[bar] { baz } + +foo { |x, y = 2, z:| x } + +foo { |x| } + +fork = 1 +fork do |a| +end + +fork { |a| } + +C do +end + +C {} + +foo lambda { | + a: 1, + b: 2 + | +} + +foo do |bar,| end diff --git a/test/prism/fixtures/boolean_operators.txt b/test/prism/fixtures/boolean_operators.txt new file mode 100644 index 0000000000..dd0b9c9f01 --- /dev/null +++ b/test/prism/fixtures/boolean_operators.txt @@ -0,0 +1,5 @@ +a &&= b + +a += b + +a ||= b diff --git a/test/prism/fixtures/booleans.txt b/test/prism/fixtures/booleans.txt new file mode 100644 index 0000000000..d9417254b6 --- /dev/null +++ b/test/prism/fixtures/booleans.txt @@ -0,0 +1,3 @@ +false + +true diff --git a/test/prism/fixtures/break.txt b/test/prism/fixtures/break.txt new file mode 100644 index 0000000000..61859d8a8a --- /dev/null +++ b/test/prism/fixtures/break.txt @@ -0,0 +1,25 @@ +break + +break (1), (2), (3) + +break 1 + +break 1, 2, +3 + +break 1, 2, 3 + +break [1, 2, 3] + +break( + 1 + 2 +) + +break() + +break(1) + +foo { break 42 } == 42 + +foo { |a| break } == 42 diff --git a/test/prism/fixtures/case.txt b/test/prism/fixtures/case.txt new file mode 100644 index 0000000000..1b720bc5ac --- /dev/null +++ b/test/prism/fixtures/case.txt @@ -0,0 +1,32 @@ +case :hi +when :hi +end + +case true; when true; puts :hi; when false; puts :bye; end + +case; when *foo; end + +case :hi +when :hi +else +:b +end + +case this; when FooBar, BazBonk; end + +case +when foo == bar +end + +case +when a +else + # empty +end + +case type; + ;when :b; + ; else; + end + +case ;;;;;;;; when 1; end diff --git a/test/prism/fixtures/classes.txt b/test/prism/fixtures/classes.txt new file mode 100644 index 0000000000..056cb00e82 --- /dev/null +++ b/test/prism/fixtures/classes.txt @@ -0,0 +1,35 @@ +class A a = 1 end + +class A; ensure; end + +class A; rescue; else; ensure; end + +class A < B +a = 1 +end + +class << not foo +end + +class A; class << self; ensure; end; end + +class A; class << self; rescue; else; ensure; end; end + +class << foo.bar +end + +class << foo.bar;end + +class << self +end + +class << self;end + +class << self +1 + 2 +end + +class << self;1 + 2;end + +class A < B[1] +end diff --git a/test/prism/fixtures/comments.txt b/test/prism/fixtures/comments.txt new file mode 100644 index 0000000000..9bd853e927 --- /dev/null +++ b/test/prism/fixtures/comments.txt @@ -0,0 +1,24 @@ +a + # Comment +b + +c # Comment +d + +e +# Comment + .f + +g + # Comment +.h + +i # Comment +.j + +k # Comment + .l + +m + # Comment + &.n diff --git a/test/prism/fixtures/constants.txt b/test/prism/fixtures/constants.txt new file mode 100644 index 0000000000..d86f8d3402 --- /dev/null +++ b/test/prism/fixtures/constants.txt @@ -0,0 +1,184 @@ +A::B + +A::B::C + +a::B + +A::B = 1 + +A = 1 + +ABC + +Foo 1 + +Foo *bar + +Foo **bar + +Foo &bar + +Foo::Bar *baz + +Foo::Bar **baz + +Foo::Bar &baz + +::A::foo + +::A = 1 + +::A::B = 1 + +::A::B + +::A + +A::false + +A::B::true + +A::& + +A::` + +A::! + +A::!= + +A::^ + +A::== + +A::=== + +A::=~ + +A::> + +A::>= + +A::>> + +A::<< + +A::\ +# +C + +A::alias + +A::and + +A::begin + +A::BEGIN + +A::break + +A::class + +A::def + +A::defined + +A::do + +A::else + +A::elsif + +A::end + +A::END + +A::ensure + +A::false + +A::for + +A::if + +A::in + +A::next + +A::nil + +A::not + +A::or + +A::redo + +A::rescue + +A::retry + +A::return + +A::self + +A::super + +A::then + +A::true + +A::undef + +A::unless + +A::until + +A::when + +A::while + +A::yield + +A::__ENCODING__ + +A::__FILE__ + +A::__LINE__ + +A::< + +A::<=> + +A::<< + +A::- + +A::% + +A::%i + +A::%w + +A::%x + +A::%I + +A::%W + +A::| + +A::+ + +A::/ + +A::* + +A::** + +A::~ + +A::_:: +C + +A::_.. + +A::__END__ diff --git a/test/prism/fixtures/dash_heredocs.txt b/test/prism/fixtures/dash_heredocs.txt new file mode 100644 index 0000000000..3e663fae63 --- /dev/null +++ b/test/prism/fixtures/dash_heredocs.txt @@ -0,0 +1,63 @@ +<<-EOF + a +EOF + +<<-FIRST + <<-SECOND + a +FIRST + b +SECOND + +<<-`EOF` + a +#{b} +EOF + +<<-EOF #comment + a +EOF + +<<-EOF + a + b + EOF + +<<-"EOF" + a +#{b} +EOF + +<<-EOF + a +#{b} +EOF + +%#abc# + +<<-EOF + a + b +EOF + +<<-'' + + +<<-'EOF' + a #{1} +EOF + +<<-A + <<-B + a +A + b + #{2 + } +B + +<<-A + <<-B + a +A + b + #{ + 2} +B diff --git a/test/prism/fixtures/defined.txt b/test/prism/fixtures/defined.txt new file mode 100644 index 0000000000..9cf153a853 --- /dev/null +++ b/test/prism/fixtures/defined.txt @@ -0,0 +1,7 @@ +defined? 1 and defined? 2 + +defined?(x %= 2) + +defined?(foo and bar) + +defined? 1 diff --git a/test/prism/fixtures/dos_endings.txt b/test/prism/fixtures/dos_endings.txt new file mode 100644 index 0000000000..c105522fa1 --- /dev/null +++ b/test/prism/fixtures/dos_endings.txt @@ -0,0 +1,20 @@ +puts "hi"\
+ "there"
+
+%I{a\
+b}
+
+<<-E
+ 1 \
+ 2
+ 3
+E
+
+x = %
+
+
+
+a = foo(<<~EOF.chop)
+
+ baz
+ EOF
diff --git a/test/prism/fixtures/embdoc_no_newline_at_end.txt b/test/prism/fixtures/embdoc_no_newline_at_end.txt new file mode 100644 index 0000000000..7dc2e32d73 --- /dev/null +++ b/test/prism/fixtures/embdoc_no_newline_at_end.txt @@ -0,0 +1,2 @@ +=begin +=end
\ No newline at end of file diff --git a/test/prism/fixtures/endless_methods.txt b/test/prism/fixtures/endless_methods.txt new file mode 100644 index 0000000000..8c2f2a30cc --- /dev/null +++ b/test/prism/fixtures/endless_methods.txt @@ -0,0 +1,5 @@ +def foo = 1 + +def bar = A "" + +def method = 1 + 2 + 3 diff --git a/test/prism/fixtures/endless_range_in_conditional.txt b/test/prism/fixtures/endless_range_in_conditional.txt new file mode 100644 index 0000000000..6048008584 --- /dev/null +++ b/test/prism/fixtures/endless_range_in_conditional.txt @@ -0,0 +1,3 @@ +if 1..2 ; end +if ..1 ; end +if 1.. ; end diff --git a/test/prism/fixtures/for.txt b/test/prism/fixtures/for.txt new file mode 100644 index 0000000000..b6eb2cb24f --- /dev/null +++ b/test/prism/fixtures/for.txt @@ -0,0 +1,19 @@ +for i in 1..10 +i +end + +for i in 1..10; i; end + +for i,j in 1..10 +i +end + +for i,j,k in 1..10 +i +end + +for i in 1..10 do +i +end + +for i in 1..10; i; end diff --git a/test/prism/fixtures/global_variables.txt b/test/prism/fixtures/global_variables.txt new file mode 100644 index 0000000000..3dc52722a0 --- /dev/null +++ b/test/prism/fixtures/global_variables.txt @@ -0,0 +1,93 @@ +$global_variable + +$_ + +$-w + +$LOAD_PATH + +$stdin + +$stdout + +$stderr + +$! + +$? + +$~ + +$& + +$` + +$' + +$+ + +$: + +$; + +$, + +$DEBUG + +$FILENAME + +$0 + +$-0 + +$LOADED_FEATURES + +$VERBOSE + +$-K + +:$global_variable + +:$_ + +:$-w + +:$LOAD_PATH + +:$stdin + +:$stdout + +:$stderr + +:$! + +:$? + +:$~ + +:$& + +:$` + +:$' + +:$+ + +:$: + +:$; + +:$DEBUG + +:$FILENAME + +:$0 + +:$-0 + +:$LOADED_FEATURES + +:$VERBOSE + +:$-K diff --git a/test/prism/fixtures/hashes.txt b/test/prism/fixtures/hashes.txt new file mode 100644 index 0000000000..443b2359c6 --- /dev/null +++ b/test/prism/fixtures/hashes.txt @@ -0,0 +1,26 @@ +{} + +{ +} + +{ a => b, c => d } + +{ a => b, **c } + +{ + a: b, + c: d + + + + } + +{ a: b, c: d, **e, f: g } + +{ "a": !b? } + +a = 1 +tap do + b = 1 + { a:, b:, c:, D: } +end diff --git a/test/prism/fixtures/heredoc_with_escaped_newline_at_start.txt b/test/prism/fixtures/heredoc_with_escaped_newline_at_start.txt new file mode 100644 index 0000000000..81f314e0b3 --- /dev/null +++ b/test/prism/fixtures/heredoc_with_escaped_newline_at_start.txt @@ -0,0 +1,7 @@ +<<-TARGET.gsub /^\s{/, ''\ +TARGET + +
+<<-TARGET.gsub /^\s{/, ''\
+TARGET
+
diff --git a/test/prism/fixtures/heredoc_with_trailing_newline.txt b/test/prism/fixtures/heredoc_with_trailing_newline.txt new file mode 100644 index 0000000000..13771bf3ac --- /dev/null +++ b/test/prism/fixtures/heredoc_with_trailing_newline.txt @@ -0,0 +1,2 @@ +<<-END +END
\ No newline at end of file diff --git a/test/prism/fixtures/heredocs_nested.txt b/test/prism/fixtures/heredocs_nested.txt new file mode 100644 index 0000000000..eef7206d69 --- /dev/null +++ b/test/prism/fixtures/heredocs_nested.txt @@ -0,0 +1,9 @@ +<<~RUBY +pre +#{ +<<RUBY + hello +RUBY +} +post +RUBY diff --git a/test/prism/fixtures/heredocs_with_ignored_newlines.txt b/test/prism/fixtures/heredocs_with_ignored_newlines.txt new file mode 100644 index 0000000000..8e12546ec7 --- /dev/null +++ b/test/prism/fixtures/heredocs_with_ignored_newlines.txt @@ -0,0 +1,14 @@ +<<-HERE\ +HERE + +<<~THERE\ + way over + <<HERE + not here + HERE + + <<~BUT\ + but + BUT + there +THERE diff --git a/test/prism/fixtures/heredocs_with_ignored_newlines_and_non_empty.txt b/test/prism/fixtures/heredocs_with_ignored_newlines_and_non_empty.txt new file mode 100644 index 0000000000..aeacbd8126 --- /dev/null +++ b/test/prism/fixtures/heredocs_with_ignored_newlines_and_non_empty.txt @@ -0,0 +1,4 @@ +<<-EOE + some + heredocs +EOE
\ No newline at end of file diff --git a/test/prism/fixtures/if.txt b/test/prism/fixtures/if.txt new file mode 100644 index 0000000000..c5281a6693 --- /dev/null +++ b/test/prism/fixtures/if.txt @@ -0,0 +1,42 @@ +if true; 1; end + +if true +1 else 2 end + +if true then true elsif false then false elsif nil then nil else self end + +1 if true + +break if true + +next if true + +return if true + +if exit_loop then break 42 end + +if foo +then bar +end + +a if b if c + +if true + a b: +else +end + +if type in 1 +elsif type in B +end + +if 1 + lambda do |_| + end +elsif 2 + lambda do |_| + end +else + lambda do |_| + end +end diff --git a/test/prism/fixtures/indented_file_end.txt b/test/prism/fixtures/indented_file_end.txt new file mode 100644 index 0000000000..5a96dcacf7 --- /dev/null +++ b/test/prism/fixtures/indented_file_end.txt @@ -0,0 +1,4 @@ + def hi + + end # hi there +
\ No newline at end of file diff --git a/test/prism/fixtures/integer_operations.txt b/test/prism/fixtures/integer_operations.txt new file mode 100644 index 0000000000..37163acf30 --- /dev/null +++ b/test/prism/fixtures/integer_operations.txt @@ -0,0 +1,63 @@ +!1 + +~1 + +1 != 2 + +1 !~ 2 + +1 % 2 + +1 & 2 + +1 * 2 + +1**2 + +1 + 2 + +1 - 2 + +1 / 2 + +1/2/3 + +1 < 2 + +1 << 2 + +1 <= 2 + +1 <=> 2 + +1 == 2 + +1 === 2 + +1 =~ 2 + +1 > 2 + +1 >= 2 + +1 >> 2 + +1 ^ 2 + +1 | 2 + +1 && 2 + +1 and 2 + +1 * 2 ** 3 + +1 * 2 + 3 + +1 or 2 + +1 || 2 + +1 + 2 * 3 + +(1 + 1) diff --git a/test/prism/fixtures/keyword_method_names.txt b/test/prism/fixtures/keyword_method_names.txt new file mode 100644 index 0000000000..9154469441 --- /dev/null +++ b/test/prism/fixtures/keyword_method_names.txt @@ -0,0 +1,29 @@ +def def +end + +def self.ensure +end + +private def foo + bar do + end +end + +def m(a, **nil) +end + +def __ENCODING__.a +end + +%{abc} + +%"abc" + +def __FILE__.a +end + +def __LINE__.a +end + +def nil::a +end diff --git a/test/prism/fixtures/keywords.txt b/test/prism/fixtures/keywords.txt new file mode 100644 index 0000000000..90cdfb41c7 --- /dev/null +++ b/test/prism/fixtures/keywords.txt @@ -0,0 +1,11 @@ +redo + +retry + +self + +__ENCODING__ + +__FILE__ + +__LINE__ diff --git a/test/prism/fixtures/lambda.txt b/test/prism/fixtures/lambda.txt new file mode 100644 index 0000000000..5c21eafb24 --- /dev/null +++ b/test/prism/fixtures/lambda.txt @@ -0,0 +1,11 @@ +->( + foo +) {} + +->(x: "b#{a}") { } + +->(a: b * 3) {} + +-> foo = bar do end + +-> foo: bar do end diff --git a/test/prism/fixtures/method_calls.txt b/test/prism/fixtures/method_calls.txt new file mode 100644 index 0000000000..5d82abef2e --- /dev/null +++ b/test/prism/fixtures/method_calls.txt @@ -0,0 +1,147 @@ +foo.bar %{baz} + +a.b(c, d) + +a.b() + +foo + .bar + &.baz + +a! + +a.() + +a.(1, 2, 3) + +a::b + +a::b c + +foo.bar = 1 + +a? + +a(&block) + +a(**kwargs) + +a.b.c + +a(b, c) + +a() + +a(*args) + +a b, c + +a.b c, d + +foo.foo, bar.bar = 1, 2 + +a&.b + +a&.() + +a&.b(c) + +a&.b() + +foo :a, :b if bar? or baz and qux + +foo(:a, + + :b +) + +foo(*rest) + +foo(:a, :h => [:x, :y], :a => :b, &:bar) + +hi 123, { :there => :friend, **{}, whatup: :dog } + +foo :a, b: true do |a, b| puts a end + +hi there: :friend + +hi :there => :friend, **{}, whatup: :dog + +hi(:there => :friend, **{}, whatup: :dog) + +foo({ a: true, b: false, }, &:block) + +hi :there => :friend + +foo(:a, +:b, +) + +foo( +:a, +b: :c, +) + +foo &:block + +foo a: true, b: false, &:block + +some_func 1, kwarg: 2 + +Kernel.Integer(10) + +x.each { } + +foo.map { $& } + +A::B::C :foo + +A::B::C(:foo) + +A::B::C(:foo) { } + +foo("a": -1) + +foo bar: { baz: qux do end } + +foo bar: { **kw do end } + +foo "#{bar.map do "baz" end}" do end + +foo class Bar baz do end end + +foo module Bar baz do end end + +foo [baz do end] + +p begin 1.times do 1 end end + +foo :a, + if x + bar do |a| + a + end + end + +foo :a, + while x + bar do |a| + a + end + end, + until x + baz do + end + end + +{} + A {} + +{} + A { |a| a } + +A {} + A {} + +lst << A {} + +"#{ join (" ") }" + +"#{(v)}" diff --git a/test/prism/fixtures/methods.txt b/test/prism/fixtures/methods.txt new file mode 100644 index 0000000000..ac561363f8 --- /dev/null +++ b/test/prism/fixtures/methods.txt @@ -0,0 +1,168 @@ +def foo((bar, baz)) +end + +def foo((bar, baz), optional = 1, (bin, bag)) +end + + +def a; ensure; end + +def (b).a +end + +def (a)::b +end + +def false.a +end + +def a(...) +end + +def $var.a +end + +def a.b +end + +def @var.a +end + +def a b:; end + +%,abc, + +def a(b:) +end + +def a(**b) +end + +def a(**) +end + +a = 1; def a +end + +def a b, c, d +end + +def nil.a +end + +def a b:, c: 1 +end + +def a(b:, c: 1) +end + +def a(b: + 1, c:) +end + +%.abc. + +def a b = 1, c = 2 +end + +def a() +end + +def a b, c = 2 +end + +def a b +end + +def a; rescue; else; ensure; end + +def a *b +end + +def a(*) +end + +def a +b = 1 +end + +def self.a +end + +def true.a +end + +def a +end + +def hi +return :hi if true +:bye +end + +def foo = 1 +def bar = 2 + +def foo(bar) = 123 + +def foo = 123 + +def a(*); b(*); end + +def a(...); b(...); end + +def a(...); b(1, 2, ...); end + +def (c = b).a +end + +def a &b +end + +def a(&) +end + +def @@var.a +end + +def (a = b).C +end + +def self.Array_function; end + +Const = 1; def Const.a +end + +def a(...); "foo#{b(...)}"; end + +def foo + {}.merge **bar, **baz, **qux +end + +def bar(a: (1...10)) +end + +def bar(a: (...10)) +end + +def bar(a: (1...)) +end + +def bar(a = (1...10)) +end + +def bar(a = (...10)) +end + +def bar(a = (1...)) +end + +def method(a) + item >> a {} +end + +def foo(_a, _a, b, c) +end + +foo = 1 +def foo.bar; end diff --git a/test/prism/fixtures/modules.txt b/test/prism/fixtures/modules.txt new file mode 100644 index 0000000000..76bd9bea43 --- /dev/null +++ b/test/prism/fixtures/modules.txt @@ -0,0 +1,18 @@ +module A a = 1 end + +%Q{aaa #{bbb} ccc} + +module m::M +end + +module A + x = 1; rescue; end + +module ::A +end + +module A[]::B +end + +module A[1]::B +end diff --git a/test/prism/fixtures/newline_terminated.txt b/test/prism/fixtures/newline_terminated.txt Binary files differnew file mode 100644 index 0000000000..12f3bda229 --- /dev/null +++ b/test/prism/fixtures/newline_terminated.txt diff --git a/test/prism/fixtures/next.txt b/test/prism/fixtures/next.txt new file mode 100644 index 0000000000..476f17ffe3 --- /dev/null +++ b/test/prism/fixtures/next.txt @@ -0,0 +1,24 @@ +next + +next (1), (2), (3) + +next 1 + +next 1, 2, +3 + +next 1, 2, 3 + +next [1, 2, 3] + +next( + 1 + 2 +) + +next +1 + +next() + +next(1) diff --git a/test/prism/fixtures/nils.txt b/test/prism/fixtures/nils.txt new file mode 100644 index 0000000000..8084db2534 --- /dev/null +++ b/test/prism/fixtures/nils.txt @@ -0,0 +1,13 @@ +nil + +() + +( +; +; +) + +END { 1 } + +BEGIN { 1 } + diff --git a/test/prism/fixtures/non_alphanumeric_methods.txt b/test/prism/fixtures/non_alphanumeric_methods.txt new file mode 100644 index 0000000000..1da3fd852b --- /dev/null +++ b/test/prism/fixtures/non_alphanumeric_methods.txt @@ -0,0 +1,105 @@ +def ! +end + +def != +end + +def !~ +end + +def % +end + +def self.+ +end + +def & +end + +def * +end + +def ** +end + +%|abc| + +def + **b +end + +def +() +end + +def + b +end + +def self.+ +end + +def + +end + +def +@ +end + +def - +end + +def a.-;end + +def -@ +end + +def / +end + +def < +end + +def << +end + +def <= +end + +def <=> +end + +def == +end + +def === +end + +def =~ +end + +def > +end + +def >= +end + +def >> +end + +def [] +end + +def []= +end + +def ^ +end + +def ` +end + +def self.` +end + +def | +end + +def ~ +end diff --git a/test/prism/fixtures/not.txt b/test/prism/fixtures/not.txt new file mode 100644 index 0000000000..520b34fa37 --- /dev/null +++ b/test/prism/fixtures/not.txt @@ -0,0 +1,37 @@ +not foo and not bar + +not(foo and bar) + +not foo + +not foo and not + bar + + +not foo and + not + bar + + +not foo and + not + + + bar + +not(foo + + +) + +not( + + +foo + + + ) + +not foo .. bar + +not (foo .. bar) diff --git a/test/prism/fixtures/numbers.txt b/test/prism/fixtures/numbers.txt new file mode 100644 index 0000000000..3c8bf07805 --- /dev/null +++ b/test/prism/fixtures/numbers.txt @@ -0,0 +1,63 @@ +0 + +1 + +1.0 + +2 + +0b0 + +0b1 + +0b10 + +0d0 + +0d1 + +0d2 + +00 + +01 + +02 + +0o0 + +0o1 + +0o2 + +0x0 + +0x1 + +0x2 + +1i + +1r + +-1 + +1ri + +1.2ri + +-1ri + +-1.2ri + +0o1r + +0o1i + +0o1ri + +0d1r + +0d1i + +0b1ri diff --git a/test/prism/fixtures/patterns.txt b/test/prism/fixtures/patterns.txt new file mode 100644 index 0000000000..e0c5f303cb --- /dev/null +++ b/test/prism/fixtures/patterns.txt @@ -0,0 +1,192 @@ +foo => bar +foo => 1 +foo => 1.0 +foo => 1i +foo => 1r +foo => :foo +foo => %s[foo] +foo => :"foo" +foo => /foo/ +foo => `foo` +foo => %x[foo] +foo => %i[foo] +foo => %I[foo] +foo => %w[foo] +foo => %W[foo] +foo => %q[foo] +foo => %Q[foo] +foo => "foo" +foo => nil +foo => self +foo => true +foo => false +foo => __FILE__ +foo => __LINE__ +foo => __ENCODING__ +foo => -> { bar } + +foo => 1 .. 1 +foo => 1.0 .. 1.0 +foo => 1i .. 1i +foo => 1r .. 1r +foo => :foo .. :foo +foo => %s[foo] .. %s[foo] +foo => :"foo" .. :"foo" +foo => /foo/ .. /foo/ +foo => `foo` .. `foo` +foo => %x[foo] .. %x[foo] +foo => %i[foo] .. %i[foo] +foo => %I[foo] .. %I[foo] +foo => %w[foo] .. %w[foo] +foo => %W[foo] .. %W[foo] +foo => %q[foo] .. %q[foo] +foo => %Q[foo] .. %Q[foo] +foo => "foo" .. "foo" +foo => nil .. nil +foo => self .. self +foo => true .. true +foo => false .. false +foo => __FILE__ .. __FILE__ +foo => __LINE__ .. __LINE__ +foo => __ENCODING__ .. __ENCODING__ +foo => -> { bar } .. -> { bar } + +foo => ^bar +foo => ^@bar +foo => ^@@bar +foo => ^$bar + +foo => ^(1) +foo => ^(nil) +foo => ^("bar" + "baz") + +foo => Foo +foo => Foo::Bar::Baz +foo => ::Foo +foo => ::Foo::Bar::Baz + +foo => Foo() +foo => Foo(1) +foo => Foo(1, 2, 3) +foo => Foo(bar) +foo => Foo(*bar, baz) +foo => Foo(bar, *baz) +foo => Foo(*bar, baz, *qux) + +foo => Foo[] +foo => Foo[1] +foo => Foo[1, 2, 3] +foo => Foo[Foo[]] +foo => Foo[bar] +foo => Foo[*bar, baz] +foo => Foo[bar, *baz] +foo => Foo[*bar, baz, *qux] + +foo => *bar +foo => *bar, baz, qux +foo => bar, *baz, qux +foo => bar, baz, *qux +foo => *bar, baz, *qux + +foo => [] +foo => [[[[[]]]]] + +foo => [*bar] +foo => [*bar, baz, qux] +foo => [bar, *baz, qux] +foo => [bar, baz, *qux] +foo => [*bar, baz, *qux] + +foo in bar +foo in 1 +foo in 1.0 +foo in 1i +foo in 1r +foo in :foo +foo in %s[foo] +foo in :"foo" +foo in /foo/ +foo in `foo` +foo in %x[foo] +foo in %i[foo] +foo in %I[foo] +foo in %w[foo] +foo in %W[foo] +foo in %q[foo] +foo in %Q[foo] +foo in "foo" +foo in nil +foo in self +foo in true +foo in false +foo in __FILE__ +foo in __LINE__ +foo in __ENCODING__ +foo in -> { bar } + +case foo; in bar then end +case foo; in 1 then end +case foo; in 1.0 then end +case foo; in 1i then end +case foo; in 1r then end +case foo; in :foo then end +case foo; in %s[foo] then end +case foo; in :"foo" then end +case foo; in /foo/ then end +case foo; in `foo` then end +case foo; in %x[foo] then end +case foo; in %i[foo] then end +case foo; in %I[foo] then end +case foo; in %w[foo] then end +case foo; in %W[foo] then end +case foo; in %q[foo] then end +case foo; in %Q[foo] then end +case foo; in "foo" then end +case foo; in nil then end +case foo; in self then end +case foo; in true then end +case foo; in false then end +case foo; in __FILE__ then end +case foo; in __LINE__ then end +case foo; in __ENCODING__ then end +case foo; in -> { bar } then end + +case foo; in bar if baz then end +case foo; in 1 if baz then end +case foo; in 1.0 if baz then end +case foo; in 1i if baz then end +case foo; in 1r if baz then end +case foo; in :foo if baz then end +case foo; in %s[foo] if baz then end +case foo; in :"foo" if baz then end +case foo; in /foo/ if baz then end +case foo; in `foo` if baz then end +case foo; in %x[foo] if baz then end +case foo; in %i[foo] if baz then end +case foo; in %I[foo] if baz then end +case foo; in %w[foo] if baz then end +case foo; in %W[foo] if baz then end +case foo; in %q[foo] if baz then end +case foo; in %Q[foo] if baz then end +case foo; in "foo" if baz then end +case foo; in nil if baz then end +case foo; in self if baz then end +case foo; in true if baz then end +case foo; in false if baz then end +case foo; in __FILE__ if baz then end +case foo; in __LINE__ if baz then end +case foo; in __ENCODING__ if baz then end +case foo; in -> { bar } if baz then end + +if a in [] +end + +a => [ + b +] + +foo in A[ + bar: B[ + value: a + ] +] diff --git a/test/prism/fixtures/procs.txt b/test/prism/fixtures/procs.txt new file mode 100644 index 0000000000..7ffb11e78a --- /dev/null +++ b/test/prism/fixtures/procs.txt @@ -0,0 +1,27 @@ +-> (a; b, c, d) { b } + +-> do +ensure +end + +-> do +rescue +else +ensure +end + +-> { foo } + +-> do; foo; end + +-> a, b = 1, c:, d:, &e { a } + +-> (a, b = 1, *c, d:, e:, **f, &g) { a } + +-> (a, b = 1, *c, d:, e:, **f, &g) do + a +end + +-> (a) { -> b { a * b } } + +-> ((a, b), *c) { } diff --git a/test/prism/fixtures/range_begin_open_exclusive.txt b/test/prism/fixtures/range_begin_open_exclusive.txt new file mode 100644 index 0000000000..3b12672b4f --- /dev/null +++ b/test/prism/fixtures/range_begin_open_exclusive.txt @@ -0,0 +1 @@ +...2 diff --git a/test/prism/fixtures/range_begin_open_inclusive.txt b/test/prism/fixtures/range_begin_open_inclusive.txt new file mode 100644 index 0000000000..052f45900b --- /dev/null +++ b/test/prism/fixtures/range_begin_open_inclusive.txt @@ -0,0 +1 @@ +..2 diff --git a/test/prism/fixtures/range_end_open_exclusive.txt b/test/prism/fixtures/range_end_open_exclusive.txt new file mode 100644 index 0000000000..2ffd68afdb --- /dev/null +++ b/test/prism/fixtures/range_end_open_exclusive.txt @@ -0,0 +1 @@ +2... diff --git a/test/prism/fixtures/range_end_open_inclusive.txt b/test/prism/fixtures/range_end_open_inclusive.txt new file mode 100644 index 0000000000..48445391f6 --- /dev/null +++ b/test/prism/fixtures/range_end_open_inclusive.txt @@ -0,0 +1 @@ +2.. diff --git a/test/prism/fixtures/ranges.txt b/test/prism/fixtures/ranges.txt new file mode 100644 index 0000000000..55c0ade965 --- /dev/null +++ b/test/prism/fixtures/ranges.txt @@ -0,0 +1,17 @@ +(...2) + +(..2) + +1...2 + +foo[...2] + +{ foo: ...bar } + +(1...) + +1..2 + +{ foo: ..bar } + +(1..) diff --git a/test/prism/fixtures/regex.txt b/test/prism/fixtures/regex.txt new file mode 100644 index 0000000000..1e917e7de7 --- /dev/null +++ b/test/prism/fixtures/regex.txt @@ -0,0 +1,30 @@ +foo /bar/ + +%r{abc}i + +/a\b/ + +/aaa #$bbb/ + +/aaa #{bbb} ccc/ + +[/(?<foo>bar)/ =~ baz, foo] + +/abc/i + +%r/[a-z$._?][\w$.?#@~]*:/i + +%r/([a-z$._?][\w$.?#@~]*)(\s+)(equ)/i + +%r/[a-z$._?][\w$.?#@~]*/i + +%r( +(?:[\w#$%_']|\(\)|\(,\)|\[\]|[0-9])* + (?:[\w#$%_']+) +) + +/(?#\))/ =~ "hi" + +%r#pound# + +/aaa #{bbb}/o diff --git a/test/prism/fixtures/rescue.txt b/test/prism/fixtures/rescue.txt new file mode 100644 index 0000000000..0d26fd2523 --- /dev/null +++ b/test/prism/fixtures/rescue.txt @@ -0,0 +1,31 @@ +foo rescue nil + +foo rescue +nil + +break rescue nil + +next rescue nil + +return rescue nil + +foo rescue nil || 1 + +foo rescue nil ? 1 : 2 + +begin; a; rescue *b; end + +foo do |x| + bar(y) rescue ArgumentError fail "baz" +end + +if a = foo rescue nil + bar +end + +def some_method = other_method 42 rescue nil + +def a + a b: +rescue +end diff --git a/test/prism/fixtures/return.txt b/test/prism/fixtures/return.txt new file mode 100644 index 0000000000..a8b5b95fab --- /dev/null +++ b/test/prism/fixtures/return.txt @@ -0,0 +1,24 @@ +return + +return (1), (2), (3) + +return *1 + +return 1 + +return 1, 2, +3 + +return 1, 2, 3 + +return [1, 2, 3] + +return( + 1 + 2 +) + +return() + +return(1) + diff --git a/test/prism/fixtures/seattlerb/BEGIN.txt b/test/prism/fixtures/seattlerb/BEGIN.txt new file mode 100644 index 0000000000..bed5755901 --- /dev/null +++ b/test/prism/fixtures/seattlerb/BEGIN.txt @@ -0,0 +1 @@ +BEGIN { 42 } diff --git a/test/prism/fixtures/seattlerb/README.rdoc b/test/prism/fixtures/seattlerb/README.rdoc new file mode 100644 index 0000000000..649e4e4c2f --- /dev/null +++ b/test/prism/fixtures/seattlerb/README.rdoc @@ -0,0 +1,113 @@ += ruby_parser + +home :: https://github.com/seattlerb/ruby_parser +bugs :: https://github.com/seattlerb/ruby_parser/issues +rdoc :: http://docs.seattlerb.org/ruby_parser + +== DESCRIPTION: + +ruby_parser (RP) is a ruby parser written in pure ruby (utilizing +racc--which does by default use a C extension). It outputs +s-expressions which can be manipulated and converted back to ruby via +the ruby2ruby gem. + +As an example: + + def conditional1 arg1 + return 1 if arg1 == 0 + return 0 + end + +becomes: + + s(:defn, :conditional1, s(:args, :arg1), + s(:if, + s(:call, s(:lvar, :arg1), :==, s(:lit, 0)), + s(:return, s(:lit, 1)), + nil), + s(:return, s(:lit, 0))) + +Tested against 801,039 files from the latest of all rubygems (as of 2013-05): + +* 1.8 parser is at 99.9739% accuracy, 3.651 sigma +* 1.9 parser is at 99.9940% accuracy, 4.013 sigma +* 2.0 parser is at 99.9939% accuracy, 4.008 sigma +* 2.6 parser is at 99.9972% accuracy, 4.191 sigma +* 3.0 parser has a 100% parse rate. + * Tested against 2,672,412 unique ruby files across 167k gems. + * As do all the others now, basically. + +== FEATURES/PROBLEMS: + +* Pure ruby, no compiles. +* Includes preceding comment data for defn/defs/class/module nodes! +* Incredibly simple interface. +* Output is 100% equivalent to ParseTree. + * Can utilize PT's SexpProcessor and UnifiedRuby for language processing. +* Known Issue: Speed is now pretty good, but can always improve: + * RP parses a corpus of 3702 files in 125s (avg 108 Kb/s) + * MRI+PT parsed the same in 67.38s (avg 200.89 Kb/s) +* Known Issue: Code is much better, but still has a long way to go. +* Known Issue: Totally awesome. +* Known Issue: line number values can be slightly off. Parsing LR sucks. + +== SYNOPSIS: + + RubyParser.new.parse "1+1" + # => s(:call, s(:lit, 1), :+, s(:lit, 1)) + +You can also use Ruby19Parser, Ruby18Parser, or RubyParser.for_current_ruby: + + RubyParser.for_current_ruby.parse "1+1" + # => s(:call, s(:lit, 1), :+, s(:lit, 1)) + +== DEVELOPER NOTES: + +To add a new version: + +* New parser should be generated from lib/ruby[3]_parser.yy. +* Extend lib/ruby[3]_parser.yy with new class name. +* Add new version number to V2/V3 in Rakefile for rule creation. +* Add new `ruby_parse "x.y.z"` line to Rakefile for rake compare (line ~300). +* Require generated parser in lib/ruby_parser.rb. +* Add new V## = ::Ruby##Parser; end to ruby_parser.rb (bottom of file). +* Add empty TestRubyParserShared##Plus module and TestRubyParserV## to test/test_ruby_parser.rb. +* Extend Manifest.txt with generated file names. +* Add new version number to sexp_processor's pt_testcase.rb in all_versions + +Until all of these are done, you won't have a clean test run. + +== REQUIREMENTS: + +* ruby. woot. +* sexp_processor for Sexp and SexpProcessor classes, and testing. +* racc full package for parser development (compiling .y to .rb). + +== INSTALL: + +* sudo gem install ruby_parser + +== LICENSE: + +(The MIT License) + +Copyright (c) Ryan Davis, seattle.rb + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/test/prism/fixtures/seattlerb/TestRubyParserShared.txt b/test/prism/fixtures/seattlerb/TestRubyParserShared.txt new file mode 100644 index 0000000000..c55b3e1f70 --- /dev/null +++ b/test/prism/fixtures/seattlerb/TestRubyParserShared.txt @@ -0,0 +1,92 @@ +%I[ + + +] + +%I[ +line2 +line3 +] + +%W[ + + +] + +%W[ +line2 +line3 +] + +%i[ + + +] + +%i[ +line2 +line3 +] + +%r[ + + +] + +%w[ + + +] + +%w[ +line2 +line3 +] + +[ +:line2, +:line3 +] + +class X # line 1 + def self.y(a, # line 2 + b) # line 3 + a + b # line 4 + end # line 5 +end # line 6 + + +class X # line 1 + class Y # line 2 + Z = 42 # line 3 + end # line 4 +end # line 5 + + +class X # line 1 + def y(a, # line 2 + b) # line 3 + a + b # line 4 + end # line 5 +end # line 6 + + +module X + X = [ + :line3, + :line4, + ] +end + + +module X # line 1 + module Y # line 2 + Z = 42 # line 3 + end # line 4 +end # line 5 + + +x( +:line2, +:line3 +) diff --git a/test/prism/fixtures/seattlerb/__ENCODING__.txt b/test/prism/fixtures/seattlerb/__ENCODING__.txt new file mode 100644 index 0000000000..d6debf2f92 --- /dev/null +++ b/test/prism/fixtures/seattlerb/__ENCODING__.txt @@ -0,0 +1 @@ +__ENCODING__ diff --git a/test/prism/fixtures/seattlerb/alias_gvar_backref.txt b/test/prism/fixtures/seattlerb/alias_gvar_backref.txt new file mode 100644 index 0000000000..016bd94fe0 --- /dev/null +++ b/test/prism/fixtures/seattlerb/alias_gvar_backref.txt @@ -0,0 +1 @@ +alias $MATCH $& diff --git a/test/prism/fixtures/seattlerb/alias_resword.txt b/test/prism/fixtures/seattlerb/alias_resword.txt new file mode 100644 index 0000000000..63e782614b --- /dev/null +++ b/test/prism/fixtures/seattlerb/alias_resword.txt @@ -0,0 +1 @@ +alias in out diff --git a/test/prism/fixtures/seattlerb/and_multi.txt b/test/prism/fixtures/seattlerb/and_multi.txt new file mode 100644 index 0000000000..8902086cac --- /dev/null +++ b/test/prism/fixtures/seattlerb/and_multi.txt @@ -0,0 +1,3 @@ +true and +not false and +true diff --git a/test/prism/fixtures/seattlerb/aref_args_assocs.txt b/test/prism/fixtures/seattlerb/aref_args_assocs.txt new file mode 100644 index 0000000000..3244eebafc --- /dev/null +++ b/test/prism/fixtures/seattlerb/aref_args_assocs.txt @@ -0,0 +1 @@ +[1 => 2] diff --git a/test/prism/fixtures/seattlerb/aref_args_lit_assocs.txt b/test/prism/fixtures/seattlerb/aref_args_lit_assocs.txt new file mode 100644 index 0000000000..0b6ffa7e2c --- /dev/null +++ b/test/prism/fixtures/seattlerb/aref_args_lit_assocs.txt @@ -0,0 +1 @@ +[1, 2 => 3] diff --git a/test/prism/fixtures/seattlerb/args_kw_block.txt b/test/prism/fixtures/seattlerb/args_kw_block.txt new file mode 100644 index 0000000000..cb6ab39852 --- /dev/null +++ b/test/prism/fixtures/seattlerb/args_kw_block.txt @@ -0,0 +1 @@ +def f(a: 1, &b); end diff --git a/test/prism/fixtures/seattlerb/array_line_breaks.txt b/test/prism/fixtures/seattlerb/array_line_breaks.txt new file mode 100644 index 0000000000..be9f2d9cb8 --- /dev/null +++ b/test/prism/fixtures/seattlerb/array_line_breaks.txt @@ -0,0 +1,4 @@ +[ +'a', +'b'] +1 diff --git a/test/prism/fixtures/seattlerb/array_lits_trailing_calls.txt b/test/prism/fixtures/seattlerb/array_lits_trailing_calls.txt new file mode 100644 index 0000000000..868384a407 --- /dev/null +++ b/test/prism/fixtures/seattlerb/array_lits_trailing_calls.txt @@ -0,0 +1,3 @@ +%w[].b + +[].b diff --git a/test/prism/fixtures/seattlerb/assoc__bare.txt b/test/prism/fixtures/seattlerb/assoc__bare.txt new file mode 100644 index 0000000000..96c2940f31 --- /dev/null +++ b/test/prism/fixtures/seattlerb/assoc__bare.txt @@ -0,0 +1 @@ +{ y: } diff --git a/test/prism/fixtures/seattlerb/assoc_label.txt b/test/prism/fixtures/seattlerb/assoc_label.txt new file mode 100644 index 0000000000..372dc75031 --- /dev/null +++ b/test/prism/fixtures/seattlerb/assoc_label.txt @@ -0,0 +1 @@ +a(b:1) diff --git a/test/prism/fixtures/seattlerb/attr_asgn_colon_id.txt b/test/prism/fixtures/seattlerb/attr_asgn_colon_id.txt new file mode 100644 index 0000000000..f63c2f5dcb --- /dev/null +++ b/test/prism/fixtures/seattlerb/attr_asgn_colon_id.txt @@ -0,0 +1 @@ +A::b = 1 diff --git a/test/prism/fixtures/seattlerb/attrasgn_array_arg.txt b/test/prism/fixtures/seattlerb/attrasgn_array_arg.txt new file mode 100644 index 0000000000..db9e2db063 --- /dev/null +++ b/test/prism/fixtures/seattlerb/attrasgn_array_arg.txt @@ -0,0 +1 @@ +a[[1, 2]] = 3 diff --git a/test/prism/fixtures/seattlerb/attrasgn_array_lhs.txt b/test/prism/fixtures/seattlerb/attrasgn_array_lhs.txt new file mode 100644 index 0000000000..0b8e31632d --- /dev/null +++ b/test/prism/fixtures/seattlerb/attrasgn_array_lhs.txt @@ -0,0 +1 @@ +[1, 2, 3, 4][from .. to] = ["a", "b", "c"] diff --git a/test/prism/fixtures/seattlerb/attrasgn_primary_dot_constant.txt b/test/prism/fixtures/seattlerb/attrasgn_primary_dot_constant.txt new file mode 100644 index 0000000000..380a718963 --- /dev/null +++ b/test/prism/fixtures/seattlerb/attrasgn_primary_dot_constant.txt @@ -0,0 +1 @@ +a.B = 1 diff --git a/test/prism/fixtures/seattlerb/backticks_interpolation_line.txt b/test/prism/fixtures/seattlerb/backticks_interpolation_line.txt new file mode 100644 index 0000000000..b3ba31c72a --- /dev/null +++ b/test/prism/fixtures/seattlerb/backticks_interpolation_line.txt @@ -0,0 +1 @@ +x `#{y}` diff --git a/test/prism/fixtures/seattlerb/bang_eq.txt b/test/prism/fixtures/seattlerb/bang_eq.txt new file mode 100644 index 0000000000..0283460e46 --- /dev/null +++ b/test/prism/fixtures/seattlerb/bang_eq.txt @@ -0,0 +1 @@ +1 != 2 diff --git a/test/prism/fixtures/seattlerb/bdot2.txt b/test/prism/fixtures/seattlerb/bdot2.txt new file mode 100644 index 0000000000..4fb2692299 --- /dev/null +++ b/test/prism/fixtures/seattlerb/bdot2.txt @@ -0,0 +1,3 @@ +..10 +; ..a +; c diff --git a/test/prism/fixtures/seattlerb/bdot3.txt b/test/prism/fixtures/seattlerb/bdot3.txt new file mode 100644 index 0000000000..8079cf9872 --- /dev/null +++ b/test/prism/fixtures/seattlerb/bdot3.txt @@ -0,0 +1,3 @@ +...10 +; ...a +; c diff --git a/test/prism/fixtures/seattlerb/begin_ensure_no_bodies.txt b/test/prism/fixtures/seattlerb/begin_ensure_no_bodies.txt new file mode 100644 index 0000000000..51dde02ea3 --- /dev/null +++ b/test/prism/fixtures/seattlerb/begin_ensure_no_bodies.txt @@ -0,0 +1,3 @@ +begin +ensure +end diff --git a/test/prism/fixtures/seattlerb/begin_rescue_else_ensure_bodies.txt b/test/prism/fixtures/seattlerb/begin_rescue_else_ensure_bodies.txt new file mode 100644 index 0000000000..ae6e2c3636 --- /dev/null +++ b/test/prism/fixtures/seattlerb/begin_rescue_else_ensure_bodies.txt @@ -0,0 +1,9 @@ +begin + 1 +rescue + 2 +else + 3 +ensure + 4 +end diff --git a/test/prism/fixtures/seattlerb/begin_rescue_else_ensure_no_bodies.txt b/test/prism/fixtures/seattlerb/begin_rescue_else_ensure_no_bodies.txt new file mode 100644 index 0000000000..456d9a5d6e --- /dev/null +++ b/test/prism/fixtures/seattlerb/begin_rescue_else_ensure_no_bodies.txt @@ -0,0 +1,9 @@ +begin + +rescue + +else + +ensure + +end diff --git a/test/prism/fixtures/seattlerb/begin_rescue_ensure_no_bodies.txt b/test/prism/fixtures/seattlerb/begin_rescue_ensure_no_bodies.txt new file mode 100644 index 0000000000..896e3c030a --- /dev/null +++ b/test/prism/fixtures/seattlerb/begin_rescue_ensure_no_bodies.txt @@ -0,0 +1,4 @@ +begin +rescue +ensure +end diff --git a/test/prism/fixtures/seattlerb/block_arg__bare.txt b/test/prism/fixtures/seattlerb/block_arg__bare.txt new file mode 100644 index 0000000000..6454b00345 --- /dev/null +++ b/test/prism/fixtures/seattlerb/block_arg__bare.txt @@ -0,0 +1 @@ +def x(&); end diff --git a/test/prism/fixtures/seattlerb/block_arg_kwsplat.txt b/test/prism/fixtures/seattlerb/block_arg_kwsplat.txt new file mode 100644 index 0000000000..a9c255cc66 --- /dev/null +++ b/test/prism/fixtures/seattlerb/block_arg_kwsplat.txt @@ -0,0 +1 @@ +a { |**b| } diff --git a/test/prism/fixtures/seattlerb/block_arg_opt_arg_block.txt b/test/prism/fixtures/seattlerb/block_arg_opt_arg_block.txt new file mode 100644 index 0000000000..14cb02c68e --- /dev/null +++ b/test/prism/fixtures/seattlerb/block_arg_opt_arg_block.txt @@ -0,0 +1 @@ +a { |b, c=1, d, &e| } diff --git a/test/prism/fixtures/seattlerb/block_arg_opt_splat.txt b/test/prism/fixtures/seattlerb/block_arg_opt_splat.txt new file mode 100644 index 0000000000..a077ae1f34 --- /dev/null +++ b/test/prism/fixtures/seattlerb/block_arg_opt_splat.txt @@ -0,0 +1 @@ +a { |b, c = 1, *d| } diff --git a/test/prism/fixtures/seattlerb/block_arg_opt_splat_arg_block_omfg.txt b/test/prism/fixtures/seattlerb/block_arg_opt_splat_arg_block_omfg.txt new file mode 100644 index 0000000000..5016a7c6b9 --- /dev/null +++ b/test/prism/fixtures/seattlerb/block_arg_opt_splat_arg_block_omfg.txt @@ -0,0 +1 @@ +a { |b, c=1, *d, e, &f| } diff --git a/test/prism/fixtures/seattlerb/block_arg_optional.txt b/test/prism/fixtures/seattlerb/block_arg_optional.txt new file mode 100644 index 0000000000..966afc5640 --- /dev/null +++ b/test/prism/fixtures/seattlerb/block_arg_optional.txt @@ -0,0 +1 @@ +a { |b = 1| } diff --git a/test/prism/fixtures/seattlerb/block_arg_scope.txt b/test/prism/fixtures/seattlerb/block_arg_scope.txt new file mode 100644 index 0000000000..2362e08559 --- /dev/null +++ b/test/prism/fixtures/seattlerb/block_arg_scope.txt @@ -0,0 +1 @@ +a { |b; c| } diff --git a/test/prism/fixtures/seattlerb/block_arg_scope2.txt b/test/prism/fixtures/seattlerb/block_arg_scope2.txt new file mode 100644 index 0000000000..f7222dc7b1 --- /dev/null +++ b/test/prism/fixtures/seattlerb/block_arg_scope2.txt @@ -0,0 +1 @@ +a {|b; c, d| } diff --git a/test/prism/fixtures/seattlerb/block_arg_splat_arg.txt b/test/prism/fixtures/seattlerb/block_arg_splat_arg.txt new file mode 100644 index 0000000000..d7c31aae6b --- /dev/null +++ b/test/prism/fixtures/seattlerb/block_arg_splat_arg.txt @@ -0,0 +1 @@ +a { |b, *c, d| } diff --git a/test/prism/fixtures/seattlerb/block_args_kwargs.txt b/test/prism/fixtures/seattlerb/block_args_kwargs.txt new file mode 100644 index 0000000000..467b577a7e --- /dev/null +++ b/test/prism/fixtures/seattlerb/block_args_kwargs.txt @@ -0,0 +1 @@ +f { |**kwargs| kwargs } diff --git a/test/prism/fixtures/seattlerb/block_args_no_kwargs.txt b/test/prism/fixtures/seattlerb/block_args_no_kwargs.txt new file mode 100644 index 0000000000..5c9bfa3a62 --- /dev/null +++ b/test/prism/fixtures/seattlerb/block_args_no_kwargs.txt @@ -0,0 +1 @@ +f { |**nil| } diff --git a/test/prism/fixtures/seattlerb/block_args_opt1.txt b/test/prism/fixtures/seattlerb/block_args_opt1.txt new file mode 100644 index 0000000000..372689e36a --- /dev/null +++ b/test/prism/fixtures/seattlerb/block_args_opt1.txt @@ -0,0 +1 @@ +f { |a, b = 42| [a, b] } diff --git a/test/prism/fixtures/seattlerb/block_args_opt2.txt b/test/prism/fixtures/seattlerb/block_args_opt2.txt new file mode 100644 index 0000000000..10d0746646 --- /dev/null +++ b/test/prism/fixtures/seattlerb/block_args_opt2.txt @@ -0,0 +1 @@ +a { | b=1, c=2 | } diff --git a/test/prism/fixtures/seattlerb/block_args_opt2_2.txt b/test/prism/fixtures/seattlerb/block_args_opt2_2.txt new file mode 100644 index 0000000000..563a9bf915 --- /dev/null +++ b/test/prism/fixtures/seattlerb/block_args_opt2_2.txt @@ -0,0 +1 @@ +f { |a, b = 42, c = 24| [a, b, c] } diff --git a/test/prism/fixtures/seattlerb/block_args_opt3.txt b/test/prism/fixtures/seattlerb/block_args_opt3.txt new file mode 100644 index 0000000000..bb5a7c8458 --- /dev/null +++ b/test/prism/fixtures/seattlerb/block_args_opt3.txt @@ -0,0 +1 @@ +f { |a, b = 42, c = 24, &d| [a, b, c, d] } diff --git a/test/prism/fixtures/seattlerb/block_break.txt b/test/prism/fixtures/seattlerb/block_break.txt new file mode 100644 index 0000000000..35eabee187 --- /dev/null +++ b/test/prism/fixtures/seattlerb/block_break.txt @@ -0,0 +1 @@ +break foo arg do |bar| end diff --git a/test/prism/fixtures/seattlerb/block_call_defn_call_block_call.txt b/test/prism/fixtures/seattlerb/block_call_defn_call_block_call.txt new file mode 100644 index 0000000000..ff1b3a4c9f --- /dev/null +++ b/test/prism/fixtures/seattlerb/block_call_defn_call_block_call.txt @@ -0,0 +1,4 @@ +a def b(c) + d + end + e.f do end diff --git a/test/prism/fixtures/seattlerb/block_call_dot_op2_brace_block.txt b/test/prism/fixtures/seattlerb/block_call_dot_op2_brace_block.txt new file mode 100644 index 0000000000..63da9ee7af --- /dev/null +++ b/test/prism/fixtures/seattlerb/block_call_dot_op2_brace_block.txt @@ -0,0 +1 @@ +a.b c() do d end.e do |f| g end diff --git a/test/prism/fixtures/seattlerb/block_call_dot_op2_cmd_args_do_block.txt b/test/prism/fixtures/seattlerb/block_call_dot_op2_cmd_args_do_block.txt new file mode 100644 index 0000000000..24e7d0f1f1 --- /dev/null +++ b/test/prism/fixtures/seattlerb/block_call_dot_op2_cmd_args_do_block.txt @@ -0,0 +1 @@ +a.b c() do d end.e f do |g| h end diff --git a/test/prism/fixtures/seattlerb/block_call_operation_colon.txt b/test/prism/fixtures/seattlerb/block_call_operation_colon.txt new file mode 100644 index 0000000000..593b9e1bc0 --- /dev/null +++ b/test/prism/fixtures/seattlerb/block_call_operation_colon.txt @@ -0,0 +1 @@ +a.b c do end::d diff --git a/test/prism/fixtures/seattlerb/block_call_operation_dot.txt b/test/prism/fixtures/seattlerb/block_call_operation_dot.txt new file mode 100644 index 0000000000..20b8e4fcb8 --- /dev/null +++ b/test/prism/fixtures/seattlerb/block_call_operation_dot.txt @@ -0,0 +1 @@ +a.b c do end.d diff --git a/test/prism/fixtures/seattlerb/block_call_paren_call_block_call.txt b/test/prism/fixtures/seattlerb/block_call_paren_call_block_call.txt new file mode 100644 index 0000000000..7f8be95100 --- /dev/null +++ b/test/prism/fixtures/seattlerb/block_call_paren_call_block_call.txt @@ -0,0 +1,2 @@ +a (b) +c.d do end diff --git a/test/prism/fixtures/seattlerb/block_command_operation_colon.txt b/test/prism/fixtures/seattlerb/block_command_operation_colon.txt new file mode 100644 index 0000000000..db221ad496 --- /dev/null +++ b/test/prism/fixtures/seattlerb/block_command_operation_colon.txt @@ -0,0 +1 @@ +a :b do end::c :d diff --git a/test/prism/fixtures/seattlerb/block_command_operation_dot.txt b/test/prism/fixtures/seattlerb/block_command_operation_dot.txt new file mode 100644 index 0000000000..56b71677e8 --- /dev/null +++ b/test/prism/fixtures/seattlerb/block_command_operation_dot.txt @@ -0,0 +1 @@ +a :b do end.c :d diff --git a/test/prism/fixtures/seattlerb/block_decomp_anon_splat_arg.txt b/test/prism/fixtures/seattlerb/block_decomp_anon_splat_arg.txt new file mode 100644 index 0000000000..96f5d5d2ec --- /dev/null +++ b/test/prism/fixtures/seattlerb/block_decomp_anon_splat_arg.txt @@ -0,0 +1 @@ +f { |(*, a)| } diff --git a/test/prism/fixtures/seattlerb/block_decomp_arg_splat.txt b/test/prism/fixtures/seattlerb/block_decomp_arg_splat.txt new file mode 100644 index 0000000000..f8db3874de --- /dev/null +++ b/test/prism/fixtures/seattlerb/block_decomp_arg_splat.txt @@ -0,0 +1 @@ +a { |(b, *)| } diff --git a/test/prism/fixtures/seattlerb/block_decomp_arg_splat_arg.txt b/test/prism/fixtures/seattlerb/block_decomp_arg_splat_arg.txt new file mode 100644 index 0000000000..e64f4e8c3d --- /dev/null +++ b/test/prism/fixtures/seattlerb/block_decomp_arg_splat_arg.txt @@ -0,0 +1 @@ +f { |(a, *b, c)| } diff --git a/test/prism/fixtures/seattlerb/block_decomp_splat.txt b/test/prism/fixtures/seattlerb/block_decomp_splat.txt new file mode 100644 index 0000000000..970f00a626 --- /dev/null +++ b/test/prism/fixtures/seattlerb/block_decomp_splat.txt @@ -0,0 +1 @@ +f { |(*a)| } diff --git a/test/prism/fixtures/seattlerb/block_kw.txt b/test/prism/fixtures/seattlerb/block_kw.txt new file mode 100644 index 0000000000..bacfd32e80 --- /dev/null +++ b/test/prism/fixtures/seattlerb/block_kw.txt @@ -0,0 +1 @@ +blah { |k:42| } diff --git a/test/prism/fixtures/seattlerb/block_kw__required.txt b/test/prism/fixtures/seattlerb/block_kw__required.txt new file mode 100644 index 0000000000..b84ab97037 --- /dev/null +++ b/test/prism/fixtures/seattlerb/block_kw__required.txt @@ -0,0 +1 @@ +blah do |k:| end diff --git a/test/prism/fixtures/seattlerb/block_kwarg_lvar.txt b/test/prism/fixtures/seattlerb/block_kwarg_lvar.txt new file mode 100644 index 0000000000..390b9195e0 --- /dev/null +++ b/test/prism/fixtures/seattlerb/block_kwarg_lvar.txt @@ -0,0 +1 @@ +bl { |kw: :val| kw } diff --git a/test/prism/fixtures/seattlerb/block_kwarg_lvar_multiple.txt b/test/prism/fixtures/seattlerb/block_kwarg_lvar_multiple.txt new file mode 100644 index 0000000000..df3e4afde8 --- /dev/null +++ b/test/prism/fixtures/seattlerb/block_kwarg_lvar_multiple.txt @@ -0,0 +1 @@ +bl { |kw: :val, kw2: :val2 | kw } diff --git a/test/prism/fixtures/seattlerb/block_next.txt b/test/prism/fixtures/seattlerb/block_next.txt new file mode 100644 index 0000000000..760fcbf809 --- /dev/null +++ b/test/prism/fixtures/seattlerb/block_next.txt @@ -0,0 +1 @@ +next foo arg do |bar| end diff --git a/test/prism/fixtures/seattlerb/block_opt_arg.txt b/test/prism/fixtures/seattlerb/block_opt_arg.txt new file mode 100644 index 0000000000..5e312fdf41 --- /dev/null +++ b/test/prism/fixtures/seattlerb/block_opt_arg.txt @@ -0,0 +1 @@ +a { |b=1, c| } diff --git a/test/prism/fixtures/seattlerb/block_opt_splat.txt b/test/prism/fixtures/seattlerb/block_opt_splat.txt new file mode 100644 index 0000000000..772a3fc412 --- /dev/null +++ b/test/prism/fixtures/seattlerb/block_opt_splat.txt @@ -0,0 +1 @@ +a { |b = 1, *c| } diff --git a/test/prism/fixtures/seattlerb/block_opt_splat_arg_block_omfg.txt b/test/prism/fixtures/seattlerb/block_opt_splat_arg_block_omfg.txt new file mode 100644 index 0000000000..76466f9d54 --- /dev/null +++ b/test/prism/fixtures/seattlerb/block_opt_splat_arg_block_omfg.txt @@ -0,0 +1 @@ +a { |b=1, *c, d, &e| } diff --git a/test/prism/fixtures/seattlerb/block_optarg.txt b/test/prism/fixtures/seattlerb/block_optarg.txt new file mode 100644 index 0000000000..a471554da1 --- /dev/null +++ b/test/prism/fixtures/seattlerb/block_optarg.txt @@ -0,0 +1 @@ +a { |b = :c| } diff --git a/test/prism/fixtures/seattlerb/block_paren_splat.txt b/test/prism/fixtures/seattlerb/block_paren_splat.txt new file mode 100644 index 0000000000..3dd4bba1ed --- /dev/null +++ b/test/prism/fixtures/seattlerb/block_paren_splat.txt @@ -0,0 +1 @@ +a { |(b, *c)| } diff --git a/test/prism/fixtures/seattlerb/block_reg_optarg.txt b/test/prism/fixtures/seattlerb/block_reg_optarg.txt new file mode 100644 index 0000000000..c024651f78 --- /dev/null +++ b/test/prism/fixtures/seattlerb/block_reg_optarg.txt @@ -0,0 +1 @@ +a { |b, c = :d| } diff --git a/test/prism/fixtures/seattlerb/block_return.txt b/test/prism/fixtures/seattlerb/block_return.txt new file mode 100644 index 0000000000..f30ba71d8f --- /dev/null +++ b/test/prism/fixtures/seattlerb/block_return.txt @@ -0,0 +1 @@ +return foo arg do |bar| end diff --git a/test/prism/fixtures/seattlerb/block_scope.txt b/test/prism/fixtures/seattlerb/block_scope.txt new file mode 100644 index 0000000000..7a83d8ab87 --- /dev/null +++ b/test/prism/fixtures/seattlerb/block_scope.txt @@ -0,0 +1 @@ +a { |;b| } diff --git a/test/prism/fixtures/seattlerb/block_splat_reg.txt b/test/prism/fixtures/seattlerb/block_splat_reg.txt new file mode 100644 index 0000000000..58f0619e5d --- /dev/null +++ b/test/prism/fixtures/seattlerb/block_splat_reg.txt @@ -0,0 +1 @@ +a { |*b, c| } diff --git a/test/prism/fixtures/seattlerb/bug169.txt b/test/prism/fixtures/seattlerb/bug169.txt new file mode 100644 index 0000000000..db2e5ace5e --- /dev/null +++ b/test/prism/fixtures/seattlerb/bug169.txt @@ -0,0 +1 @@ +m () {} diff --git a/test/prism/fixtures/seattlerb/bug179.txt b/test/prism/fixtures/seattlerb/bug179.txt new file mode 100644 index 0000000000..02ae07a3be --- /dev/null +++ b/test/prism/fixtures/seattlerb/bug179.txt @@ -0,0 +1 @@ +p ()..nil diff --git a/test/prism/fixtures/seattlerb/bug190.txt b/test/prism/fixtures/seattlerb/bug190.txt new file mode 100644 index 0000000000..861b2d305f --- /dev/null +++ b/test/prism/fixtures/seattlerb/bug190.txt @@ -0,0 +1 @@ +%r'\'' diff --git a/test/prism/fixtures/seattlerb/bug191.txt b/test/prism/fixtures/seattlerb/bug191.txt new file mode 100644 index 0000000000..03f7fd1228 --- /dev/null +++ b/test/prism/fixtures/seattlerb/bug191.txt @@ -0,0 +1,3 @@ +a ? "": b + +a ? '': b diff --git a/test/prism/fixtures/seattlerb/bug202.txt b/test/prism/fixtures/seattlerb/bug202.txt new file mode 100644 index 0000000000..a3b06ffdfc --- /dev/null +++ b/test/prism/fixtures/seattlerb/bug202.txt @@ -0,0 +1,2 @@ +$测试 = 1 +测试 = 1 diff --git a/test/prism/fixtures/seattlerb/bug236.txt b/test/prism/fixtures/seattlerb/bug236.txt new file mode 100644 index 0000000000..cefe1eb058 --- /dev/null +++ b/test/prism/fixtures/seattlerb/bug236.txt @@ -0,0 +1,3 @@ +x{|a,|} + +x{|a|} diff --git a/test/prism/fixtures/seattlerb/bug290.txt b/test/prism/fixtures/seattlerb/bug290.txt new file mode 100644 index 0000000000..dbcd28cd48 --- /dev/null +++ b/test/prism/fixtures/seattlerb/bug290.txt @@ -0,0 +1,3 @@ +begin + foo +end diff --git a/test/prism/fixtures/seattlerb/bug_187.txt b/test/prism/fixtures/seattlerb/bug_187.txt new file mode 100644 index 0000000000..1e1ecd8202 --- /dev/null +++ b/test/prism/fixtures/seattlerb/bug_187.txt @@ -0,0 +1,3 @@ +private def f +a.b do end +end diff --git a/test/prism/fixtures/seattlerb/bug_215.txt b/test/prism/fixtures/seattlerb/bug_215.txt new file mode 100644 index 0000000000..f0d09ba5ff --- /dev/null +++ b/test/prism/fixtures/seattlerb/bug_215.txt @@ -0,0 +1 @@ +undef %s(foo) diff --git a/test/prism/fixtures/seattlerb/bug_249.txt b/test/prism/fixtures/seattlerb/bug_249.txt new file mode 100644 index 0000000000..ccccdf5326 --- /dev/null +++ b/test/prism/fixtures/seattlerb/bug_249.txt @@ -0,0 +1,4 @@ +mount (Class.new do +def initialize +end + end).new, :at => 'endpoint' diff --git a/test/prism/fixtures/seattlerb/bug_and.txt b/test/prism/fixtures/seattlerb/bug_and.txt new file mode 100644 index 0000000000..6243359a9e --- /dev/null +++ b/test/prism/fixtures/seattlerb/bug_and.txt @@ -0,0 +1,4 @@ +true and +true + +true and [] diff --git a/test/prism/fixtures/seattlerb/bug_args__19.txt b/test/prism/fixtures/seattlerb/bug_args__19.txt new file mode 100644 index 0000000000..08466554fd --- /dev/null +++ b/test/prism/fixtures/seattlerb/bug_args__19.txt @@ -0,0 +1 @@ +f { |(a, b)| d } diff --git a/test/prism/fixtures/seattlerb/bug_args_masgn.txt b/test/prism/fixtures/seattlerb/bug_args_masgn.txt new file mode 100644 index 0000000000..e0a71e9197 --- /dev/null +++ b/test/prism/fixtures/seattlerb/bug_args_masgn.txt @@ -0,0 +1 @@ +f { |(a, b), c| } diff --git a/test/prism/fixtures/seattlerb/bug_args_masgn2.txt b/test/prism/fixtures/seattlerb/bug_args_masgn2.txt new file mode 100644 index 0000000000..2f12756bfe --- /dev/null +++ b/test/prism/fixtures/seattlerb/bug_args_masgn2.txt @@ -0,0 +1 @@ +f { |((a, b), c), d| } diff --git a/test/prism/fixtures/seattlerb/bug_args_masgn_outer_parens__19.txt b/test/prism/fixtures/seattlerb/bug_args_masgn_outer_parens__19.txt new file mode 100644 index 0000000000..a2b0178676 --- /dev/null +++ b/test/prism/fixtures/seattlerb/bug_args_masgn_outer_parens__19.txt @@ -0,0 +1 @@ +f { |((k, v), i)| } diff --git a/test/prism/fixtures/seattlerb/bug_call_arglist_parens.txt b/test/prism/fixtures/seattlerb/bug_call_arglist_parens.txt new file mode 100644 index 0000000000..4f04368802 --- /dev/null +++ b/test/prism/fixtures/seattlerb/bug_call_arglist_parens.txt @@ -0,0 +1,11 @@ + def f + g ( 1), 2 + end + + + def f() + g (1), 2 + end + + +g ( 1), 2 diff --git a/test/prism/fixtures/seattlerb/bug_case_when_regexp.txt b/test/prism/fixtures/seattlerb/bug_case_when_regexp.txt new file mode 100644 index 0000000000..2536696a42 --- /dev/null +++ b/test/prism/fixtures/seattlerb/bug_case_when_regexp.txt @@ -0,0 +1 @@ +case :x; when /x/ then end diff --git a/test/prism/fixtures/seattlerb/bug_comma.txt b/test/prism/fixtures/seattlerb/bug_comma.txt new file mode 100644 index 0000000000..d86f1ea9dd --- /dev/null +++ b/test/prism/fixtures/seattlerb/bug_comma.txt @@ -0,0 +1 @@ +if test ?d, dir then end diff --git a/test/prism/fixtures/seattlerb/bug_cond_pct.txt b/test/prism/fixtures/seattlerb/bug_cond_pct.txt new file mode 100644 index 0000000000..1b4f90058e --- /dev/null +++ b/test/prism/fixtures/seattlerb/bug_cond_pct.txt @@ -0,0 +1 @@ +case; when %r%blahblah%; end diff --git a/test/prism/fixtures/seattlerb/bug_hash_args.txt b/test/prism/fixtures/seattlerb/bug_hash_args.txt new file mode 100644 index 0000000000..b815f8a666 --- /dev/null +++ b/test/prism/fixtures/seattlerb/bug_hash_args.txt @@ -0,0 +1 @@ +foo(:bar, baz: nil) diff --git a/test/prism/fixtures/seattlerb/bug_hash_args_trailing_comma.txt b/test/prism/fixtures/seattlerb/bug_hash_args_trailing_comma.txt new file mode 100644 index 0000000000..6057b245a5 --- /dev/null +++ b/test/prism/fixtures/seattlerb/bug_hash_args_trailing_comma.txt @@ -0,0 +1 @@ +foo(:bar, baz: nil,) diff --git a/test/prism/fixtures/seattlerb/bug_hash_interp_array.txt b/test/prism/fixtures/seattlerb/bug_hash_interp_array.txt new file mode 100644 index 0000000000..01fe238056 --- /dev/null +++ b/test/prism/fixtures/seattlerb/bug_hash_interp_array.txt @@ -0,0 +1 @@ +{ "#{}": [] } diff --git a/test/prism/fixtures/seattlerb/bug_masgn_right.txt b/test/prism/fixtures/seattlerb/bug_masgn_right.txt new file mode 100644 index 0000000000..12ea7b8d62 --- /dev/null +++ b/test/prism/fixtures/seattlerb/bug_masgn_right.txt @@ -0,0 +1 @@ +f { |a, (b, c)| } diff --git a/test/prism/fixtures/seattlerb/bug_not_parens.txt b/test/prism/fixtures/seattlerb/bug_not_parens.txt new file mode 100644 index 0000000000..8847b7bec6 --- /dev/null +++ b/test/prism/fixtures/seattlerb/bug_not_parens.txt @@ -0,0 +1 @@ +not(a) diff --git a/test/prism/fixtures/seattlerb/bug_op_asgn_rescue.txt b/test/prism/fixtures/seattlerb/bug_op_asgn_rescue.txt new file mode 100644 index 0000000000..6a0b25cbdc --- /dev/null +++ b/test/prism/fixtures/seattlerb/bug_op_asgn_rescue.txt @@ -0,0 +1 @@ +a ||= b rescue nil diff --git a/test/prism/fixtures/seattlerb/call_and.txt b/test/prism/fixtures/seattlerb/call_and.txt new file mode 100644 index 0000000000..c17be8f356 --- /dev/null +++ b/test/prism/fixtures/seattlerb/call_and.txt @@ -0,0 +1 @@ +1 & 2 diff --git a/test/prism/fixtures/seattlerb/call_arg_assoc.txt b/test/prism/fixtures/seattlerb/call_arg_assoc.txt new file mode 100644 index 0000000000..376c299be5 --- /dev/null +++ b/test/prism/fixtures/seattlerb/call_arg_assoc.txt @@ -0,0 +1 @@ +f(1, 2=>3) diff --git a/test/prism/fixtures/seattlerb/call_arg_assoc_kwsplat.txt b/test/prism/fixtures/seattlerb/call_arg_assoc_kwsplat.txt new file mode 100644 index 0000000000..a4be0fb62c --- /dev/null +++ b/test/prism/fixtures/seattlerb/call_arg_assoc_kwsplat.txt @@ -0,0 +1 @@ +f(1, kw: 2, **3) diff --git a/test/prism/fixtures/seattlerb/call_arg_kwsplat.txt b/test/prism/fixtures/seattlerb/call_arg_kwsplat.txt new file mode 100644 index 0000000000..4848fd9e8d --- /dev/null +++ b/test/prism/fixtures/seattlerb/call_arg_kwsplat.txt @@ -0,0 +1 @@ +a(b, **1) diff --git a/test/prism/fixtures/seattlerb/call_args_assoc_quoted.txt b/test/prism/fixtures/seattlerb/call_args_assoc_quoted.txt new file mode 100644 index 0000000000..0af2259577 --- /dev/null +++ b/test/prism/fixtures/seattlerb/call_args_assoc_quoted.txt @@ -0,0 +1,5 @@ +x "#{k}":42 + +x "k":42 + +x 'k':42 diff --git a/test/prism/fixtures/seattlerb/call_args_assoc_trailing_comma.txt b/test/prism/fixtures/seattlerb/call_args_assoc_trailing_comma.txt new file mode 100644 index 0000000000..6ad08f3238 --- /dev/null +++ b/test/prism/fixtures/seattlerb/call_args_assoc_trailing_comma.txt @@ -0,0 +1 @@ +f(1, 2=>3,) diff --git a/test/prism/fixtures/seattlerb/call_args_command.txt b/test/prism/fixtures/seattlerb/call_args_command.txt new file mode 100644 index 0000000000..dd6df29c7b --- /dev/null +++ b/test/prism/fixtures/seattlerb/call_args_command.txt @@ -0,0 +1 @@ +a.b c.d 1 diff --git a/test/prism/fixtures/seattlerb/call_array_arg.txt b/test/prism/fixtures/seattlerb/call_array_arg.txt new file mode 100644 index 0000000000..5c724fa328 --- /dev/null +++ b/test/prism/fixtures/seattlerb/call_array_arg.txt @@ -0,0 +1 @@ +1 == [:b, :c] diff --git a/test/prism/fixtures/seattlerb/call_array_block_call.txt b/test/prism/fixtures/seattlerb/call_array_block_call.txt new file mode 100644 index 0000000000..6d4c1b276e --- /dev/null +++ b/test/prism/fixtures/seattlerb/call_array_block_call.txt @@ -0,0 +1 @@ +a [ nil, b do end ] diff --git a/test/prism/fixtures/seattlerb/call_array_lambda_block_call.txt b/test/prism/fixtures/seattlerb/call_array_lambda_block_call.txt new file mode 100644 index 0000000000..dc5b5807b2 --- /dev/null +++ b/test/prism/fixtures/seattlerb/call_array_lambda_block_call.txt @@ -0,0 +1,2 @@ +a [->() {}] do +end diff --git a/test/prism/fixtures/seattlerb/call_array_lit_inline_hash.txt b/test/prism/fixtures/seattlerb/call_array_lit_inline_hash.txt new file mode 100644 index 0000000000..daba00947e --- /dev/null +++ b/test/prism/fixtures/seattlerb/call_array_lit_inline_hash.txt @@ -0,0 +1 @@ +a([:b, :c => 1]) diff --git a/test/prism/fixtures/seattlerb/call_assoc.txt b/test/prism/fixtures/seattlerb/call_assoc.txt new file mode 100644 index 0000000000..2adc1eee1c --- /dev/null +++ b/test/prism/fixtures/seattlerb/call_assoc.txt @@ -0,0 +1 @@ +f(2=>3) diff --git a/test/prism/fixtures/seattlerb/call_assoc_new.txt b/test/prism/fixtures/seattlerb/call_assoc_new.txt new file mode 100644 index 0000000000..b8457bfdfc --- /dev/null +++ b/test/prism/fixtures/seattlerb/call_assoc_new.txt @@ -0,0 +1 @@ +f(a:3) diff --git a/test/prism/fixtures/seattlerb/call_assoc_new_if_multiline.txt b/test/prism/fixtures/seattlerb/call_assoc_new_if_multiline.txt new file mode 100644 index 0000000000..fe0a37dabb --- /dev/null +++ b/test/prism/fixtures/seattlerb/call_assoc_new_if_multiline.txt @@ -0,0 +1,5 @@ +a(b: if :c +1 +else +2 +end) diff --git a/test/prism/fixtures/seattlerb/call_assoc_trailing_comma.txt b/test/prism/fixtures/seattlerb/call_assoc_trailing_comma.txt new file mode 100644 index 0000000000..4d86a4541d --- /dev/null +++ b/test/prism/fixtures/seattlerb/call_assoc_trailing_comma.txt @@ -0,0 +1 @@ +f(1=>2,) diff --git a/test/prism/fixtures/seattlerb/call_bang_command_call.txt b/test/prism/fixtures/seattlerb/call_bang_command_call.txt new file mode 100644 index 0000000000..4f3ba4b93c --- /dev/null +++ b/test/prism/fixtures/seattlerb/call_bang_command_call.txt @@ -0,0 +1 @@ +! a.b 1 diff --git a/test/prism/fixtures/seattlerb/call_bang_squiggle.txt b/test/prism/fixtures/seattlerb/call_bang_squiggle.txt new file mode 100644 index 0000000000..d7039f910a --- /dev/null +++ b/test/prism/fixtures/seattlerb/call_bang_squiggle.txt @@ -0,0 +1 @@ +1 !~ 2 diff --git a/test/prism/fixtures/seattlerb/call_begin_call_block_call.txt b/test/prism/fixtures/seattlerb/call_begin_call_block_call.txt new file mode 100644 index 0000000000..e9b43491fe --- /dev/null +++ b/test/prism/fixtures/seattlerb/call_begin_call_block_call.txt @@ -0,0 +1,3 @@ +a begin +b.c do end +end diff --git a/test/prism/fixtures/seattlerb/call_block_arg_named.txt b/test/prism/fixtures/seattlerb/call_block_arg_named.txt new file mode 100644 index 0000000000..08fea89d11 --- /dev/null +++ b/test/prism/fixtures/seattlerb/call_block_arg_named.txt @@ -0,0 +1 @@ +x(&blk) diff --git a/test/prism/fixtures/seattlerb/call_carat.txt b/test/prism/fixtures/seattlerb/call_carat.txt new file mode 100644 index 0000000000..3e88c09837 --- /dev/null +++ b/test/prism/fixtures/seattlerb/call_carat.txt @@ -0,0 +1 @@ +1 ^ 2 diff --git a/test/prism/fixtures/seattlerb/call_colon2.txt b/test/prism/fixtures/seattlerb/call_colon2.txt new file mode 100644 index 0000000000..47aab7e637 --- /dev/null +++ b/test/prism/fixtures/seattlerb/call_colon2.txt @@ -0,0 +1 @@ +A::b diff --git a/test/prism/fixtures/seattlerb/call_colon_parens.txt b/test/prism/fixtures/seattlerb/call_colon_parens.txt new file mode 100644 index 0000000000..51ed4df11b --- /dev/null +++ b/test/prism/fixtures/seattlerb/call_colon_parens.txt @@ -0,0 +1 @@ +1::() diff --git a/test/prism/fixtures/seattlerb/call_div.txt b/test/prism/fixtures/seattlerb/call_div.txt new file mode 100644 index 0000000000..85b4d7b0b0 --- /dev/null +++ b/test/prism/fixtures/seattlerb/call_div.txt @@ -0,0 +1 @@ +1 / 2 diff --git a/test/prism/fixtures/seattlerb/call_dot_parens.txt b/test/prism/fixtures/seattlerb/call_dot_parens.txt new file mode 100644 index 0000000000..0270596a07 --- /dev/null +++ b/test/prism/fixtures/seattlerb/call_dot_parens.txt @@ -0,0 +1 @@ +1.() diff --git a/test/prism/fixtures/seattlerb/call_env.txt b/test/prism/fixtures/seattlerb/call_env.txt new file mode 100644 index 0000000000..dadc0d3861 --- /dev/null +++ b/test/prism/fixtures/seattlerb/call_env.txt @@ -0,0 +1 @@ +a.happy diff --git a/test/prism/fixtures/seattlerb/call_eq3.txt b/test/prism/fixtures/seattlerb/call_eq3.txt new file mode 100644 index 0000000000..6a2fb465cb --- /dev/null +++ b/test/prism/fixtures/seattlerb/call_eq3.txt @@ -0,0 +1 @@ +1 === 2 diff --git a/test/prism/fixtures/seattlerb/call_gt.txt b/test/prism/fixtures/seattlerb/call_gt.txt new file mode 100644 index 0000000000..9d0a1caa90 --- /dev/null +++ b/test/prism/fixtures/seattlerb/call_gt.txt @@ -0,0 +1 @@ +1 > 2 diff --git a/test/prism/fixtures/seattlerb/call_kwsplat.txt b/test/prism/fixtures/seattlerb/call_kwsplat.txt new file mode 100644 index 0000000000..eda700c3e1 --- /dev/null +++ b/test/prism/fixtures/seattlerb/call_kwsplat.txt @@ -0,0 +1 @@ +a(**1) diff --git a/test/prism/fixtures/seattlerb/call_leading_dots.txt b/test/prism/fixtures/seattlerb/call_leading_dots.txt new file mode 100644 index 0000000000..1e7b2e5179 --- /dev/null +++ b/test/prism/fixtures/seattlerb/call_leading_dots.txt @@ -0,0 +1,3 @@ +a +.b +.c diff --git a/test/prism/fixtures/seattlerb/call_leading_dots_comment.txt b/test/prism/fixtures/seattlerb/call_leading_dots_comment.txt new file mode 100644 index 0000000000..c5deec5642 --- /dev/null +++ b/test/prism/fixtures/seattlerb/call_leading_dots_comment.txt @@ -0,0 +1,4 @@ +a +.b +#.c +.d diff --git a/test/prism/fixtures/seattlerb/call_lt.txt b/test/prism/fixtures/seattlerb/call_lt.txt new file mode 100644 index 0000000000..17e69c79b5 --- /dev/null +++ b/test/prism/fixtures/seattlerb/call_lt.txt @@ -0,0 +1 @@ +1 < 2 diff --git a/test/prism/fixtures/seattlerb/call_lte.txt b/test/prism/fixtures/seattlerb/call_lte.txt new file mode 100644 index 0000000000..7574027634 --- /dev/null +++ b/test/prism/fixtures/seattlerb/call_lte.txt @@ -0,0 +1 @@ +1 <= 2 diff --git a/test/prism/fixtures/seattlerb/call_not.txt b/test/prism/fixtures/seattlerb/call_not.txt new file mode 100644 index 0000000000..51e4742f55 --- /dev/null +++ b/test/prism/fixtures/seattlerb/call_not.txt @@ -0,0 +1 @@ +not 42 diff --git a/test/prism/fixtures/seattlerb/call_pipe.txt b/test/prism/fixtures/seattlerb/call_pipe.txt new file mode 100644 index 0000000000..1555910665 --- /dev/null +++ b/test/prism/fixtures/seattlerb/call_pipe.txt @@ -0,0 +1 @@ +1 | 2 diff --git a/test/prism/fixtures/seattlerb/call_rshift.txt b/test/prism/fixtures/seattlerb/call_rshift.txt new file mode 100644 index 0000000000..9ff1def4e0 --- /dev/null +++ b/test/prism/fixtures/seattlerb/call_rshift.txt @@ -0,0 +1 @@ +1 >> 2 diff --git a/test/prism/fixtures/seattlerb/call_self_brackets.txt b/test/prism/fixtures/seattlerb/call_self_brackets.txt new file mode 100644 index 0000000000..6533df2ce0 --- /dev/null +++ b/test/prism/fixtures/seattlerb/call_self_brackets.txt @@ -0,0 +1 @@ +self[1] diff --git a/test/prism/fixtures/seattlerb/call_spaceship.txt b/test/prism/fixtures/seattlerb/call_spaceship.txt new file mode 100644 index 0000000000..905c3a1c46 --- /dev/null +++ b/test/prism/fixtures/seattlerb/call_spaceship.txt @@ -0,0 +1 @@ +1 <=> 2 diff --git a/test/prism/fixtures/seattlerb/call_stabby_do_end_with_block.txt b/test/prism/fixtures/seattlerb/call_stabby_do_end_with_block.txt new file mode 100644 index 0000000000..2d1afdad28 --- /dev/null +++ b/test/prism/fixtures/seattlerb/call_stabby_do_end_with_block.txt @@ -0,0 +1 @@ +a -> do 1 end do 2 end diff --git a/test/prism/fixtures/seattlerb/call_stabby_with_braces_block.txt b/test/prism/fixtures/seattlerb/call_stabby_with_braces_block.txt new file mode 100644 index 0000000000..0d995a04d1 --- /dev/null +++ b/test/prism/fixtures/seattlerb/call_stabby_with_braces_block.txt @@ -0,0 +1 @@ +a -> { 1 } do 2 end diff --git a/test/prism/fixtures/seattlerb/call_star.txt b/test/prism/fixtures/seattlerb/call_star.txt new file mode 100644 index 0000000000..096ec022d4 --- /dev/null +++ b/test/prism/fixtures/seattlerb/call_star.txt @@ -0,0 +1 @@ +1 * 2 diff --git a/test/prism/fixtures/seattlerb/call_star2.txt b/test/prism/fixtures/seattlerb/call_star2.txt new file mode 100644 index 0000000000..bef4719d3c --- /dev/null +++ b/test/prism/fixtures/seattlerb/call_star2.txt @@ -0,0 +1 @@ +1 ** 2 diff --git a/test/prism/fixtures/seattlerb/call_trailing_comma.txt b/test/prism/fixtures/seattlerb/call_trailing_comma.txt new file mode 100644 index 0000000000..e9a3ca35be --- /dev/null +++ b/test/prism/fixtures/seattlerb/call_trailing_comma.txt @@ -0,0 +1 @@ +f(1,) diff --git a/test/prism/fixtures/seattlerb/call_trailing_dots.txt b/test/prism/fixtures/seattlerb/call_trailing_dots.txt new file mode 100644 index 0000000000..960cdbb45f --- /dev/null +++ b/test/prism/fixtures/seattlerb/call_trailing_dots.txt @@ -0,0 +1,3 @@ +a. +b. +c diff --git a/test/prism/fixtures/seattlerb/call_unary_bang.txt b/test/prism/fixtures/seattlerb/call_unary_bang.txt new file mode 100644 index 0000000000..91f702d4a9 --- /dev/null +++ b/test/prism/fixtures/seattlerb/call_unary_bang.txt @@ -0,0 +1 @@ +!1 diff --git a/test/prism/fixtures/seattlerb/case_in.txt b/test/prism/fixtures/seattlerb/case_in.txt new file mode 100644 index 0000000000..0835da0956 --- /dev/null +++ b/test/prism/fixtures/seattlerb/case_in.txt @@ -0,0 +1,111 @@ +case :a +in "b": +end + +case :a +in %I[a b] +end + +case :a +in %W[a b] +end + +case :a +in %i[a b] +end + +case :a +in %w[a b] +end + +case :a +in (...10) +end + +case :a +in (..10) +end + +case :a +in (1...) +end + +case :a +in (1...3) +end + +case :a +in (42) +end + +case :a +in **nil +end + +case :a +in /regexp/ +end + +case :a +in :b, *_, :c +end + +case :a +in :b, [:c] +end + +case :a +in Symbol() +end + +case :a +in Symbol(*lhs, x, *rhs) +end + +case :a +in Symbol[*lhs, x, *rhs] +end + +case :a +in [->(b) { true }, c] +end + +case :a +in [:a, b, c, [:d, *e, nil]] +end + +case :a +in [A, *, B] +end + +case :a +in [[:b, c], [:d, ^e]] +end + +case :a +in [] +end + +case :a +in [^(a)] +end + +case :a +in [^@a, ^$b, ^@@c] +end + +case :a +in `echo hi` +end + +case :a +in nil, nil, nil +end + +case :a +in { "b": } +end + +case :a +in {} +end diff --git a/test/prism/fixtures/seattlerb/case_in_31.txt b/test/prism/fixtures/seattlerb/case_in_31.txt new file mode 100644 index 0000000000..b9bf25b132 --- /dev/null +++ b/test/prism/fixtures/seattlerb/case_in_31.txt @@ -0,0 +1,4 @@ +case :a +in [:b, *c] + :d +end diff --git a/test/prism/fixtures/seattlerb/case_in_37.txt b/test/prism/fixtures/seattlerb/case_in_37.txt new file mode 100644 index 0000000000..25b6fb9261 --- /dev/null +++ b/test/prism/fixtures/seattlerb/case_in_37.txt @@ -0,0 +1,4 @@ +case :a +in { b: [Hash, *] } + :c +end diff --git a/test/prism/fixtures/seattlerb/case_in_42.txt b/test/prism/fixtures/seattlerb/case_in_42.txt new file mode 100644 index 0000000000..bc6a2233f5 --- /dev/null +++ b/test/prism/fixtures/seattlerb/case_in_42.txt @@ -0,0 +1,3 @@ +case :a +in :b, *_ then nil +end diff --git a/test/prism/fixtures/seattlerb/case_in_42_2.txt b/test/prism/fixtures/seattlerb/case_in_42_2.txt new file mode 100644 index 0000000000..ce4b65a5d0 --- /dev/null +++ b/test/prism/fixtures/seattlerb/case_in_42_2.txt @@ -0,0 +1,3 @@ +case :a +in A(*list) then nil +end diff --git a/test/prism/fixtures/seattlerb/case_in_47.txt b/test/prism/fixtures/seattlerb/case_in_47.txt new file mode 100644 index 0000000000..60f17ed7ce --- /dev/null +++ b/test/prism/fixtures/seattlerb/case_in_47.txt @@ -0,0 +1,4 @@ +case :a +in [*, :b, :c] + :d +end diff --git a/test/prism/fixtures/seattlerb/case_in_67.txt b/test/prism/fixtures/seattlerb/case_in_67.txt new file mode 100644 index 0000000000..c1c55e68c7 --- /dev/null +++ b/test/prism/fixtures/seattlerb/case_in_67.txt @@ -0,0 +1,3 @@ +case :a +in 1.. then nil +end diff --git a/test/prism/fixtures/seattlerb/case_in_86.txt b/test/prism/fixtures/seattlerb/case_in_86.txt new file mode 100644 index 0000000000..63ba92e533 --- /dev/null +++ b/test/prism/fixtures/seattlerb/case_in_86.txt @@ -0,0 +1,3 @@ +case [:a, :b] +in ::NilClass, * then nil +end diff --git a/test/prism/fixtures/seattlerb/case_in_86_2.txt b/test/prism/fixtures/seattlerb/case_in_86_2.txt new file mode 100644 index 0000000000..4ad16c451a --- /dev/null +++ b/test/prism/fixtures/seattlerb/case_in_86_2.txt @@ -0,0 +1,3 @@ +case [:a, :b] +in *, ::NilClass then nil +end diff --git a/test/prism/fixtures/seattlerb/case_in_array_pat_const.txt b/test/prism/fixtures/seattlerb/case_in_array_pat_const.txt new file mode 100644 index 0000000000..8551e48e2c --- /dev/null +++ b/test/prism/fixtures/seattlerb/case_in_array_pat_const.txt @@ -0,0 +1,4 @@ +case :a +in B[c] + :d +end diff --git a/test/prism/fixtures/seattlerb/case_in_array_pat_const2.txt b/test/prism/fixtures/seattlerb/case_in_array_pat_const2.txt new file mode 100644 index 0000000000..fca423ea61 --- /dev/null +++ b/test/prism/fixtures/seattlerb/case_in_array_pat_const2.txt @@ -0,0 +1,4 @@ +case :a +in B::C[d] + :e +end diff --git a/test/prism/fixtures/seattlerb/case_in_array_pat_paren_assign.txt b/test/prism/fixtures/seattlerb/case_in_array_pat_paren_assign.txt new file mode 100644 index 0000000000..c56f728337 --- /dev/null +++ b/test/prism/fixtures/seattlerb/case_in_array_pat_paren_assign.txt @@ -0,0 +1,4 @@ +case :a +in B(C => d) + :d +end diff --git a/test/prism/fixtures/seattlerb/case_in_const.txt b/test/prism/fixtures/seattlerb/case_in_const.txt new file mode 100644 index 0000000000..5b0dcc18e2 --- /dev/null +++ b/test/prism/fixtures/seattlerb/case_in_const.txt @@ -0,0 +1,4 @@ +case Array +in Class + :b +end diff --git a/test/prism/fixtures/seattlerb/case_in_else.txt b/test/prism/fixtures/seattlerb/case_in_else.txt new file mode 100644 index 0000000000..6f096862c5 --- /dev/null +++ b/test/prism/fixtures/seattlerb/case_in_else.txt @@ -0,0 +1,7 @@ +case Array +in Class + :b +else + :c +end + diff --git a/test/prism/fixtures/seattlerb/case_in_find.txt b/test/prism/fixtures/seattlerb/case_in_find.txt new file mode 100644 index 0000000000..476fcabe11 --- /dev/null +++ b/test/prism/fixtures/seattlerb/case_in_find.txt @@ -0,0 +1,3 @@ +case :a + in *a, :+, *b +end diff --git a/test/prism/fixtures/seattlerb/case_in_find_array.txt b/test/prism/fixtures/seattlerb/case_in_find_array.txt new file mode 100644 index 0000000000..5eb4010b7f --- /dev/null +++ b/test/prism/fixtures/seattlerb/case_in_find_array.txt @@ -0,0 +1,3 @@ +case :a +in [*, :b, c, *] +end diff --git a/test/prism/fixtures/seattlerb/case_in_hash_pat.txt b/test/prism/fixtures/seattlerb/case_in_hash_pat.txt new file mode 100644 index 0000000000..cb012e8d99 --- /dev/null +++ b/test/prism/fixtures/seattlerb/case_in_hash_pat.txt @@ -0,0 +1,5 @@ +case :a +in { b: 'c', d: "e" } then + :f +end + diff --git a/test/prism/fixtures/seattlerb/case_in_hash_pat_assign.txt b/test/prism/fixtures/seattlerb/case_in_hash_pat_assign.txt new file mode 100644 index 0000000000..58fd59ff9c --- /dev/null +++ b/test/prism/fixtures/seattlerb/case_in_hash_pat_assign.txt @@ -0,0 +1,4 @@ +case :a +in { b: Integer => x, d: "e", f: } then + :g +end diff --git a/test/prism/fixtures/seattlerb/case_in_hash_pat_paren_assign.txt b/test/prism/fixtures/seattlerb/case_in_hash_pat_paren_assign.txt new file mode 100644 index 0000000000..de3a10740c --- /dev/null +++ b/test/prism/fixtures/seattlerb/case_in_hash_pat_paren_assign.txt @@ -0,0 +1,4 @@ +case :a +in B(a: 42) + :d +end diff --git a/test/prism/fixtures/seattlerb/case_in_hash_pat_paren_true.txt b/test/prism/fixtures/seattlerb/case_in_hash_pat_paren_true.txt new file mode 100644 index 0000000000..449fd0d4d4 --- /dev/null +++ b/test/prism/fixtures/seattlerb/case_in_hash_pat_paren_true.txt @@ -0,0 +1,5 @@ +case :a +in b: true then + :c +end + diff --git a/test/prism/fixtures/seattlerb/case_in_hash_pat_rest.txt b/test/prism/fixtures/seattlerb/case_in_hash_pat_rest.txt new file mode 100644 index 0000000000..6f67cb1d10 --- /dev/null +++ b/test/prism/fixtures/seattlerb/case_in_hash_pat_rest.txt @@ -0,0 +1,3 @@ +case :a +in b: c, **rest then :d +end diff --git a/test/prism/fixtures/seattlerb/case_in_hash_pat_rest_solo.txt b/test/prism/fixtures/seattlerb/case_in_hash_pat_rest_solo.txt new file mode 100644 index 0000000000..91d0592412 --- /dev/null +++ b/test/prism/fixtures/seattlerb/case_in_hash_pat_rest_solo.txt @@ -0,0 +1,3 @@ +case :a +in **rest then :d +end diff --git a/test/prism/fixtures/seattlerb/case_in_if_unless_post_mod.txt b/test/prism/fixtures/seattlerb/case_in_if_unless_post_mod.txt new file mode 100644 index 0000000000..dbe24a5c8a --- /dev/null +++ b/test/prism/fixtures/seattlerb/case_in_if_unless_post_mod.txt @@ -0,0 +1,6 @@ +case :a +in A if true + :C +in D unless false + :E +end diff --git a/test/prism/fixtures/seattlerb/case_in_multiple.txt b/test/prism/fixtures/seattlerb/case_in_multiple.txt new file mode 100644 index 0000000000..1b6dd06cfe --- /dev/null +++ b/test/prism/fixtures/seattlerb/case_in_multiple.txt @@ -0,0 +1,6 @@ +case :a +in A::B + :C +in D::E + :F +end diff --git a/test/prism/fixtures/seattlerb/case_in_or.txt b/test/prism/fixtures/seattlerb/case_in_or.txt new file mode 100644 index 0000000000..875e37749f --- /dev/null +++ b/test/prism/fixtures/seattlerb/case_in_or.txt @@ -0,0 +1,5 @@ +case :a +in B | C + :d +end + diff --git a/test/prism/fixtures/seattlerb/class_comments.txt b/test/prism/fixtures/seattlerb/class_comments.txt new file mode 100644 index 0000000000..9701eca7e5 --- /dev/null +++ b/test/prism/fixtures/seattlerb/class_comments.txt @@ -0,0 +1,9 @@ +# blah 1 +# blah 2 + +class X + # blah 3 + def blah + # blah 4 + end +end diff --git a/test/prism/fixtures/seattlerb/cond_unary_minus.txt b/test/prism/fixtures/seattlerb/cond_unary_minus.txt new file mode 100644 index 0000000000..80293115da --- /dev/null +++ b/test/prism/fixtures/seattlerb/cond_unary_minus.txt @@ -0,0 +1 @@ +if -1; end diff --git a/test/prism/fixtures/seattlerb/const_2_op_asgn_or2.txt b/test/prism/fixtures/seattlerb/const_2_op_asgn_or2.txt new file mode 100644 index 0000000000..6912c2d76b --- /dev/null +++ b/test/prism/fixtures/seattlerb/const_2_op_asgn_or2.txt @@ -0,0 +1 @@ +::X::Y ||= 1 diff --git a/test/prism/fixtures/seattlerb/const_3_op_asgn_or.txt b/test/prism/fixtures/seattlerb/const_3_op_asgn_or.txt new file mode 100644 index 0000000000..bbcd25a369 --- /dev/null +++ b/test/prism/fixtures/seattlerb/const_3_op_asgn_or.txt @@ -0,0 +1 @@ +::X ||= 1 diff --git a/test/prism/fixtures/seattlerb/const_op_asgn_and1.txt b/test/prism/fixtures/seattlerb/const_op_asgn_and1.txt new file mode 100644 index 0000000000..3964df0ead --- /dev/null +++ b/test/prism/fixtures/seattlerb/const_op_asgn_and1.txt @@ -0,0 +1 @@ +::X &= 1 diff --git a/test/prism/fixtures/seattlerb/const_op_asgn_and2.txt b/test/prism/fixtures/seattlerb/const_op_asgn_and2.txt new file mode 100644 index 0000000000..1bef4b4154 --- /dev/null +++ b/test/prism/fixtures/seattlerb/const_op_asgn_and2.txt @@ -0,0 +1 @@ +::X &&= 1 diff --git a/test/prism/fixtures/seattlerb/const_op_asgn_or.txt b/test/prism/fixtures/seattlerb/const_op_asgn_or.txt new file mode 100644 index 0000000000..729e425262 --- /dev/null +++ b/test/prism/fixtures/seattlerb/const_op_asgn_or.txt @@ -0,0 +1 @@ +X::Y ||= 1 diff --git a/test/prism/fixtures/seattlerb/dasgn_icky2.txt b/test/prism/fixtures/seattlerb/dasgn_icky2.txt new file mode 100644 index 0000000000..2f50d32304 --- /dev/null +++ b/test/prism/fixtures/seattlerb/dasgn_icky2.txt @@ -0,0 +1,8 @@ +a do + v = nil + begin + yield + rescue Exception => v + break + end +end diff --git a/test/prism/fixtures/seattlerb/defined_eh_parens.txt b/test/prism/fixtures/seattlerb/defined_eh_parens.txt new file mode 100644 index 0000000000..5ca5d9f4c4 --- /dev/null +++ b/test/prism/fixtures/seattlerb/defined_eh_parens.txt @@ -0,0 +1 @@ +defined?(42) diff --git a/test/prism/fixtures/seattlerb/defn_arg_asplat_arg.txt b/test/prism/fixtures/seattlerb/defn_arg_asplat_arg.txt new file mode 100644 index 0000000000..f629a5de60 --- /dev/null +++ b/test/prism/fixtures/seattlerb/defn_arg_asplat_arg.txt @@ -0,0 +1 @@ +def call(interp, *, args) end diff --git a/test/prism/fixtures/seattlerb/defn_arg_forward_args.txt b/test/prism/fixtures/seattlerb/defn_arg_forward_args.txt new file mode 100644 index 0000000000..500e2e1fe0 --- /dev/null +++ b/test/prism/fixtures/seattlerb/defn_arg_forward_args.txt @@ -0,0 +1 @@ +def a(x, ...); b(x, ...); end diff --git a/test/prism/fixtures/seattlerb/defn_args_forward_args.txt b/test/prism/fixtures/seattlerb/defn_args_forward_args.txt new file mode 100644 index 0000000000..fc1ee138de --- /dev/null +++ b/test/prism/fixtures/seattlerb/defn_args_forward_args.txt @@ -0,0 +1 @@ +def a(x, y, z, ...); b(:get, z, ...); end diff --git a/test/prism/fixtures/seattlerb/defn_comments.txt b/test/prism/fixtures/seattlerb/defn_comments.txt new file mode 100644 index 0000000000..04c7ea1a10 --- /dev/null +++ b/test/prism/fixtures/seattlerb/defn_comments.txt @@ -0,0 +1,5 @@ +# blah 1 +# blah 2 + +def blah +end diff --git a/test/prism/fixtures/seattlerb/defn_endless_command.txt b/test/prism/fixtures/seattlerb/defn_endless_command.txt new file mode 100644 index 0000000000..172de2ca6c --- /dev/null +++ b/test/prism/fixtures/seattlerb/defn_endless_command.txt @@ -0,0 +1 @@ +def some_method = other_method 42 diff --git a/test/prism/fixtures/seattlerb/defn_endless_command_rescue.txt b/test/prism/fixtures/seattlerb/defn_endless_command_rescue.txt new file mode 100644 index 0000000000..05ed392e38 --- /dev/null +++ b/test/prism/fixtures/seattlerb/defn_endless_command_rescue.txt @@ -0,0 +1 @@ +def some_method = other_method 42 rescue 24 diff --git a/test/prism/fixtures/seattlerb/defn_forward_args.txt b/test/prism/fixtures/seattlerb/defn_forward_args.txt new file mode 100644 index 0000000000..46ed199875 --- /dev/null +++ b/test/prism/fixtures/seattlerb/defn_forward_args.txt @@ -0,0 +1 @@ +def a(...); b(...); end diff --git a/test/prism/fixtures/seattlerb/defn_forward_args__no_parens.txt b/test/prism/fixtures/seattlerb/defn_forward_args__no_parens.txt new file mode 100644 index 0000000000..2d34077c93 --- /dev/null +++ b/test/prism/fixtures/seattlerb/defn_forward_args__no_parens.txt @@ -0,0 +1,3 @@ +def f ... + m(...) +end diff --git a/test/prism/fixtures/seattlerb/defn_kwarg_env.txt b/test/prism/fixtures/seattlerb/defn_kwarg_env.txt new file mode 100644 index 0000000000..b512677195 --- /dev/null +++ b/test/prism/fixtures/seattlerb/defn_kwarg_env.txt @@ -0,0 +1 @@ +def test(**testing) test_splat(**testing) end diff --git a/test/prism/fixtures/seattlerb/defn_kwarg_kwarg.txt b/test/prism/fixtures/seattlerb/defn_kwarg_kwarg.txt new file mode 100644 index 0000000000..3962d2645c --- /dev/null +++ b/test/prism/fixtures/seattlerb/defn_kwarg_kwarg.txt @@ -0,0 +1 @@ +def f(a, b: 1, c: 2) end diff --git a/test/prism/fixtures/seattlerb/defn_kwarg_kwsplat.txt b/test/prism/fixtures/seattlerb/defn_kwarg_kwsplat.txt new file mode 100644 index 0000000000..bd39819482 --- /dev/null +++ b/test/prism/fixtures/seattlerb/defn_kwarg_kwsplat.txt @@ -0,0 +1 @@ +def a(b: 1, **c) end diff --git a/test/prism/fixtures/seattlerb/defn_kwarg_kwsplat_anon.txt b/test/prism/fixtures/seattlerb/defn_kwarg_kwsplat_anon.txt new file mode 100644 index 0000000000..aba71cba07 --- /dev/null +++ b/test/prism/fixtures/seattlerb/defn_kwarg_kwsplat_anon.txt @@ -0,0 +1 @@ +def a(b: 1, **) end diff --git a/test/prism/fixtures/seattlerb/defn_kwarg_lvar.txt b/test/prism/fixtures/seattlerb/defn_kwarg_lvar.txt new file mode 100644 index 0000000000..9eac108cca --- /dev/null +++ b/test/prism/fixtures/seattlerb/defn_kwarg_lvar.txt @@ -0,0 +1 @@ +def fun(kw: :val); kw; end diff --git a/test/prism/fixtures/seattlerb/defn_kwarg_no_parens.txt b/test/prism/fixtures/seattlerb/defn_kwarg_no_parens.txt new file mode 100644 index 0000000000..481457bf0e --- /dev/null +++ b/test/prism/fixtures/seattlerb/defn_kwarg_no_parens.txt @@ -0,0 +1,2 @@ +def f a: 1 +end diff --git a/test/prism/fixtures/seattlerb/defn_kwarg_val.txt b/test/prism/fixtures/seattlerb/defn_kwarg_val.txt new file mode 100644 index 0000000000..1a2803926f --- /dev/null +++ b/test/prism/fixtures/seattlerb/defn_kwarg_val.txt @@ -0,0 +1 @@ +def f(a, b:1) end diff --git a/test/prism/fixtures/seattlerb/defn_no_kwargs.txt b/test/prism/fixtures/seattlerb/defn_no_kwargs.txt new file mode 100644 index 0000000000..857ec8debb --- /dev/null +++ b/test/prism/fixtures/seattlerb/defn_no_kwargs.txt @@ -0,0 +1 @@ +def x(**nil); end diff --git a/test/prism/fixtures/seattlerb/defn_oneliner.txt b/test/prism/fixtures/seattlerb/defn_oneliner.txt new file mode 100644 index 0000000000..4aef08ce46 --- /dev/null +++ b/test/prism/fixtures/seattlerb/defn_oneliner.txt @@ -0,0 +1 @@ +def exec(cmd) = system(cmd) diff --git a/test/prism/fixtures/seattlerb/defn_oneliner_eq2.txt b/test/prism/fixtures/seattlerb/defn_oneliner_eq2.txt new file mode 100644 index 0000000000..1b1ce27a15 --- /dev/null +++ b/test/prism/fixtures/seattlerb/defn_oneliner_eq2.txt @@ -0,0 +1,3 @@ +class X + def ==(o) = 42 +end diff --git a/test/prism/fixtures/seattlerb/defn_oneliner_noargs.txt b/test/prism/fixtures/seattlerb/defn_oneliner_noargs.txt new file mode 100644 index 0000000000..cb4f76d244 --- /dev/null +++ b/test/prism/fixtures/seattlerb/defn_oneliner_noargs.txt @@ -0,0 +1 @@ +def exec = system diff --git a/test/prism/fixtures/seattlerb/defn_oneliner_noargs_parentheses.txt b/test/prism/fixtures/seattlerb/defn_oneliner_noargs_parentheses.txt new file mode 100644 index 0000000000..c582e896c1 --- /dev/null +++ b/test/prism/fixtures/seattlerb/defn_oneliner_noargs_parentheses.txt @@ -0,0 +1 @@ +def exec() = system diff --git a/test/prism/fixtures/seattlerb/defn_oneliner_rescue.txt b/test/prism/fixtures/seattlerb/defn_oneliner_rescue.txt new file mode 100644 index 0000000000..ffe2228c9d --- /dev/null +++ b/test/prism/fixtures/seattlerb/defn_oneliner_rescue.txt @@ -0,0 +1,13 @@ +def exec(cmd) + system(cmd) +rescue + nil +end + + +def exec(cmd) + system(cmd) rescue nil +end + + +def exec(cmd) = system(cmd) rescue nil diff --git a/test/prism/fixtures/seattlerb/defn_opt_last_arg.txt b/test/prism/fixtures/seattlerb/defn_opt_last_arg.txt new file mode 100644 index 0000000000..91500bf137 --- /dev/null +++ b/test/prism/fixtures/seattlerb/defn_opt_last_arg.txt @@ -0,0 +1,2 @@ +def m arg = false +end diff --git a/test/prism/fixtures/seattlerb/defn_opt_reg.txt b/test/prism/fixtures/seattlerb/defn_opt_reg.txt new file mode 100644 index 0000000000..c665674bc4 --- /dev/null +++ b/test/prism/fixtures/seattlerb/defn_opt_reg.txt @@ -0,0 +1 @@ +def f(a=nil, b) end diff --git a/test/prism/fixtures/seattlerb/defn_opt_splat_arg.txt b/test/prism/fixtures/seattlerb/defn_opt_splat_arg.txt new file mode 100644 index 0000000000..876398b478 --- /dev/null +++ b/test/prism/fixtures/seattlerb/defn_opt_splat_arg.txt @@ -0,0 +1 @@ +def f (a = 1, *b, c) end diff --git a/test/prism/fixtures/seattlerb/defn_powarg.txt b/test/prism/fixtures/seattlerb/defn_powarg.txt new file mode 100644 index 0000000000..73415f0db9 --- /dev/null +++ b/test/prism/fixtures/seattlerb/defn_powarg.txt @@ -0,0 +1 @@ +def f(**opts) end diff --git a/test/prism/fixtures/seattlerb/defn_reg_opt_reg.txt b/test/prism/fixtures/seattlerb/defn_reg_opt_reg.txt new file mode 100644 index 0000000000..69f501a38e --- /dev/null +++ b/test/prism/fixtures/seattlerb/defn_reg_opt_reg.txt @@ -0,0 +1 @@ +def f(a, b = :c, d) end diff --git a/test/prism/fixtures/seattlerb/defn_splat_arg.txt b/test/prism/fixtures/seattlerb/defn_splat_arg.txt new file mode 100644 index 0000000000..a2a84bed30 --- /dev/null +++ b/test/prism/fixtures/seattlerb/defn_splat_arg.txt @@ -0,0 +1 @@ +def f(*, a) end diff --git a/test/prism/fixtures/seattlerb/defn_unary_not.txt b/test/prism/fixtures/seattlerb/defn_unary_not.txt new file mode 100644 index 0000000000..fb83c84a13 --- /dev/null +++ b/test/prism/fixtures/seattlerb/defn_unary_not.txt @@ -0,0 +1 @@ +def !@; true; end diff --git a/test/prism/fixtures/seattlerb/defns_reserved.txt b/test/prism/fixtures/seattlerb/defns_reserved.txt new file mode 100644 index 0000000000..7de9322f0d --- /dev/null +++ b/test/prism/fixtures/seattlerb/defns_reserved.txt @@ -0,0 +1 @@ +def self.return; end diff --git a/test/prism/fixtures/seattlerb/defs_as_arg_with_do_block_inside.txt b/test/prism/fixtures/seattlerb/defs_as_arg_with_do_block_inside.txt new file mode 100644 index 0000000000..4d493d73dd --- /dev/null +++ b/test/prism/fixtures/seattlerb/defs_as_arg_with_do_block_inside.txt @@ -0,0 +1 @@ +p def self.b; x.y do; end; end diff --git a/test/prism/fixtures/seattlerb/defs_comments.txt b/test/prism/fixtures/seattlerb/defs_comments.txt new file mode 100644 index 0000000000..52b9b4a6b3 --- /dev/null +++ b/test/prism/fixtures/seattlerb/defs_comments.txt @@ -0,0 +1,5 @@ +# blah 1 +# blah 2 + +def self.blah +end diff --git a/test/prism/fixtures/seattlerb/defs_endless_command.txt b/test/prism/fixtures/seattlerb/defs_endless_command.txt new file mode 100644 index 0000000000..3b605657de --- /dev/null +++ b/test/prism/fixtures/seattlerb/defs_endless_command.txt @@ -0,0 +1 @@ +def x.some_method = other_method 42 diff --git a/test/prism/fixtures/seattlerb/defs_endless_command_rescue.txt b/test/prism/fixtures/seattlerb/defs_endless_command_rescue.txt new file mode 100644 index 0000000000..6ece366db0 --- /dev/null +++ b/test/prism/fixtures/seattlerb/defs_endless_command_rescue.txt @@ -0,0 +1 @@ +def x.some_method = other_method 42 rescue 24 diff --git a/test/prism/fixtures/seattlerb/defs_kwarg.txt b/test/prism/fixtures/seattlerb/defs_kwarg.txt new file mode 100644 index 0000000000..59970a371e --- /dev/null +++ b/test/prism/fixtures/seattlerb/defs_kwarg.txt @@ -0,0 +1,2 @@ +def self.a b: 1 +end diff --git a/test/prism/fixtures/seattlerb/defs_oneliner.txt b/test/prism/fixtures/seattlerb/defs_oneliner.txt new file mode 100644 index 0000000000..1867edcfbf --- /dev/null +++ b/test/prism/fixtures/seattlerb/defs_oneliner.txt @@ -0,0 +1 @@ +def self.exec(cmd) = system(cmd) diff --git a/test/prism/fixtures/seattlerb/defs_oneliner_eq2.txt b/test/prism/fixtures/seattlerb/defs_oneliner_eq2.txt new file mode 100644 index 0000000000..1e55f68bf3 --- /dev/null +++ b/test/prism/fixtures/seattlerb/defs_oneliner_eq2.txt @@ -0,0 +1,3 @@ +class X + def self.==(o) = 42 +end diff --git a/test/prism/fixtures/seattlerb/defs_oneliner_rescue.txt b/test/prism/fixtures/seattlerb/defs_oneliner_rescue.txt new file mode 100644 index 0000000000..7a04012b8f --- /dev/null +++ b/test/prism/fixtures/seattlerb/defs_oneliner_rescue.txt @@ -0,0 +1,13 @@ +def self.exec(cmd) + system(cmd) +rescue + nil +end + + +def self.exec(cmd) + system(cmd) rescue nil +end + + +def self.exec(cmd) = system(cmd) rescue nil diff --git a/test/prism/fixtures/seattlerb/difficult0_.txt b/test/prism/fixtures/seattlerb/difficult0_.txt new file mode 100644 index 0000000000..5c73907cae --- /dev/null +++ b/test/prism/fixtures/seattlerb/difficult0_.txt @@ -0,0 +1,4 @@ +p <<-END+'b + a + END + c'+'d' diff --git a/test/prism/fixtures/seattlerb/difficult1_line_numbers.txt b/test/prism/fixtures/seattlerb/difficult1_line_numbers.txt new file mode 100644 index 0000000000..8008127dc9 --- /dev/null +++ b/test/prism/fixtures/seattlerb/difficult1_line_numbers.txt @@ -0,0 +1,13 @@ +if true + p 1 + a.b 2 + c.d 3, 4 + e.f 5 + g.h 6, 7 + p(1) + a.b(2) + c.d(3, 4) + e.f(5) + g.h(6, 7) +end + diff --git a/test/prism/fixtures/seattlerb/difficult1_line_numbers2.txt b/test/prism/fixtures/seattlerb/difficult1_line_numbers2.txt new file mode 100644 index 0000000000..1964562416 --- /dev/null +++ b/test/prism/fixtures/seattlerb/difficult1_line_numbers2.txt @@ -0,0 +1,8 @@ +if true then + p("a") + b = 1 + p b + c =1 +end +a + diff --git a/test/prism/fixtures/seattlerb/difficult2_.txt b/test/prism/fixtures/seattlerb/difficult2_.txt new file mode 100644 index 0000000000..3259097492 --- /dev/null +++ b/test/prism/fixtures/seattlerb/difficult2_.txt @@ -0,0 +1,2 @@ +1 ? b('') : 2 +a d: 3 diff --git a/test/prism/fixtures/seattlerb/difficult3_.txt b/test/prism/fixtures/seattlerb/difficult3_.txt new file mode 100644 index 0000000000..9f95860b82 --- /dev/null +++ b/test/prism/fixtures/seattlerb/difficult3_.txt @@ -0,0 +1 @@ +f { |a, (b, *c)| } diff --git a/test/prism/fixtures/seattlerb/difficult3_2.txt b/test/prism/fixtures/seattlerb/difficult3_2.txt new file mode 100644 index 0000000000..8abfe3f634 --- /dev/null +++ b/test/prism/fixtures/seattlerb/difficult3_2.txt @@ -0,0 +1 @@ +f { |*a, b| } diff --git a/test/prism/fixtures/seattlerb/difficult3_3.txt b/test/prism/fixtures/seattlerb/difficult3_3.txt new file mode 100644 index 0000000000..6f43ab7b1d --- /dev/null +++ b/test/prism/fixtures/seattlerb/difficult3_3.txt @@ -0,0 +1 @@ +f { |*a, b, &c| } diff --git a/test/prism/fixtures/seattlerb/difficult3_4.txt b/test/prism/fixtures/seattlerb/difficult3_4.txt new file mode 100644 index 0000000000..7070e1e964 --- /dev/null +++ b/test/prism/fixtures/seattlerb/difficult3_4.txt @@ -0,0 +1 @@ +a=b ? true: false diff --git a/test/prism/fixtures/seattlerb/difficult3_5.txt b/test/prism/fixtures/seattlerb/difficult3_5.txt new file mode 100644 index 0000000000..6d52692481 --- /dev/null +++ b/test/prism/fixtures/seattlerb/difficult3_5.txt @@ -0,0 +1 @@ +f ->() { g do end } diff --git a/test/prism/fixtures/seattlerb/difficult3__10.txt b/test/prism/fixtures/seattlerb/difficult3__10.txt new file mode 100644 index 0000000000..89974f5114 --- /dev/null +++ b/test/prism/fixtures/seattlerb/difficult3__10.txt @@ -0,0 +1 @@ +f { |a, (*b, c)| } diff --git a/test/prism/fixtures/seattlerb/difficult3__11.txt b/test/prism/fixtures/seattlerb/difficult3__11.txt new file mode 100644 index 0000000000..911d037961 --- /dev/null +++ b/test/prism/fixtures/seattlerb/difficult3__11.txt @@ -0,0 +1 @@ +f { |a, (*)| } diff --git a/test/prism/fixtures/seattlerb/difficult3__12.txt b/test/prism/fixtures/seattlerb/difficult3__12.txt new file mode 100644 index 0000000000..2405a80ec1 --- /dev/null +++ b/test/prism/fixtures/seattlerb/difficult3__12.txt @@ -0,0 +1 @@ +f { |a, (*, b)| } diff --git a/test/prism/fixtures/seattlerb/difficult3__6.txt b/test/prism/fixtures/seattlerb/difficult3__6.txt new file mode 100644 index 0000000000..3a45ae86fb --- /dev/null +++ b/test/prism/fixtures/seattlerb/difficult3__6.txt @@ -0,0 +1 @@ +f { |a, (b, *c, d)| } diff --git a/test/prism/fixtures/seattlerb/difficult3__7.txt b/test/prism/fixtures/seattlerb/difficult3__7.txt new file mode 100644 index 0000000000..55272a1fc4 --- /dev/null +++ b/test/prism/fixtures/seattlerb/difficult3__7.txt @@ -0,0 +1 @@ +f { |a, (b, *)| } diff --git a/test/prism/fixtures/seattlerb/difficult3__8.txt b/test/prism/fixtures/seattlerb/difficult3__8.txt new file mode 100644 index 0000000000..76740db4ff --- /dev/null +++ b/test/prism/fixtures/seattlerb/difficult3__8.txt @@ -0,0 +1 @@ +f { |a, (b, *, c)| } diff --git a/test/prism/fixtures/seattlerb/difficult3__9.txt b/test/prism/fixtures/seattlerb/difficult3__9.txt new file mode 100644 index 0000000000..b65f7fd052 --- /dev/null +++ b/test/prism/fixtures/seattlerb/difficult3__9.txt @@ -0,0 +1 @@ +f { |a, (*b)| } diff --git a/test/prism/fixtures/seattlerb/difficult4__leading_dots.txt b/test/prism/fixtures/seattlerb/difficult4__leading_dots.txt new file mode 100644 index 0000000000..332dc8225c --- /dev/null +++ b/test/prism/fixtures/seattlerb/difficult4__leading_dots.txt @@ -0,0 +1,2 @@ +a +.b diff --git a/test/prism/fixtures/seattlerb/difficult4__leading_dots2.txt b/test/prism/fixtures/seattlerb/difficult4__leading_dots2.txt new file mode 100644 index 0000000000..fe73f641fe --- /dev/null +++ b/test/prism/fixtures/seattlerb/difficult4__leading_dots2.txt @@ -0,0 +1,2 @@ +1 +..3 diff --git a/test/prism/fixtures/seattlerb/difficult6_.txt b/test/prism/fixtures/seattlerb/difficult6_.txt new file mode 100644 index 0000000000..7396a9a76f --- /dev/null +++ b/test/prism/fixtures/seattlerb/difficult6_.txt @@ -0,0 +1 @@ +->(a, b=nil) { p [a, b] } diff --git a/test/prism/fixtures/seattlerb/difficult6__7.txt b/test/prism/fixtures/seattlerb/difficult6__7.txt new file mode 100644 index 0000000000..048358bbdc --- /dev/null +++ b/test/prism/fixtures/seattlerb/difficult6__7.txt @@ -0,0 +1 @@ +a.b (1) {c} diff --git a/test/prism/fixtures/seattlerb/difficult6__8.txt b/test/prism/fixtures/seattlerb/difficult6__8.txt new file mode 100644 index 0000000000..ba1cbc235d --- /dev/null +++ b/test/prism/fixtures/seattlerb/difficult6__8.txt @@ -0,0 +1 @@ +a::b (1) {c} diff --git a/test/prism/fixtures/seattlerb/difficult7_.txt b/test/prism/fixtures/seattlerb/difficult7_.txt new file mode 100644 index 0000000000..112b75c5f2 --- /dev/null +++ b/test/prism/fixtures/seattlerb/difficult7_.txt @@ -0,0 +1,5 @@ + { + a: lambda { b ? c() : d }, + e: nil, + } + diff --git a/test/prism/fixtures/seattlerb/do_bug.txt b/test/prism/fixtures/seattlerb/do_bug.txt new file mode 100644 index 0000000000..a274e72baf --- /dev/null +++ b/test/prism/fixtures/seattlerb/do_bug.txt @@ -0,0 +1,4 @@ +a 1 +a.b do |c| + # do nothing +end diff --git a/test/prism/fixtures/seattlerb/do_lambda.txt b/test/prism/fixtures/seattlerb/do_lambda.txt new file mode 100644 index 0000000000..06d2a38d30 --- /dev/null +++ b/test/prism/fixtures/seattlerb/do_lambda.txt @@ -0,0 +1 @@ +->() do end diff --git a/test/prism/fixtures/seattlerb/dot2_nil__26.txt b/test/prism/fixtures/seattlerb/dot2_nil__26.txt new file mode 100644 index 0000000000..cc070eb69f --- /dev/null +++ b/test/prism/fixtures/seattlerb/dot2_nil__26.txt @@ -0,0 +1 @@ +a.. diff --git a/test/prism/fixtures/seattlerb/dot3_nil__26.txt b/test/prism/fixtures/seattlerb/dot3_nil__26.txt new file mode 100644 index 0000000000..7f4aef7af7 --- /dev/null +++ b/test/prism/fixtures/seattlerb/dot3_nil__26.txt @@ -0,0 +1 @@ +a... diff --git a/test/prism/fixtures/seattlerb/dstr_evstr.txt b/test/prism/fixtures/seattlerb/dstr_evstr.txt new file mode 100644 index 0000000000..5fe4a858c1 --- /dev/null +++ b/test/prism/fixtures/seattlerb/dstr_evstr.txt @@ -0,0 +1 @@ +"#{'a'}#{b}" diff --git a/test/prism/fixtures/seattlerb/dstr_evstr_empty_end.txt b/test/prism/fixtures/seattlerb/dstr_evstr_empty_end.txt new file mode 100644 index 0000000000..7a55030fa8 --- /dev/null +++ b/test/prism/fixtures/seattlerb/dstr_evstr_empty_end.txt @@ -0,0 +1 @@ +:"#{field}" diff --git a/test/prism/fixtures/seattlerb/dstr_lex_state.txt b/test/prism/fixtures/seattlerb/dstr_lex_state.txt new file mode 100644 index 0000000000..6cac1d8e95 --- /dev/null +++ b/test/prism/fixtures/seattlerb/dstr_lex_state.txt @@ -0,0 +1 @@ +"#{p:a}" diff --git a/test/prism/fixtures/seattlerb/dstr_str.txt b/test/prism/fixtures/seattlerb/dstr_str.txt new file mode 100644 index 0000000000..226ce2b191 --- /dev/null +++ b/test/prism/fixtures/seattlerb/dstr_str.txt @@ -0,0 +1 @@ +"#{'a'} b" diff --git a/test/prism/fixtures/seattlerb/dsym_esc_to_sym.txt b/test/prism/fixtures/seattlerb/dsym_esc_to_sym.txt new file mode 100644 index 0000000000..e5781453c1 --- /dev/null +++ b/test/prism/fixtures/seattlerb/dsym_esc_to_sym.txt @@ -0,0 +1 @@ +:"Variet\303\240" diff --git a/test/prism/fixtures/seattlerb/dsym_to_sym.txt b/test/prism/fixtures/seattlerb/dsym_to_sym.txt new file mode 100644 index 0000000000..813c90342c --- /dev/null +++ b/test/prism/fixtures/seattlerb/dsym_to_sym.txt @@ -0,0 +1,3 @@ +alias :"<<" :">>" + +alias :<< :>> diff --git a/test/prism/fixtures/seattlerb/eq_begin_line_numbers.txt b/test/prism/fixtures/seattlerb/eq_begin_line_numbers.txt new file mode 100644 index 0000000000..aae82e1207 --- /dev/null +++ b/test/prism/fixtures/seattlerb/eq_begin_line_numbers.txt @@ -0,0 +1,6 @@ +1 +=begin +comment +comment +=end +2 diff --git a/test/prism/fixtures/seattlerb/eq_begin_why_wont_people_use_their_spacebar.txt b/test/prism/fixtures/seattlerb/eq_begin_why_wont_people_use_their_spacebar.txt new file mode 100644 index 0000000000..88ff599e91 --- /dev/null +++ b/test/prism/fixtures/seattlerb/eq_begin_why_wont_people_use_their_spacebar.txt @@ -0,0 +1,3 @@ +h[k]=begin + 42 + end diff --git a/test/prism/fixtures/seattlerb/evstr_evstr.txt b/test/prism/fixtures/seattlerb/evstr_evstr.txt new file mode 100644 index 0000000000..cf0b5ee873 --- /dev/null +++ b/test/prism/fixtures/seattlerb/evstr_evstr.txt @@ -0,0 +1 @@ +"#{a}#{b}" diff --git a/test/prism/fixtures/seattlerb/evstr_str.txt b/test/prism/fixtures/seattlerb/evstr_str.txt new file mode 100644 index 0000000000..5746909b19 --- /dev/null +++ b/test/prism/fixtures/seattlerb/evstr_str.txt @@ -0,0 +1 @@ +"#{a} b" diff --git a/test/prism/fixtures/seattlerb/expr_not_bang.txt b/test/prism/fixtures/seattlerb/expr_not_bang.txt new file mode 100644 index 0000000000..6ed80c76d3 --- /dev/null +++ b/test/prism/fixtures/seattlerb/expr_not_bang.txt @@ -0,0 +1 @@ +! a b diff --git a/test/prism/fixtures/seattlerb/f_kw.txt b/test/prism/fixtures/seattlerb/f_kw.txt new file mode 100644 index 0000000000..4dd42662b8 --- /dev/null +++ b/test/prism/fixtures/seattlerb/f_kw.txt @@ -0,0 +1 @@ +def x k:42; end diff --git a/test/prism/fixtures/seattlerb/f_kw__required.txt b/test/prism/fixtures/seattlerb/f_kw__required.txt new file mode 100644 index 0000000000..2e1e258ff0 --- /dev/null +++ b/test/prism/fixtures/seattlerb/f_kw__required.txt @@ -0,0 +1 @@ +def x k:; end diff --git a/test/prism/fixtures/seattlerb/flip2_env_lvar.txt b/test/prism/fixtures/seattlerb/flip2_env_lvar.txt new file mode 100644 index 0000000000..619b2c915e --- /dev/null +++ b/test/prism/fixtures/seattlerb/flip2_env_lvar.txt @@ -0,0 +1 @@ +if a..b then end diff --git a/test/prism/fixtures/seattlerb/float_with_if_modifier.txt b/test/prism/fixtures/seattlerb/float_with_if_modifier.txt new file mode 100644 index 0000000000..6a62d4a308 --- /dev/null +++ b/test/prism/fixtures/seattlerb/float_with_if_modifier.txt @@ -0,0 +1 @@ +1.0if true diff --git a/test/prism/fixtures/seattlerb/heredoc__backslash_dos_format.txt b/test/prism/fixtures/seattlerb/heredoc__backslash_dos_format.txt new file mode 100644 index 0000000000..cfbcb2a11d --- /dev/null +++ b/test/prism/fixtures/seattlerb/heredoc__backslash_dos_format.txt @@ -0,0 +1,5 @@ +str = <<-XXX
+before\
+after
+XXX
+ diff --git a/test/prism/fixtures/seattlerb/heredoc_backslash_nl.txt b/test/prism/fixtures/seattlerb/heredoc_backslash_nl.txt new file mode 100644 index 0000000000..0cc5b35fd5 --- /dev/null +++ b/test/prism/fixtures/seattlerb/heredoc_backslash_nl.txt @@ -0,0 +1,8 @@ +" why would someone do this? \ + blah +" + +<<-DESC + why would someone do this? \ + blah +DESC diff --git a/test/prism/fixtures/seattlerb/heredoc_bad_hex_escape.txt b/test/prism/fixtures/seattlerb/heredoc_bad_hex_escape.txt new file mode 100644 index 0000000000..2c386cc6a9 --- /dev/null +++ b/test/prism/fixtures/seattlerb/heredoc_bad_hex_escape.txt @@ -0,0 +1,3 @@ +s = <<eos +a\xE9b +eos diff --git a/test/prism/fixtures/seattlerb/heredoc_bad_oct_escape.txt b/test/prism/fixtures/seattlerb/heredoc_bad_oct_escape.txt new file mode 100644 index 0000000000..235a041e90 --- /dev/null +++ b/test/prism/fixtures/seattlerb/heredoc_bad_oct_escape.txt @@ -0,0 +1,5 @@ +s = <<-EOS +a\247b +cöd +EOS + diff --git a/test/prism/fixtures/seattlerb/heredoc_comma_arg.txt b/test/prism/fixtures/seattlerb/heredoc_comma_arg.txt new file mode 100644 index 0000000000..c230b12f65 --- /dev/null +++ b/test/prism/fixtures/seattlerb/heredoc_comma_arg.txt @@ -0,0 +1,7 @@ +[" some text +",] + +[<<-FILE, + some text +FILE +] diff --git a/test/prism/fixtures/seattlerb/heredoc_lineno.txt b/test/prism/fixtures/seattlerb/heredoc_lineno.txt new file mode 100644 index 0000000000..73a2e3806b --- /dev/null +++ b/test/prism/fixtures/seattlerb/heredoc_lineno.txt @@ -0,0 +1,7 @@ +c = <<'CCC' +line2 +line3 +line4 +CCC + +d = 42 diff --git a/test/prism/fixtures/seattlerb/heredoc_nested.txt b/test/prism/fixtures/seattlerb/heredoc_nested.txt new file mode 100644 index 0000000000..508d6d3c05 --- /dev/null +++ b/test/prism/fixtures/seattlerb/heredoc_nested.txt @@ -0,0 +1,7 @@ +[<<A, +#{<<B} +b +B +a +A +0] diff --git a/test/prism/fixtures/seattlerb/heredoc_squiggly.txt b/test/prism/fixtures/seattlerb/heredoc_squiggly.txt new file mode 100644 index 0000000000..e630ff62b4 --- /dev/null +++ b/test/prism/fixtures/seattlerb/heredoc_squiggly.txt @@ -0,0 +1,7 @@ +a = <<~"EOF" + x + y + z + EOF + + diff --git a/test/prism/fixtures/seattlerb/heredoc_squiggly_blank_line_plus_interpolation.txt b/test/prism/fixtures/seattlerb/heredoc_squiggly_blank_line_plus_interpolation.txt new file mode 100644 index 0000000000..61b62157db --- /dev/null +++ b/test/prism/fixtures/seattlerb/heredoc_squiggly_blank_line_plus_interpolation.txt @@ -0,0 +1,4 @@ +a = foo(<<~EOF.chop) + + #{bar}baz + EOF diff --git a/test/prism/fixtures/seattlerb/heredoc_squiggly_blank_lines.txt b/test/prism/fixtures/seattlerb/heredoc_squiggly_blank_lines.txt new file mode 100644 index 0000000000..0d89134c87 --- /dev/null +++ b/test/prism/fixtures/seattlerb/heredoc_squiggly_blank_lines.txt @@ -0,0 +1,7 @@ +a = <<~EOF + x + + z +EOF + + diff --git a/test/prism/fixtures/seattlerb/heredoc_squiggly_empty.txt b/test/prism/fixtures/seattlerb/heredoc_squiggly_empty.txt new file mode 100644 index 0000000000..4602d757fb --- /dev/null +++ b/test/prism/fixtures/seattlerb/heredoc_squiggly_empty.txt @@ -0,0 +1,2 @@ +<<~A +A diff --git a/test/prism/fixtures/seattlerb/heredoc_squiggly_interp.txt b/test/prism/fixtures/seattlerb/heredoc_squiggly_interp.txt new file mode 100644 index 0000000000..47ff3c9070 --- /dev/null +++ b/test/prism/fixtures/seattlerb/heredoc_squiggly_interp.txt @@ -0,0 +1,5 @@ +a = <<~EOF + w + x#{42} y + z + EOF diff --git a/test/prism/fixtures/seattlerb/heredoc_squiggly_no_indent.txt b/test/prism/fixtures/seattlerb/heredoc_squiggly_no_indent.txt new file mode 100644 index 0000000000..7076f6ef71 --- /dev/null +++ b/test/prism/fixtures/seattlerb/heredoc_squiggly_no_indent.txt @@ -0,0 +1,3 @@ +<<~A +a +A diff --git a/test/prism/fixtures/seattlerb/heredoc_squiggly_tabs.txt b/test/prism/fixtures/seattlerb/heredoc_squiggly_tabs.txt new file mode 100644 index 0000000000..b193f0473b --- /dev/null +++ b/test/prism/fixtures/seattlerb/heredoc_squiggly_tabs.txt @@ -0,0 +1,6 @@ +a = <<~"EOF" + blah blah + blah blah + EOF + + diff --git a/test/prism/fixtures/seattlerb/heredoc_squiggly_tabs_extra.txt b/test/prism/fixtures/seattlerb/heredoc_squiggly_tabs_extra.txt new file mode 100644 index 0000000000..5b75dd2b59 --- /dev/null +++ b/test/prism/fixtures/seattlerb/heredoc_squiggly_tabs_extra.txt @@ -0,0 +1,6 @@ +a = <<~"EOF" + blah blah + blah blah + EOF + + diff --git a/test/prism/fixtures/seattlerb/heredoc_squiggly_visually_blank_lines.txt b/test/prism/fixtures/seattlerb/heredoc_squiggly_visually_blank_lines.txt new file mode 100644 index 0000000000..3f9198296d --- /dev/null +++ b/test/prism/fixtures/seattlerb/heredoc_squiggly_visually_blank_lines.txt @@ -0,0 +1,7 @@ +a = <<~EOF + x + + z +EOF + + diff --git a/test/prism/fixtures/seattlerb/heredoc_trailing_slash_continued_call.txt b/test/prism/fixtures/seattlerb/heredoc_trailing_slash_continued_call.txt new file mode 100644 index 0000000000..12c8fac126 --- /dev/null +++ b/test/prism/fixtures/seattlerb/heredoc_trailing_slash_continued_call.txt @@ -0,0 +1,4 @@ +<<END\ +blah +END +.strip diff --git a/test/prism/fixtures/seattlerb/heredoc_unicode.txt b/test/prism/fixtures/seattlerb/heredoc_unicode.txt new file mode 100644 index 0000000000..216a5cfe24 --- /dev/null +++ b/test/prism/fixtures/seattlerb/heredoc_unicode.txt @@ -0,0 +1,4 @@ +<<OOTPÜT +. +OOTPÜT + diff --git a/test/prism/fixtures/seattlerb/heredoc_with_carriage_return_escapes.txt b/test/prism/fixtures/seattlerb/heredoc_with_carriage_return_escapes.txt new file mode 100644 index 0000000000..cb4967d154 --- /dev/null +++ b/test/prism/fixtures/seattlerb/heredoc_with_carriage_return_escapes.txt @@ -0,0 +1,5 @@ +<<EOS +foo\rbar +baz\r +EOS + diff --git a/test/prism/fixtures/seattlerb/heredoc_with_carriage_return_escapes_windows.txt b/test/prism/fixtures/seattlerb/heredoc_with_carriage_return_escapes_windows.txt new file mode 100644 index 0000000000..75ed936b5d --- /dev/null +++ b/test/prism/fixtures/seattlerb/heredoc_with_carriage_return_escapes_windows.txt @@ -0,0 +1,5 @@ +<<EOS
+foo\rbar
+baz\r
+EOS
+ diff --git a/test/prism/fixtures/seattlerb/heredoc_with_extra_carriage_horrible_mix.txt b/test/prism/fixtures/seattlerb/heredoc_with_extra_carriage_horrible_mix.txt new file mode 100644 index 0000000000..1c58c05cc5 --- /dev/null +++ b/test/prism/fixtures/seattlerb/heredoc_with_extra_carriage_horrible_mix.txt @@ -0,0 +1,4 @@ +<<'eot'
+body
+eot + diff --git a/test/prism/fixtures/seattlerb/heredoc_with_extra_carriage_returns.txt b/test/prism/fixtures/seattlerb/heredoc_with_extra_carriage_returns.txt new file mode 100644 index 0000000000..706cb0d5c0 --- /dev/null +++ b/test/prism/fixtures/seattlerb/heredoc_with_extra_carriage_returns.txt @@ -0,0 +1,5 @@ +<<EOS +foo
bar
+baz +EOS + diff --git a/test/prism/fixtures/seattlerb/heredoc_with_extra_carriage_returns_windows.txt b/test/prism/fixtures/seattlerb/heredoc_with_extra_carriage_returns_windows.txt new file mode 100644 index 0000000000..8ed84799b1 --- /dev/null +++ b/test/prism/fixtures/seattlerb/heredoc_with_extra_carriage_returns_windows.txt @@ -0,0 +1,5 @@ +<<EOS
+foo
bar
+baz
+EOS
+ diff --git a/test/prism/fixtures/seattlerb/heredoc_with_interpolation_and_carriage_return_escapes.txt b/test/prism/fixtures/seattlerb/heredoc_with_interpolation_and_carriage_return_escapes.txt new file mode 100644 index 0000000000..250e606f45 --- /dev/null +++ b/test/prism/fixtures/seattlerb/heredoc_with_interpolation_and_carriage_return_escapes.txt @@ -0,0 +1,4 @@ +<<EOS +foo\r#@bar +EOS + diff --git a/test/prism/fixtures/seattlerb/heredoc_with_interpolation_and_carriage_return_escapes_windows.txt b/test/prism/fixtures/seattlerb/heredoc_with_interpolation_and_carriage_return_escapes_windows.txt new file mode 100644 index 0000000000..12f97aff5e --- /dev/null +++ b/test/prism/fixtures/seattlerb/heredoc_with_interpolation_and_carriage_return_escapes_windows.txt @@ -0,0 +1,4 @@ +<<EOS
+foo\r#@bar
+EOS
+ diff --git a/test/prism/fixtures/seattlerb/heredoc_with_not_global_interpolation.txt b/test/prism/fixtures/seattlerb/heredoc_with_not_global_interpolation.txt new file mode 100644 index 0000000000..f94c2c9e27 --- /dev/null +++ b/test/prism/fixtures/seattlerb/heredoc_with_not_global_interpolation.txt @@ -0,0 +1,3 @@ +<<-HEREDOC +#${ +HEREDOC diff --git a/test/prism/fixtures/seattlerb/heredoc_with_only_carriage_returns.txt b/test/prism/fixtures/seattlerb/heredoc_with_only_carriage_returns.txt new file mode 100644 index 0000000000..468ba85cf7 --- /dev/null +++ b/test/prism/fixtures/seattlerb/heredoc_with_only_carriage_returns.txt @@ -0,0 +1,6 @@ +<<EOS +
+
+\r +EOS + diff --git a/test/prism/fixtures/seattlerb/heredoc_with_only_carriage_returns_windows.txt b/test/prism/fixtures/seattlerb/heredoc_with_only_carriage_returns_windows.txt new file mode 100644 index 0000000000..e973eff110 --- /dev/null +++ b/test/prism/fixtures/seattlerb/heredoc_with_only_carriage_returns_windows.txt @@ -0,0 +1,6 @@ +<<EOS
+
+
+\r
+EOS
+ diff --git a/test/prism/fixtures/seattlerb/if_elsif.txt b/test/prism/fixtures/seattlerb/if_elsif.txt new file mode 100644 index 0000000000..bc1c0a2b3d --- /dev/null +++ b/test/prism/fixtures/seattlerb/if_elsif.txt @@ -0,0 +1 @@ +if 1; elsif 2; end diff --git a/test/prism/fixtures/seattlerb/if_symbol.txt b/test/prism/fixtures/seattlerb/if_symbol.txt new file mode 100644 index 0000000000..8d6e958ede --- /dev/null +++ b/test/prism/fixtures/seattlerb/if_symbol.txt @@ -0,0 +1 @@ +if f :x; end diff --git a/test/prism/fixtures/seattlerb/in_expr_no_case.txt b/test/prism/fixtures/seattlerb/in_expr_no_case.txt new file mode 100644 index 0000000000..40db7f868b --- /dev/null +++ b/test/prism/fixtures/seattlerb/in_expr_no_case.txt @@ -0,0 +1 @@ +'woot' in String diff --git a/test/prism/fixtures/seattlerb/index_0.txt b/test/prism/fixtures/seattlerb/index_0.txt new file mode 100644 index 0000000000..050d4566ba --- /dev/null +++ b/test/prism/fixtures/seattlerb/index_0.txt @@ -0,0 +1 @@ +a[] = b diff --git a/test/prism/fixtures/seattlerb/index_0_opasgn.txt b/test/prism/fixtures/seattlerb/index_0_opasgn.txt new file mode 100644 index 0000000000..7189f0c3ea --- /dev/null +++ b/test/prism/fixtures/seattlerb/index_0_opasgn.txt @@ -0,0 +1 @@ +a[] += b diff --git a/test/prism/fixtures/seattlerb/integer_with_if_modifier.txt b/test/prism/fixtures/seattlerb/integer_with_if_modifier.txt new file mode 100644 index 0000000000..bf2f621e92 --- /dev/null +++ b/test/prism/fixtures/seattlerb/integer_with_if_modifier.txt @@ -0,0 +1 @@ +1_234if true diff --git a/test/prism/fixtures/seattlerb/interpolated_symbol_array_line_breaks.txt b/test/prism/fixtures/seattlerb/interpolated_symbol_array_line_breaks.txt new file mode 100644 index 0000000000..f4c7cb9662 --- /dev/null +++ b/test/prism/fixtures/seattlerb/interpolated_symbol_array_line_breaks.txt @@ -0,0 +1,5 @@ +%I( +a +b +) +1 diff --git a/test/prism/fixtures/seattlerb/interpolated_word_array_line_breaks.txt b/test/prism/fixtures/seattlerb/interpolated_word_array_line_breaks.txt new file mode 100644 index 0000000000..d52b4789cf --- /dev/null +++ b/test/prism/fixtures/seattlerb/interpolated_word_array_line_breaks.txt @@ -0,0 +1,5 @@ +%W( +a +b +) +1 diff --git a/test/prism/fixtures/seattlerb/iter_args_1.txt b/test/prism/fixtures/seattlerb/iter_args_1.txt new file mode 100644 index 0000000000..c890ef62c3 --- /dev/null +++ b/test/prism/fixtures/seattlerb/iter_args_1.txt @@ -0,0 +1 @@ +f { |a,b| } diff --git a/test/prism/fixtures/seattlerb/iter_args_10_1.txt b/test/prism/fixtures/seattlerb/iter_args_10_1.txt new file mode 100644 index 0000000000..3f558c5392 --- /dev/null +++ b/test/prism/fixtures/seattlerb/iter_args_10_1.txt @@ -0,0 +1 @@ +f { |a, b = 42, *c| } diff --git a/test/prism/fixtures/seattlerb/iter_args_10_2.txt b/test/prism/fixtures/seattlerb/iter_args_10_2.txt new file mode 100644 index 0000000000..4158e79d14 --- /dev/null +++ b/test/prism/fixtures/seattlerb/iter_args_10_2.txt @@ -0,0 +1 @@ +f { |a, b = 42, *c, &d| } diff --git a/test/prism/fixtures/seattlerb/iter_args_11_1.txt b/test/prism/fixtures/seattlerb/iter_args_11_1.txt new file mode 100644 index 0000000000..f86175c1a0 --- /dev/null +++ b/test/prism/fixtures/seattlerb/iter_args_11_1.txt @@ -0,0 +1 @@ +f { |a, b = 42, *c, d| } diff --git a/test/prism/fixtures/seattlerb/iter_args_11_2.txt b/test/prism/fixtures/seattlerb/iter_args_11_2.txt new file mode 100644 index 0000000000..e4b017e44a --- /dev/null +++ b/test/prism/fixtures/seattlerb/iter_args_11_2.txt @@ -0,0 +1 @@ +f { |a, b = 42, *c, d, &e| } diff --git a/test/prism/fixtures/seattlerb/iter_args_2__19.txt b/test/prism/fixtures/seattlerb/iter_args_2__19.txt new file mode 100644 index 0000000000..84dd744243 --- /dev/null +++ b/test/prism/fixtures/seattlerb/iter_args_2__19.txt @@ -0,0 +1 @@ +f { |(a, b)| } diff --git a/test/prism/fixtures/seattlerb/iter_args_3.txt b/test/prism/fixtures/seattlerb/iter_args_3.txt new file mode 100644 index 0000000000..261968ff13 --- /dev/null +++ b/test/prism/fixtures/seattlerb/iter_args_3.txt @@ -0,0 +1 @@ +f { |a, (b, c), d| } diff --git a/test/prism/fixtures/seattlerb/iter_args_4.txt b/test/prism/fixtures/seattlerb/iter_args_4.txt new file mode 100644 index 0000000000..7db4d43ad3 --- /dev/null +++ b/test/prism/fixtures/seattlerb/iter_args_4.txt @@ -0,0 +1 @@ +f { |a, *b, c| } diff --git a/test/prism/fixtures/seattlerb/iter_args_5.txt b/test/prism/fixtures/seattlerb/iter_args_5.txt new file mode 100644 index 0000000000..088fcdfcc5 --- /dev/null +++ b/test/prism/fixtures/seattlerb/iter_args_5.txt @@ -0,0 +1 @@ +f { |a, &b| } diff --git a/test/prism/fixtures/seattlerb/iter_args_6.txt b/test/prism/fixtures/seattlerb/iter_args_6.txt new file mode 100644 index 0000000000..e980ec064b --- /dev/null +++ b/test/prism/fixtures/seattlerb/iter_args_6.txt @@ -0,0 +1 @@ +f { |a, b=42, c| } diff --git a/test/prism/fixtures/seattlerb/iter_args_7_1.txt b/test/prism/fixtures/seattlerb/iter_args_7_1.txt new file mode 100644 index 0000000000..e1dbf4b312 --- /dev/null +++ b/test/prism/fixtures/seattlerb/iter_args_7_1.txt @@ -0,0 +1 @@ +f { |a = 42, *b| } diff --git a/test/prism/fixtures/seattlerb/iter_args_7_2.txt b/test/prism/fixtures/seattlerb/iter_args_7_2.txt new file mode 100644 index 0000000000..e46e78e00e --- /dev/null +++ b/test/prism/fixtures/seattlerb/iter_args_7_2.txt @@ -0,0 +1 @@ +f { |a = 42, *b, &c| } diff --git a/test/prism/fixtures/seattlerb/iter_args_8_1.txt b/test/prism/fixtures/seattlerb/iter_args_8_1.txt new file mode 100644 index 0000000000..a0ec82ea5b --- /dev/null +++ b/test/prism/fixtures/seattlerb/iter_args_8_1.txt @@ -0,0 +1 @@ +f { |a = 42, *b, c| } diff --git a/test/prism/fixtures/seattlerb/iter_args_8_2.txt b/test/prism/fixtures/seattlerb/iter_args_8_2.txt new file mode 100644 index 0000000000..a1839fe706 --- /dev/null +++ b/test/prism/fixtures/seattlerb/iter_args_8_2.txt @@ -0,0 +1 @@ +f { |a = 42, *b, c, &d| } diff --git a/test/prism/fixtures/seattlerb/iter_args_9_1.txt b/test/prism/fixtures/seattlerb/iter_args_9_1.txt new file mode 100644 index 0000000000..13e5b20fe7 --- /dev/null +++ b/test/prism/fixtures/seattlerb/iter_args_9_1.txt @@ -0,0 +1 @@ +f { |a = 42, b| } diff --git a/test/prism/fixtures/seattlerb/iter_args_9_2.txt b/test/prism/fixtures/seattlerb/iter_args_9_2.txt new file mode 100644 index 0000000000..83f6e1e029 --- /dev/null +++ b/test/prism/fixtures/seattlerb/iter_args_9_2.txt @@ -0,0 +1 @@ +f { |a = 42, b, &c| } diff --git a/test/prism/fixtures/seattlerb/iter_kwarg.txt b/test/prism/fixtures/seattlerb/iter_kwarg.txt new file mode 100644 index 0000000000..d4296cad76 --- /dev/null +++ b/test/prism/fixtures/seattlerb/iter_kwarg.txt @@ -0,0 +1 @@ +a { |b: 1| } diff --git a/test/prism/fixtures/seattlerb/iter_kwarg_kwsplat.txt b/test/prism/fixtures/seattlerb/iter_kwarg_kwsplat.txt new file mode 100644 index 0000000000..dd0ea13a6f --- /dev/null +++ b/test/prism/fixtures/seattlerb/iter_kwarg_kwsplat.txt @@ -0,0 +1 @@ +a { |b: 1, **c| } diff --git a/test/prism/fixtures/seattlerb/label_vs_string.txt b/test/prism/fixtures/seattlerb/label_vs_string.txt new file mode 100644 index 0000000000..27ba8b64de --- /dev/null +++ b/test/prism/fixtures/seattlerb/label_vs_string.txt @@ -0,0 +1,2 @@ +_buf << ': +' diff --git a/test/prism/fixtures/seattlerb/lambda_do_vs_brace.txt b/test/prism/fixtures/seattlerb/lambda_do_vs_brace.txt new file mode 100644 index 0000000000..bbf663a46a --- /dev/null +++ b/test/prism/fixtures/seattlerb/lambda_do_vs_brace.txt @@ -0,0 +1,7 @@ +f -> do end + +f -> {} + +f ->() do end + +f ->() {} diff --git a/test/prism/fixtures/seattlerb/lasgn_arg_rescue_arg.txt b/test/prism/fixtures/seattlerb/lasgn_arg_rescue_arg.txt new file mode 100644 index 0000000000..0dad496c28 --- /dev/null +++ b/test/prism/fixtures/seattlerb/lasgn_arg_rescue_arg.txt @@ -0,0 +1 @@ +a = 1 rescue 2 diff --git a/test/prism/fixtures/seattlerb/lasgn_call_bracket_rescue_arg.txt b/test/prism/fixtures/seattlerb/lasgn_call_bracket_rescue_arg.txt new file mode 100644 index 0000000000..3f63c0b748 --- /dev/null +++ b/test/prism/fixtures/seattlerb/lasgn_call_bracket_rescue_arg.txt @@ -0,0 +1 @@ +a = b(1) rescue 2 diff --git a/test/prism/fixtures/seattlerb/lasgn_call_nobracket_rescue_arg.txt b/test/prism/fixtures/seattlerb/lasgn_call_nobracket_rescue_arg.txt new file mode 100644 index 0000000000..0e86f1587d --- /dev/null +++ b/test/prism/fixtures/seattlerb/lasgn_call_nobracket_rescue_arg.txt @@ -0,0 +1 @@ +a = b 1 rescue 2 diff --git a/test/prism/fixtures/seattlerb/lasgn_command.txt b/test/prism/fixtures/seattlerb/lasgn_command.txt new file mode 100644 index 0000000000..aca35b880c --- /dev/null +++ b/test/prism/fixtures/seattlerb/lasgn_command.txt @@ -0,0 +1 @@ +a = b.c 1 diff --git a/test/prism/fixtures/seattlerb/lasgn_env.txt b/test/prism/fixtures/seattlerb/lasgn_env.txt new file mode 100644 index 0000000000..aec10273e5 --- /dev/null +++ b/test/prism/fixtures/seattlerb/lasgn_env.txt @@ -0,0 +1 @@ +a = 42 diff --git a/test/prism/fixtures/seattlerb/lasgn_ivar_env.txt b/test/prism/fixtures/seattlerb/lasgn_ivar_env.txt new file mode 100644 index 0000000000..2fa8471c01 --- /dev/null +++ b/test/prism/fixtures/seattlerb/lasgn_ivar_env.txt @@ -0,0 +1 @@ +@a = 42 diff --git a/test/prism/fixtures/seattlerb/lasgn_lasgn_command_call.txt b/test/prism/fixtures/seattlerb/lasgn_lasgn_command_call.txt new file mode 100644 index 0000000000..5147131852 --- /dev/null +++ b/test/prism/fixtures/seattlerb/lasgn_lasgn_command_call.txt @@ -0,0 +1 @@ +a = b = c 1 diff --git a/test/prism/fixtures/seattlerb/lasgn_middle_splat.txt b/test/prism/fixtures/seattlerb/lasgn_middle_splat.txt new file mode 100644 index 0000000000..bb378ca680 --- /dev/null +++ b/test/prism/fixtures/seattlerb/lasgn_middle_splat.txt @@ -0,0 +1 @@ +a = b, *c, d diff --git a/test/prism/fixtures/seattlerb/magic_encoding_comment.txt b/test/prism/fixtures/seattlerb/magic_encoding_comment.txt new file mode 100644 index 0000000000..a02711ea05 --- /dev/null +++ b/test/prism/fixtures/seattlerb/magic_encoding_comment.txt @@ -0,0 +1,4 @@ +# encoding: utf-8 +class ExampleUTF8ClassNameVarietà; def self.è; così = :però; end +end + diff --git a/test/prism/fixtures/seattlerb/masgn_anon_splat_arg.txt b/test/prism/fixtures/seattlerb/masgn_anon_splat_arg.txt new file mode 100644 index 0000000000..b796a742ed --- /dev/null +++ b/test/prism/fixtures/seattlerb/masgn_anon_splat_arg.txt @@ -0,0 +1 @@ +*, a = b diff --git a/test/prism/fixtures/seattlerb/masgn_arg_colon_arg.txt b/test/prism/fixtures/seattlerb/masgn_arg_colon_arg.txt new file mode 100644 index 0000000000..e0919793d4 --- /dev/null +++ b/test/prism/fixtures/seattlerb/masgn_arg_colon_arg.txt @@ -0,0 +1 @@ +a, b::c = d diff --git a/test/prism/fixtures/seattlerb/masgn_arg_ident.txt b/test/prism/fixtures/seattlerb/masgn_arg_ident.txt new file mode 100644 index 0000000000..45f248d854 --- /dev/null +++ b/test/prism/fixtures/seattlerb/masgn_arg_ident.txt @@ -0,0 +1 @@ +a, b.C = d diff --git a/test/prism/fixtures/seattlerb/masgn_arg_splat_arg.txt b/test/prism/fixtures/seattlerb/masgn_arg_splat_arg.txt new file mode 100644 index 0000000000..05fe7c4d5f --- /dev/null +++ b/test/prism/fixtures/seattlerb/masgn_arg_splat_arg.txt @@ -0,0 +1 @@ +a, *b, c = d diff --git a/test/prism/fixtures/seattlerb/masgn_colon2.txt b/test/prism/fixtures/seattlerb/masgn_colon2.txt new file mode 100644 index 0000000000..4e4f838d7d --- /dev/null +++ b/test/prism/fixtures/seattlerb/masgn_colon2.txt @@ -0,0 +1 @@ +a, b::C = 1, 2 diff --git a/test/prism/fixtures/seattlerb/masgn_colon3.txt b/test/prism/fixtures/seattlerb/masgn_colon3.txt new file mode 100644 index 0000000000..46098ba8c5 --- /dev/null +++ b/test/prism/fixtures/seattlerb/masgn_colon3.txt @@ -0,0 +1 @@ +::A, ::B = 1, 2 diff --git a/test/prism/fixtures/seattlerb/masgn_command_call.txt b/test/prism/fixtures/seattlerb/masgn_command_call.txt new file mode 100644 index 0000000000..6da01e8a31 --- /dev/null +++ b/test/prism/fixtures/seattlerb/masgn_command_call.txt @@ -0,0 +1 @@ +a, = b.c 1 diff --git a/test/prism/fixtures/seattlerb/masgn_double_paren.txt b/test/prism/fixtures/seattlerb/masgn_double_paren.txt new file mode 100644 index 0000000000..ffac0a85a3 --- /dev/null +++ b/test/prism/fixtures/seattlerb/masgn_double_paren.txt @@ -0,0 +1 @@ +((a,b))=c diff --git a/test/prism/fixtures/seattlerb/masgn_lhs_splat.txt b/test/prism/fixtures/seattlerb/masgn_lhs_splat.txt new file mode 100644 index 0000000000..2419ef1671 --- /dev/null +++ b/test/prism/fixtures/seattlerb/masgn_lhs_splat.txt @@ -0,0 +1 @@ +*a = 1, 2, 3 diff --git a/test/prism/fixtures/seattlerb/masgn_paren.txt b/test/prism/fixtures/seattlerb/masgn_paren.txt new file mode 100644 index 0000000000..3889b9ff48 --- /dev/null +++ b/test/prism/fixtures/seattlerb/masgn_paren.txt @@ -0,0 +1 @@ +(a, b) = c.d diff --git a/test/prism/fixtures/seattlerb/masgn_splat_arg.txt b/test/prism/fixtures/seattlerb/masgn_splat_arg.txt new file mode 100644 index 0000000000..a7c91425b0 --- /dev/null +++ b/test/prism/fixtures/seattlerb/masgn_splat_arg.txt @@ -0,0 +1 @@ +*a, b = c diff --git a/test/prism/fixtures/seattlerb/masgn_splat_arg_arg.txt b/test/prism/fixtures/seattlerb/masgn_splat_arg_arg.txt new file mode 100644 index 0000000000..46196bd703 --- /dev/null +++ b/test/prism/fixtures/seattlerb/masgn_splat_arg_arg.txt @@ -0,0 +1 @@ +*a, b, c = d diff --git a/test/prism/fixtures/seattlerb/masgn_star.txt b/test/prism/fixtures/seattlerb/masgn_star.txt new file mode 100644 index 0000000000..c5eea37de2 --- /dev/null +++ b/test/prism/fixtures/seattlerb/masgn_star.txt @@ -0,0 +1 @@ +* = 1 diff --git a/test/prism/fixtures/seattlerb/masgn_var_star_var.txt b/test/prism/fixtures/seattlerb/masgn_var_star_var.txt new file mode 100644 index 0000000000..04089c36ac --- /dev/null +++ b/test/prism/fixtures/seattlerb/masgn_var_star_var.txt @@ -0,0 +1 @@ +a, *, b = c diff --git a/test/prism/fixtures/seattlerb/messy_op_asgn_lineno.txt b/test/prism/fixtures/seattlerb/messy_op_asgn_lineno.txt new file mode 100644 index 0000000000..a7d1035ae3 --- /dev/null +++ b/test/prism/fixtures/seattlerb/messy_op_asgn_lineno.txt @@ -0,0 +1 @@ +a (B::C *= d e) diff --git a/test/prism/fixtures/seattlerb/method_call_assoc_trailing_comma.txt b/test/prism/fixtures/seattlerb/method_call_assoc_trailing_comma.txt new file mode 100644 index 0000000000..86f0fbdfc9 --- /dev/null +++ b/test/prism/fixtures/seattlerb/method_call_assoc_trailing_comma.txt @@ -0,0 +1 @@ +a.f(1=>2,) diff --git a/test/prism/fixtures/seattlerb/method_call_trailing_comma.txt b/test/prism/fixtures/seattlerb/method_call_trailing_comma.txt new file mode 100644 index 0000000000..1a155fba12 --- /dev/null +++ b/test/prism/fixtures/seattlerb/method_call_trailing_comma.txt @@ -0,0 +1 @@ +a.f(1,) diff --git a/test/prism/fixtures/seattlerb/mlhs_back_anonsplat.txt b/test/prism/fixtures/seattlerb/mlhs_back_anonsplat.txt new file mode 100644 index 0000000000..7389b95563 --- /dev/null +++ b/test/prism/fixtures/seattlerb/mlhs_back_anonsplat.txt @@ -0,0 +1 @@ +a, b, c, * = f diff --git a/test/prism/fixtures/seattlerb/mlhs_back_splat.txt b/test/prism/fixtures/seattlerb/mlhs_back_splat.txt new file mode 100644 index 0000000000..ec5d23889a --- /dev/null +++ b/test/prism/fixtures/seattlerb/mlhs_back_splat.txt @@ -0,0 +1 @@ +a, b, c, *s = f diff --git a/test/prism/fixtures/seattlerb/mlhs_front_anonsplat.txt b/test/prism/fixtures/seattlerb/mlhs_front_anonsplat.txt new file mode 100644 index 0000000000..67e569438c --- /dev/null +++ b/test/prism/fixtures/seattlerb/mlhs_front_anonsplat.txt @@ -0,0 +1 @@ +*, x, y, z = f diff --git a/test/prism/fixtures/seattlerb/mlhs_front_splat.txt b/test/prism/fixtures/seattlerb/mlhs_front_splat.txt new file mode 100644 index 0000000000..dabadc382d --- /dev/null +++ b/test/prism/fixtures/seattlerb/mlhs_front_splat.txt @@ -0,0 +1 @@ +*s, x, y, z = f diff --git a/test/prism/fixtures/seattlerb/mlhs_keyword.txt b/test/prism/fixtures/seattlerb/mlhs_keyword.txt new file mode 100644 index 0000000000..899e7f8ed3 --- /dev/null +++ b/test/prism/fixtures/seattlerb/mlhs_keyword.txt @@ -0,0 +1 @@ +a.!=(true, true) diff --git a/test/prism/fixtures/seattlerb/mlhs_mid_anonsplat.txt b/test/prism/fixtures/seattlerb/mlhs_mid_anonsplat.txt new file mode 100644 index 0000000000..a70a7e531b --- /dev/null +++ b/test/prism/fixtures/seattlerb/mlhs_mid_anonsplat.txt @@ -0,0 +1 @@ +a, b, c, *, x, y, z = f diff --git a/test/prism/fixtures/seattlerb/mlhs_mid_splat.txt b/test/prism/fixtures/seattlerb/mlhs_mid_splat.txt new file mode 100644 index 0000000000..2d23fd3966 --- /dev/null +++ b/test/prism/fixtures/seattlerb/mlhs_mid_splat.txt @@ -0,0 +1 @@ +a, b, c, *s, x, y, z = f diff --git a/test/prism/fixtures/seattlerb/mlhs_rescue.txt b/test/prism/fixtures/seattlerb/mlhs_rescue.txt new file mode 100644 index 0000000000..b4c79ae32e --- /dev/null +++ b/test/prism/fixtures/seattlerb/mlhs_rescue.txt @@ -0,0 +1 @@ +a, b = f rescue 42 diff --git a/test/prism/fixtures/seattlerb/module_comments.txt b/test/prism/fixtures/seattlerb/module_comments.txt new file mode 100644 index 0000000000..cecb717c5b --- /dev/null +++ b/test/prism/fixtures/seattlerb/module_comments.txt @@ -0,0 +1,10 @@ +# blah 1 + + # blah 2 + +module X + # blah 3 + def blah + # blah 4 + end +end diff --git a/test/prism/fixtures/seattlerb/multiline_hash_declaration.txt b/test/prism/fixtures/seattlerb/multiline_hash_declaration.txt new file mode 100644 index 0000000000..21530307d2 --- /dev/null +++ b/test/prism/fixtures/seattlerb/multiline_hash_declaration.txt @@ -0,0 +1,8 @@ +f(state: + { +}) + +f(state: { +}) + +f(state: {}) diff --git a/test/prism/fixtures/seattlerb/non_interpolated_symbol_array_line_breaks.txt b/test/prism/fixtures/seattlerb/non_interpolated_symbol_array_line_breaks.txt new file mode 100644 index 0000000000..1e14673f4e --- /dev/null +++ b/test/prism/fixtures/seattlerb/non_interpolated_symbol_array_line_breaks.txt @@ -0,0 +1,5 @@ +%i( +a +b +) +1 diff --git a/test/prism/fixtures/seattlerb/non_interpolated_word_array_line_breaks.txt b/test/prism/fixtures/seattlerb/non_interpolated_word_array_line_breaks.txt new file mode 100644 index 0000000000..79c1418770 --- /dev/null +++ b/test/prism/fixtures/seattlerb/non_interpolated_word_array_line_breaks.txt @@ -0,0 +1,5 @@ +%w( +a +b +) +1 diff --git a/test/prism/fixtures/seattlerb/op_asgn_command_call.txt b/test/prism/fixtures/seattlerb/op_asgn_command_call.txt new file mode 100644 index 0000000000..92c989cb0d --- /dev/null +++ b/test/prism/fixtures/seattlerb/op_asgn_command_call.txt @@ -0,0 +1 @@ +a ||= b.c 2 diff --git a/test/prism/fixtures/seattlerb/op_asgn_dot_ident_command_call.txt b/test/prism/fixtures/seattlerb/op_asgn_dot_ident_command_call.txt new file mode 100644 index 0000000000..89cfccda66 --- /dev/null +++ b/test/prism/fixtures/seattlerb/op_asgn_dot_ident_command_call.txt @@ -0,0 +1 @@ +A.B ||= c 1 diff --git a/test/prism/fixtures/seattlerb/op_asgn_index_command_call.txt b/test/prism/fixtures/seattlerb/op_asgn_index_command_call.txt new file mode 100644 index 0000000000..2bfced81fe --- /dev/null +++ b/test/prism/fixtures/seattlerb/op_asgn_index_command_call.txt @@ -0,0 +1 @@ +a[:b] ||= c 1, 2 diff --git a/test/prism/fixtures/seattlerb/op_asgn_primary_colon_const_command_call.txt b/test/prism/fixtures/seattlerb/op_asgn_primary_colon_const_command_call.txt new file mode 100644 index 0000000000..a567f60e83 --- /dev/null +++ b/test/prism/fixtures/seattlerb/op_asgn_primary_colon_const_command_call.txt @@ -0,0 +1 @@ +A::B *= c d diff --git a/test/prism/fixtures/seattlerb/op_asgn_primary_colon_identifier1.txt b/test/prism/fixtures/seattlerb/op_asgn_primary_colon_identifier1.txt new file mode 100644 index 0000000000..0784b49167 --- /dev/null +++ b/test/prism/fixtures/seattlerb/op_asgn_primary_colon_identifier1.txt @@ -0,0 +1 @@ +A::b += 1 diff --git a/test/prism/fixtures/seattlerb/op_asgn_primary_colon_identifier_command_call.txt b/test/prism/fixtures/seattlerb/op_asgn_primary_colon_identifier_command_call.txt new file mode 100644 index 0000000000..c0f16eb3c1 --- /dev/null +++ b/test/prism/fixtures/seattlerb/op_asgn_primary_colon_identifier_command_call.txt @@ -0,0 +1 @@ +A::b *= c d diff --git a/test/prism/fixtures/seattlerb/op_asgn_val_dot_ident_command_call.txt b/test/prism/fixtures/seattlerb/op_asgn_val_dot_ident_command_call.txt new file mode 100644 index 0000000000..69057abf04 --- /dev/null +++ b/test/prism/fixtures/seattlerb/op_asgn_val_dot_ident_command_call.txt @@ -0,0 +1 @@ +a.b ||= c 1 diff --git a/test/prism/fixtures/seattlerb/parse_def_special_name.txt b/test/prism/fixtures/seattlerb/parse_def_special_name.txt new file mode 100644 index 0000000000..8d7d06c688 --- /dev/null +++ b/test/prism/fixtures/seattlerb/parse_def_special_name.txt @@ -0,0 +1 @@ +def next; end diff --git a/test/prism/fixtures/seattlerb/parse_if_not_canonical.txt b/test/prism/fixtures/seattlerb/parse_if_not_canonical.txt new file mode 100644 index 0000000000..1fd9bb7327 --- /dev/null +++ b/test/prism/fixtures/seattlerb/parse_if_not_canonical.txt @@ -0,0 +1,2 @@ +if not var.nil? then 'foo' else 'bar' +end diff --git a/test/prism/fixtures/seattlerb/parse_if_not_noncanonical.txt b/test/prism/fixtures/seattlerb/parse_if_not_noncanonical.txt new file mode 100644 index 0000000000..1fd9bb7327 --- /dev/null +++ b/test/prism/fixtures/seattlerb/parse_if_not_noncanonical.txt @@ -0,0 +1,2 @@ +if not var.nil? then 'foo' else 'bar' +end diff --git a/test/prism/fixtures/seattlerb/parse_line_block.txt b/test/prism/fixtures/seattlerb/parse_line_block.txt new file mode 100644 index 0000000000..21664649db --- /dev/null +++ b/test/prism/fixtures/seattlerb/parse_line_block.txt @@ -0,0 +1,2 @@ +a = 42 +p a diff --git a/test/prism/fixtures/seattlerb/parse_line_block_inline_comment.txt b/test/prism/fixtures/seattlerb/parse_line_block_inline_comment.txt new file mode 100644 index 0000000000..f55ced714f --- /dev/null +++ b/test/prism/fixtures/seattlerb/parse_line_block_inline_comment.txt @@ -0,0 +1,3 @@ +a +b # comment +c diff --git a/test/prism/fixtures/seattlerb/parse_line_block_inline_comment_leading_newlines.txt b/test/prism/fixtures/seattlerb/parse_line_block_inline_comment_leading_newlines.txt new file mode 100644 index 0000000000..6f1fee62a0 --- /dev/null +++ b/test/prism/fixtures/seattlerb/parse_line_block_inline_comment_leading_newlines.txt @@ -0,0 +1,7 @@ + + + +a +b # comment +# another comment +c diff --git a/test/prism/fixtures/seattlerb/parse_line_block_inline_multiline_comment.txt b/test/prism/fixtures/seattlerb/parse_line_block_inline_multiline_comment.txt new file mode 100644 index 0000000000..b00de34dc0 --- /dev/null +++ b/test/prism/fixtures/seattlerb/parse_line_block_inline_multiline_comment.txt @@ -0,0 +1,4 @@ +a +b # comment +# another comment +c diff --git a/test/prism/fixtures/seattlerb/parse_line_call_ivar_arg_no_parens_line_break.txt b/test/prism/fixtures/seattlerb/parse_line_call_ivar_arg_no_parens_line_break.txt new file mode 100644 index 0000000000..73785eb794 --- /dev/null +++ b/test/prism/fixtures/seattlerb/parse_line_call_ivar_arg_no_parens_line_break.txt @@ -0,0 +1,2 @@ +a @b + diff --git a/test/prism/fixtures/seattlerb/parse_line_call_ivar_line_break_paren.txt b/test/prism/fixtures/seattlerb/parse_line_call_ivar_line_break_paren.txt new file mode 100644 index 0000000000..6f136e6d6f --- /dev/null +++ b/test/prism/fixtures/seattlerb/parse_line_call_ivar_line_break_paren.txt @@ -0,0 +1,2 @@ +a(@b +) diff --git a/test/prism/fixtures/seattlerb/parse_line_call_no_args.txt b/test/prism/fixtures/seattlerb/parse_line_call_no_args.txt new file mode 100644 index 0000000000..7900afd4b8 --- /dev/null +++ b/test/prism/fixtures/seattlerb/parse_line_call_no_args.txt @@ -0,0 +1,3 @@ +f do |x, y| + x + y +end diff --git a/test/prism/fixtures/seattlerb/parse_line_defn_complex.txt b/test/prism/fixtures/seattlerb/parse_line_defn_complex.txt new file mode 100644 index 0000000000..244a8e862b --- /dev/null +++ b/test/prism/fixtures/seattlerb/parse_line_defn_complex.txt @@ -0,0 +1,5 @@ +def x(y) + p(y) + y *= 2 + return y; +end diff --git a/test/prism/fixtures/seattlerb/parse_line_defn_no_parens.txt b/test/prism/fixtures/seattlerb/parse_line_defn_no_parens.txt new file mode 100644 index 0000000000..373ca7fbec --- /dev/null +++ b/test/prism/fixtures/seattlerb/parse_line_defn_no_parens.txt @@ -0,0 +1,6 @@ +def f + +end + +def f +end diff --git a/test/prism/fixtures/seattlerb/parse_line_defn_no_parens_args.txt b/test/prism/fixtures/seattlerb/parse_line_defn_no_parens_args.txt new file mode 100644 index 0000000000..10f004a149 --- /dev/null +++ b/test/prism/fixtures/seattlerb/parse_line_defn_no_parens_args.txt @@ -0,0 +1,2 @@ +def f a +end diff --git a/test/prism/fixtures/seattlerb/parse_line_dot2.txt b/test/prism/fixtures/seattlerb/parse_line_dot2.txt new file mode 100644 index 0000000000..61c7554221 --- /dev/null +++ b/test/prism/fixtures/seattlerb/parse_line_dot2.txt @@ -0,0 +1,5 @@ +0.. +4 +a.. +b +c diff --git a/test/prism/fixtures/seattlerb/parse_line_dot2_open.txt b/test/prism/fixtures/seattlerb/parse_line_dot2_open.txt new file mode 100644 index 0000000000..b3e1e5aaf9 --- /dev/null +++ b/test/prism/fixtures/seattlerb/parse_line_dot2_open.txt @@ -0,0 +1,3 @@ +0.. +; a.. +; c diff --git a/test/prism/fixtures/seattlerb/parse_line_dot3.txt b/test/prism/fixtures/seattlerb/parse_line_dot3.txt new file mode 100644 index 0000000000..d1866b41de --- /dev/null +++ b/test/prism/fixtures/seattlerb/parse_line_dot3.txt @@ -0,0 +1,5 @@ +0... +4 +a... +b +c diff --git a/test/prism/fixtures/seattlerb/parse_line_dot3_open.txt b/test/prism/fixtures/seattlerb/parse_line_dot3_open.txt new file mode 100644 index 0000000000..38e7634b21 --- /dev/null +++ b/test/prism/fixtures/seattlerb/parse_line_dot3_open.txt @@ -0,0 +1,3 @@ +0... +; a... +; c diff --git a/test/prism/fixtures/seattlerb/parse_line_dstr_escaped_newline.txt b/test/prism/fixtures/seattlerb/parse_line_dstr_escaped_newline.txt new file mode 100644 index 0000000000..29c1754915 --- /dev/null +++ b/test/prism/fixtures/seattlerb/parse_line_dstr_escaped_newline.txt @@ -0,0 +1,3 @@ +"a\n#{ +}" +true diff --git a/test/prism/fixtures/seattlerb/parse_line_dstr_soft_newline.txt b/test/prism/fixtures/seattlerb/parse_line_dstr_soft_newline.txt new file mode 100644 index 0000000000..e4dbd7bcb2 --- /dev/null +++ b/test/prism/fixtures/seattlerb/parse_line_dstr_soft_newline.txt @@ -0,0 +1,4 @@ +"a +#{ +}" +true diff --git a/test/prism/fixtures/seattlerb/parse_line_evstr_after_break.txt b/test/prism/fixtures/seattlerb/parse_line_evstr_after_break.txt new file mode 100644 index 0000000000..c1d91a51c4 --- /dev/null +++ b/test/prism/fixtures/seattlerb/parse_line_evstr_after_break.txt @@ -0,0 +1,2 @@ +"a"\ +"#{b}" diff --git a/test/prism/fixtures/seattlerb/parse_line_hash_lit.txt b/test/prism/fixtures/seattlerb/parse_line_hash_lit.txt new file mode 100644 index 0000000000..25f8c90a06 --- /dev/null +++ b/test/prism/fixtures/seattlerb/parse_line_hash_lit.txt @@ -0,0 +1,3 @@ +{ +:s1 => 1, +} diff --git a/test/prism/fixtures/seattlerb/parse_line_heredoc.txt b/test/prism/fixtures/seattlerb/parse_line_heredoc.txt new file mode 100644 index 0000000000..201339534c --- /dev/null +++ b/test/prism/fixtures/seattlerb/parse_line_heredoc.txt @@ -0,0 +1,5 @@ + string = <<-HEREDOC.strip + very long string + HEREDOC + puts string + diff --git a/test/prism/fixtures/seattlerb/parse_line_heredoc_evstr.txt b/test/prism/fixtures/seattlerb/parse_line_heredoc_evstr.txt new file mode 100644 index 0000000000..d50844db4b --- /dev/null +++ b/test/prism/fixtures/seattlerb/parse_line_heredoc_evstr.txt @@ -0,0 +1,4 @@ +<<-A +a +#{b} +A diff --git a/test/prism/fixtures/seattlerb/parse_line_heredoc_hardnewline.txt b/test/prism/fixtures/seattlerb/parse_line_heredoc_hardnewline.txt new file mode 100644 index 0000000000..3fbf0f2c26 --- /dev/null +++ b/test/prism/fixtures/seattlerb/parse_line_heredoc_hardnewline.txt @@ -0,0 +1,7 @@ +<<-EOFOO +\n\n\n\n\n\n\n\n\n +EOFOO + +class Foo +end + diff --git a/test/prism/fixtures/seattlerb/parse_line_heredoc_regexp_chars.txt b/test/prism/fixtures/seattlerb/parse_line_heredoc_regexp_chars.txt new file mode 100644 index 0000000000..5dab9cf4e7 --- /dev/null +++ b/test/prism/fixtures/seattlerb/parse_line_heredoc_regexp_chars.txt @@ -0,0 +1,5 @@ + string = <<-"^D" + very long string + ^D + puts string + diff --git a/test/prism/fixtures/seattlerb/parse_line_iter_call_no_parens.txt b/test/prism/fixtures/seattlerb/parse_line_iter_call_no_parens.txt new file mode 100644 index 0000000000..bf1b33c8a2 --- /dev/null +++ b/test/prism/fixtures/seattlerb/parse_line_iter_call_no_parens.txt @@ -0,0 +1,3 @@ +f a do |x, y| + x + y +end diff --git a/test/prism/fixtures/seattlerb/parse_line_iter_call_parens.txt b/test/prism/fixtures/seattlerb/parse_line_iter_call_parens.txt new file mode 100644 index 0000000000..25e9ea1c67 --- /dev/null +++ b/test/prism/fixtures/seattlerb/parse_line_iter_call_parens.txt @@ -0,0 +1,3 @@ +f(a) do |x, y| + x + y +end diff --git a/test/prism/fixtures/seattlerb/parse_line_multiline_str.txt b/test/prism/fixtures/seattlerb/parse_line_multiline_str.txt new file mode 100644 index 0000000000..cdefb3c9b7 --- /dev/null +++ b/test/prism/fixtures/seattlerb/parse_line_multiline_str.txt @@ -0,0 +1,3 @@ +"a +b" +1 diff --git a/test/prism/fixtures/seattlerb/parse_line_multiline_str_literal_n.txt b/test/prism/fixtures/seattlerb/parse_line_multiline_str_literal_n.txt new file mode 100644 index 0000000000..a179ba8c9c --- /dev/null +++ b/test/prism/fixtures/seattlerb/parse_line_multiline_str_literal_n.txt @@ -0,0 +1,2 @@ +"a\nb" +1 diff --git a/test/prism/fixtures/seattlerb/parse_line_newlines.txt b/test/prism/fixtures/seattlerb/parse_line_newlines.txt new file mode 100644 index 0000000000..28b0c286e8 --- /dev/null +++ b/test/prism/fixtures/seattlerb/parse_line_newlines.txt @@ -0,0 +1,3 @@ +true + + diff --git a/test/prism/fixtures/seattlerb/parse_line_op_asgn.txt b/test/prism/fixtures/seattlerb/parse_line_op_asgn.txt new file mode 100644 index 0000000000..f2691c2ce4 --- /dev/null +++ b/test/prism/fixtures/seattlerb/parse_line_op_asgn.txt @@ -0,0 +1,4 @@ + foo += + bar + baz + diff --git a/test/prism/fixtures/seattlerb/parse_line_postexe.txt b/test/prism/fixtures/seattlerb/parse_line_postexe.txt new file mode 100644 index 0000000000..fd8b318d19 --- /dev/null +++ b/test/prism/fixtures/seattlerb/parse_line_postexe.txt @@ -0,0 +1,3 @@ +END { +foo +} diff --git a/test/prism/fixtures/seattlerb/parse_line_preexe.txt b/test/prism/fixtures/seattlerb/parse_line_preexe.txt new file mode 100644 index 0000000000..b3eda77ebc --- /dev/null +++ b/test/prism/fixtures/seattlerb/parse_line_preexe.txt @@ -0,0 +1,3 @@ +BEGIN { +foo +} diff --git a/test/prism/fixtures/seattlerb/parse_line_rescue.txt b/test/prism/fixtures/seattlerb/parse_line_rescue.txt new file mode 100644 index 0000000000..a583160ce2 --- /dev/null +++ b/test/prism/fixtures/seattlerb/parse_line_rescue.txt @@ -0,0 +1,8 @@ +begin + a +rescue + b +rescue + c +end + diff --git a/test/prism/fixtures/seattlerb/parse_line_return.txt b/test/prism/fixtures/seattlerb/parse_line_return.txt new file mode 100644 index 0000000000..81021c2644 --- /dev/null +++ b/test/prism/fixtures/seattlerb/parse_line_return.txt @@ -0,0 +1,6 @@ + def blah + if true then + return 42 + end + end + diff --git a/test/prism/fixtures/seattlerb/parse_line_str_with_newline_escape.txt b/test/prism/fixtures/seattlerb/parse_line_str_with_newline_escape.txt new file mode 100644 index 0000000000..b2b6bb8234 --- /dev/null +++ b/test/prism/fixtures/seattlerb/parse_line_str_with_newline_escape.txt @@ -0,0 +1 @@ +a("\n", true) diff --git a/test/prism/fixtures/seattlerb/parse_line_to_ary.txt b/test/prism/fixtures/seattlerb/parse_line_to_ary.txt new file mode 100644 index 0000000000..590d0abd14 --- /dev/null +++ b/test/prism/fixtures/seattlerb/parse_line_to_ary.txt @@ -0,0 +1,3 @@ +a, +b = c +d diff --git a/test/prism/fixtures/seattlerb/parse_line_trailing_newlines.txt b/test/prism/fixtures/seattlerb/parse_line_trailing_newlines.txt new file mode 100644 index 0000000000..afa826fb50 --- /dev/null +++ b/test/prism/fixtures/seattlerb/parse_line_trailing_newlines.txt @@ -0,0 +1,2 @@ +a +b diff --git a/test/prism/fixtures/seattlerb/parse_opt_call_args_assocs_comma.txt b/test/prism/fixtures/seattlerb/parse_opt_call_args_assocs_comma.txt new file mode 100644 index 0000000000..649c109ea1 --- /dev/null +++ b/test/prism/fixtures/seattlerb/parse_opt_call_args_assocs_comma.txt @@ -0,0 +1 @@ +1[2=>3,] diff --git a/test/prism/fixtures/seattlerb/parse_opt_call_args_lit_comma.txt b/test/prism/fixtures/seattlerb/parse_opt_call_args_lit_comma.txt new file mode 100644 index 0000000000..741cd4ffd1 --- /dev/null +++ b/test/prism/fixtures/seattlerb/parse_opt_call_args_lit_comma.txt @@ -0,0 +1 @@ +1[2,] diff --git a/test/prism/fixtures/seattlerb/parse_pattern_019.txt b/test/prism/fixtures/seattlerb/parse_pattern_019.txt new file mode 100644 index 0000000000..1e8a75902d --- /dev/null +++ b/test/prism/fixtures/seattlerb/parse_pattern_019.txt @@ -0,0 +1,5 @@ +case 0 +in -1..1 + true +end + diff --git a/test/prism/fixtures/seattlerb/parse_pattern_044.txt b/test/prism/fixtures/seattlerb/parse_pattern_044.txt new file mode 100644 index 0000000000..a6a0ac6c1c --- /dev/null +++ b/test/prism/fixtures/seattlerb/parse_pattern_044.txt @@ -0,0 +1,5 @@ +case obj +in Object[] + true +end + diff --git a/test/prism/fixtures/seattlerb/parse_pattern_051.txt b/test/prism/fixtures/seattlerb/parse_pattern_051.txt new file mode 100644 index 0000000000..b7cf769f50 --- /dev/null +++ b/test/prism/fixtures/seattlerb/parse_pattern_051.txt @@ -0,0 +1,5 @@ +case [0, 1, 2] +in [0, 1,] + true +end + diff --git a/test/prism/fixtures/seattlerb/parse_pattern_058.txt b/test/prism/fixtures/seattlerb/parse_pattern_058.txt new file mode 100644 index 0000000000..bd7537098e --- /dev/null +++ b/test/prism/fixtures/seattlerb/parse_pattern_058.txt @@ -0,0 +1,5 @@ +case {a: 0} +in {a:, **rest} + [a, rest] +end + diff --git a/test/prism/fixtures/seattlerb/parse_pattern_058_2.txt b/test/prism/fixtures/seattlerb/parse_pattern_058_2.txt new file mode 100644 index 0000000000..eb1b3cd8ab --- /dev/null +++ b/test/prism/fixtures/seattlerb/parse_pattern_058_2.txt @@ -0,0 +1,5 @@ +case {a: 0} +in {a:, **} + [a] +end + diff --git a/test/prism/fixtures/seattlerb/parse_pattern_069.txt b/test/prism/fixtures/seattlerb/parse_pattern_069.txt new file mode 100644 index 0000000000..f43dff8959 --- /dev/null +++ b/test/prism/fixtures/seattlerb/parse_pattern_069.txt @@ -0,0 +1,5 @@ +case :a +in Object[b: 1] + 1 +end + diff --git a/test/prism/fixtures/seattlerb/parse_pattern_076.txt b/test/prism/fixtures/seattlerb/parse_pattern_076.txt new file mode 100644 index 0000000000..bb947605b3 --- /dev/null +++ b/test/prism/fixtures/seattlerb/parse_pattern_076.txt @@ -0,0 +1,5 @@ +case {a: 1} +in {a: 1, **nil} + true +end + diff --git a/test/prism/fixtures/seattlerb/parse_until_not_canonical.txt b/test/prism/fixtures/seattlerb/parse_until_not_canonical.txt new file mode 100644 index 0000000000..4de38968dc --- /dev/null +++ b/test/prism/fixtures/seattlerb/parse_until_not_canonical.txt @@ -0,0 +1,3 @@ +until not var.nil? + 'foo' +end diff --git a/test/prism/fixtures/seattlerb/parse_until_not_noncanonical.txt b/test/prism/fixtures/seattlerb/parse_until_not_noncanonical.txt new file mode 100644 index 0000000000..4de38968dc --- /dev/null +++ b/test/prism/fixtures/seattlerb/parse_until_not_noncanonical.txt @@ -0,0 +1,3 @@ +until not var.nil? + 'foo' +end diff --git a/test/prism/fixtures/seattlerb/parse_while_not_canonical.txt b/test/prism/fixtures/seattlerb/parse_while_not_canonical.txt new file mode 100644 index 0000000000..5aa464167f --- /dev/null +++ b/test/prism/fixtures/seattlerb/parse_while_not_canonical.txt @@ -0,0 +1,3 @@ +while not var.nil? + 'foo' +end diff --git a/test/prism/fixtures/seattlerb/parse_while_not_noncanonical.txt b/test/prism/fixtures/seattlerb/parse_while_not_noncanonical.txt new file mode 100644 index 0000000000..5aa464167f --- /dev/null +++ b/test/prism/fixtures/seattlerb/parse_while_not_noncanonical.txt @@ -0,0 +1,3 @@ +while not var.nil? + 'foo' +end diff --git a/test/prism/fixtures/seattlerb/pctW_lineno.txt b/test/prism/fixtures/seattlerb/pctW_lineno.txt new file mode 100644 index 0000000000..b222ff0174 --- /dev/null +++ b/test/prism/fixtures/seattlerb/pctW_lineno.txt @@ -0,0 +1,5 @@ +%W(a\nb +c d +e\ +f +gy h\y i\y) diff --git a/test/prism/fixtures/seattlerb/pct_Q_backslash_nl.txt b/test/prism/fixtures/seattlerb/pct_Q_backslash_nl.txt new file mode 100644 index 0000000000..4420560d2b --- /dev/null +++ b/test/prism/fixtures/seattlerb/pct_Q_backslash_nl.txt @@ -0,0 +1,2 @@ +%q{ \ +} diff --git a/test/prism/fixtures/seattlerb/pct_nl.txt b/test/prism/fixtures/seattlerb/pct_nl.txt new file mode 100644 index 0000000000..2cee1cdd44 --- /dev/null +++ b/test/prism/fixtures/seattlerb/pct_nl.txt @@ -0,0 +1,3 @@ +x = % + + diff --git a/test/prism/fixtures/seattlerb/pct_w_heredoc_interp_nested.txt b/test/prism/fixtures/seattlerb/pct_w_heredoc_interp_nested.txt new file mode 100644 index 0000000000..4e084661bf --- /dev/null +++ b/test/prism/fixtures/seattlerb/pct_w_heredoc_interp_nested.txt @@ -0,0 +1,4 @@ +%W( 1 #{<<A} 3 +2 +A + 4 5 ) diff --git a/test/prism/fixtures/seattlerb/pipe_semicolon.txt b/test/prism/fixtures/seattlerb/pipe_semicolon.txt new file mode 100644 index 0000000000..e692cc434f --- /dev/null +++ b/test/prism/fixtures/seattlerb/pipe_semicolon.txt @@ -0,0 +1 @@ +a.b do | ; c | end diff --git a/test/prism/fixtures/seattlerb/pipe_space.txt b/test/prism/fixtures/seattlerb/pipe_space.txt new file mode 100644 index 0000000000..7f0df799b9 --- /dev/null +++ b/test/prism/fixtures/seattlerb/pipe_space.txt @@ -0,0 +1 @@ +a.b do | | end diff --git a/test/prism/fixtures/seattlerb/qWords_space.txt b/test/prism/fixtures/seattlerb/qWords_space.txt new file mode 100644 index 0000000000..a8299ba3f8 --- /dev/null +++ b/test/prism/fixtures/seattlerb/qWords_space.txt @@ -0,0 +1 @@ +%W( ) diff --git a/test/prism/fixtures/seattlerb/qsymbols.txt b/test/prism/fixtures/seattlerb/qsymbols.txt new file mode 100644 index 0000000000..cb9ff09ae0 --- /dev/null +++ b/test/prism/fixtures/seattlerb/qsymbols.txt @@ -0,0 +1 @@ +%I(a b c) diff --git a/test/prism/fixtures/seattlerb/qsymbols_empty.txt b/test/prism/fixtures/seattlerb/qsymbols_empty.txt new file mode 100644 index 0000000000..10a3279907 --- /dev/null +++ b/test/prism/fixtures/seattlerb/qsymbols_empty.txt @@ -0,0 +1 @@ +%I() diff --git a/test/prism/fixtures/seattlerb/qsymbols_empty_space.txt b/test/prism/fixtures/seattlerb/qsymbols_empty_space.txt new file mode 100644 index 0000000000..819f16ad06 --- /dev/null +++ b/test/prism/fixtures/seattlerb/qsymbols_empty_space.txt @@ -0,0 +1 @@ +%I( ) diff --git a/test/prism/fixtures/seattlerb/qsymbols_interp.txt b/test/prism/fixtures/seattlerb/qsymbols_interp.txt new file mode 100644 index 0000000000..2f34883867 --- /dev/null +++ b/test/prism/fixtures/seattlerb/qsymbols_interp.txt @@ -0,0 +1 @@ +%I(a b#{1+1} c) diff --git a/test/prism/fixtures/seattlerb/quoted_symbol_hash_arg.txt b/test/prism/fixtures/seattlerb/quoted_symbol_hash_arg.txt new file mode 100644 index 0000000000..4f1295ef18 --- /dev/null +++ b/test/prism/fixtures/seattlerb/quoted_symbol_hash_arg.txt @@ -0,0 +1 @@ +puts 'a': {} diff --git a/test/prism/fixtures/seattlerb/quoted_symbol_keys.txt b/test/prism/fixtures/seattlerb/quoted_symbol_keys.txt new file mode 100644 index 0000000000..c6a946723d --- /dev/null +++ b/test/prism/fixtures/seattlerb/quoted_symbol_keys.txt @@ -0,0 +1 @@ +{ 'a': :b } diff --git a/test/prism/fixtures/seattlerb/qw_escape.txt b/test/prism/fixtures/seattlerb/qw_escape.txt new file mode 100644 index 0000000000..a94a0e5dcb --- /dev/null +++ b/test/prism/fixtures/seattlerb/qw_escape.txt @@ -0,0 +1 @@ +%q(\') diff --git a/test/prism/fixtures/seattlerb/qw_escape_term.txt b/test/prism/fixtures/seattlerb/qw_escape_term.txt new file mode 100644 index 0000000000..9734fc3421 --- /dev/null +++ b/test/prism/fixtures/seattlerb/qw_escape_term.txt @@ -0,0 +1 @@ +%q|blah blah \| blah blah| diff --git a/test/prism/fixtures/seattlerb/qwords_empty.txt b/test/prism/fixtures/seattlerb/qwords_empty.txt new file mode 100644 index 0000000000..69cc6679d6 --- /dev/null +++ b/test/prism/fixtures/seattlerb/qwords_empty.txt @@ -0,0 +1 @@ +%w() diff --git a/test/prism/fixtures/seattlerb/read_escape_unicode_curlies.txt b/test/prism/fixtures/seattlerb/read_escape_unicode_curlies.txt new file mode 100644 index 0000000000..427b94cc4d --- /dev/null +++ b/test/prism/fixtures/seattlerb/read_escape_unicode_curlies.txt @@ -0,0 +1 @@ +?\u{00a0} diff --git a/test/prism/fixtures/seattlerb/read_escape_unicode_h4.txt b/test/prism/fixtures/seattlerb/read_escape_unicode_h4.txt new file mode 100644 index 0000000000..71aa7a4347 --- /dev/null +++ b/test/prism/fixtures/seattlerb/read_escape_unicode_h4.txt @@ -0,0 +1 @@ +?\u00a0 diff --git a/test/prism/fixtures/seattlerb/regexp.txt b/test/prism/fixtures/seattlerb/regexp.txt new file mode 100644 index 0000000000..bc06458c5c --- /dev/null +++ b/test/prism/fixtures/seattlerb/regexp.txt @@ -0,0 +1,9 @@ +/wtf/ + +/wtf/m + +/wtf/n + +/wtf/nm + +/wtf/nmnmnmnm diff --git a/test/prism/fixtures/seattlerb/regexp_esc_C_slash.txt b/test/prism/fixtures/seattlerb/regexp_esc_C_slash.txt new file mode 100644 index 0000000000..1fd9207c66 --- /dev/null +++ b/test/prism/fixtures/seattlerb/regexp_esc_C_slash.txt @@ -0,0 +1 @@ +/\cC\d/ diff --git a/test/prism/fixtures/seattlerb/regexp_esc_u.txt b/test/prism/fixtures/seattlerb/regexp_esc_u.txt new file mode 100644 index 0000000000..b91704fb0a --- /dev/null +++ b/test/prism/fixtures/seattlerb/regexp_esc_u.txt @@ -0,0 +1 @@ +/[\u0021-\u0027]/ diff --git a/test/prism/fixtures/seattlerb/regexp_escape_extended.txt b/test/prism/fixtures/seattlerb/regexp_escape_extended.txt new file mode 100644 index 0000000000..73dcbab69c --- /dev/null +++ b/test/prism/fixtures/seattlerb/regexp_escape_extended.txt @@ -0,0 +1 @@ +/\“/ diff --git a/test/prism/fixtures/seattlerb/regexp_unicode_curlies.txt b/test/prism/fixtures/seattlerb/regexp_unicode_curlies.txt new file mode 100644 index 0000000000..5a02bd92ca --- /dev/null +++ b/test/prism/fixtures/seattlerb/regexp_unicode_curlies.txt @@ -0,0 +1,3 @@ +/\u{c0de babe}/ + +/\u{df}/ diff --git a/test/prism/fixtures/seattlerb/required_kwarg_no_value.txt b/test/prism/fixtures/seattlerb/required_kwarg_no_value.txt new file mode 100644 index 0000000000..453bcbb33b --- /dev/null +++ b/test/prism/fixtures/seattlerb/required_kwarg_no_value.txt @@ -0,0 +1,2 @@ +def x a:, b: +end diff --git a/test/prism/fixtures/seattlerb/rescue_do_end_ensure_result.txt b/test/prism/fixtures/seattlerb/rescue_do_end_ensure_result.txt new file mode 100644 index 0000000000..7049be66c5 --- /dev/null +++ b/test/prism/fixtures/seattlerb/rescue_do_end_ensure_result.txt @@ -0,0 +1,5 @@ +proc do + :begin +ensure + :ensure +end.call diff --git a/test/prism/fixtures/seattlerb/rescue_do_end_no_raise.txt b/test/prism/fixtures/seattlerb/rescue_do_end_no_raise.txt new file mode 100644 index 0000000000..5f16ec2f15 --- /dev/null +++ b/test/prism/fixtures/seattlerb/rescue_do_end_no_raise.txt @@ -0,0 +1,9 @@ +tap do + :begin +rescue + :rescue +else + :else +ensure + :ensure +end diff --git a/test/prism/fixtures/seattlerb/rescue_do_end_raised.txt b/test/prism/fixtures/seattlerb/rescue_do_end_raised.txt new file mode 100644 index 0000000000..d04215eb48 --- /dev/null +++ b/test/prism/fixtures/seattlerb/rescue_do_end_raised.txt @@ -0,0 +1,5 @@ +tap do + raise +ensure + :ensure +end diff --git a/test/prism/fixtures/seattlerb/rescue_do_end_rescued.txt b/test/prism/fixtures/seattlerb/rescue_do_end_rescued.txt new file mode 100644 index 0000000000..4b377511f0 --- /dev/null +++ b/test/prism/fixtures/seattlerb/rescue_do_end_rescued.txt @@ -0,0 +1,9 @@ +tap do + raise +rescue + :rescue +else + :else +ensure + :ensure +end diff --git a/test/prism/fixtures/seattlerb/rescue_in_block.txt b/test/prism/fixtures/seattlerb/rescue_in_block.txt new file mode 100644 index 0000000000..c6e834aa1e --- /dev/null +++ b/test/prism/fixtures/seattlerb/rescue_in_block.txt @@ -0,0 +1,4 @@ +blah do +rescue + stuff +end diff --git a/test/prism/fixtures/seattlerb/rescue_parens.txt b/test/prism/fixtures/seattlerb/rescue_parens.txt new file mode 100644 index 0000000000..f0eb4db417 --- /dev/null +++ b/test/prism/fixtures/seattlerb/rescue_parens.txt @@ -0,0 +1 @@ +a (b rescue c) diff --git a/test/prism/fixtures/seattlerb/return_call_assocs.txt b/test/prism/fixtures/seattlerb/return_call_assocs.txt new file mode 100644 index 0000000000..34ea778f17 --- /dev/null +++ b/test/prism/fixtures/seattlerb/return_call_assocs.txt @@ -0,0 +1,11 @@ +return 1, :z => 1 + +return 1, :z => 1, :w => 2 + +return y :z=>1 + +return y z:1 + +return y(z:1) + +return y(z=>1) diff --git a/test/prism/fixtures/seattlerb/rhs_asgn.txt b/test/prism/fixtures/seattlerb/rhs_asgn.txt new file mode 100644 index 0000000000..ca581031e2 --- /dev/null +++ b/test/prism/fixtures/seattlerb/rhs_asgn.txt @@ -0,0 +1 @@ +42 => n diff --git a/test/prism/fixtures/seattlerb/ruby21_numbers.txt b/test/prism/fixtures/seattlerb/ruby21_numbers.txt new file mode 100644 index 0000000000..34ceb63a0c --- /dev/null +++ b/test/prism/fixtures/seattlerb/ruby21_numbers.txt @@ -0,0 +1 @@ +[1i, 2r, 3ri] diff --git a/test/prism/fixtures/seattlerb/safe_attrasgn.txt b/test/prism/fixtures/seattlerb/safe_attrasgn.txt new file mode 100644 index 0000000000..1279e02cfc --- /dev/null +++ b/test/prism/fixtures/seattlerb/safe_attrasgn.txt @@ -0,0 +1 @@ +a&.b = 1 diff --git a/test/prism/fixtures/seattlerb/safe_attrasgn_constant.txt b/test/prism/fixtures/seattlerb/safe_attrasgn_constant.txt new file mode 100644 index 0000000000..3a17ac6bcf --- /dev/null +++ b/test/prism/fixtures/seattlerb/safe_attrasgn_constant.txt @@ -0,0 +1 @@ +a&.B = 1 diff --git a/test/prism/fixtures/seattlerb/safe_call.txt b/test/prism/fixtures/seattlerb/safe_call.txt new file mode 100644 index 0000000000..8ecd27e0fe --- /dev/null +++ b/test/prism/fixtures/seattlerb/safe_call.txt @@ -0,0 +1 @@ +a&.b diff --git a/test/prism/fixtures/seattlerb/safe_call_after_newline.txt b/test/prism/fixtures/seattlerb/safe_call_after_newline.txt new file mode 100644 index 0000000000..58e3fba554 --- /dev/null +++ b/test/prism/fixtures/seattlerb/safe_call_after_newline.txt @@ -0,0 +1,2 @@ +a +&.b diff --git a/test/prism/fixtures/seattlerb/safe_call_dot_parens.txt b/test/prism/fixtures/seattlerb/safe_call_dot_parens.txt new file mode 100644 index 0000000000..5def076640 --- /dev/null +++ b/test/prism/fixtures/seattlerb/safe_call_dot_parens.txt @@ -0,0 +1 @@ +a&.() diff --git a/test/prism/fixtures/seattlerb/safe_call_newline.txt b/test/prism/fixtures/seattlerb/safe_call_newline.txt new file mode 100644 index 0000000000..8778b46585 --- /dev/null +++ b/test/prism/fixtures/seattlerb/safe_call_newline.txt @@ -0,0 +1,2 @@ +a&.b + diff --git a/test/prism/fixtures/seattlerb/safe_call_operator.txt b/test/prism/fixtures/seattlerb/safe_call_operator.txt new file mode 100644 index 0000000000..f3fe2b0392 --- /dev/null +++ b/test/prism/fixtures/seattlerb/safe_call_operator.txt @@ -0,0 +1 @@ +a&.> 1 diff --git a/test/prism/fixtures/seattlerb/safe_call_rhs_newline.txt b/test/prism/fixtures/seattlerb/safe_call_rhs_newline.txt new file mode 100644 index 0000000000..d3b07b77b2 --- /dev/null +++ b/test/prism/fixtures/seattlerb/safe_call_rhs_newline.txt @@ -0,0 +1,2 @@ +c = a&.b + diff --git a/test/prism/fixtures/seattlerb/safe_calls.txt b/test/prism/fixtures/seattlerb/safe_calls.txt new file mode 100644 index 0000000000..eafeace500 --- /dev/null +++ b/test/prism/fixtures/seattlerb/safe_calls.txt @@ -0,0 +1 @@ +a&.b&.c(1) diff --git a/test/prism/fixtures/seattlerb/safe_op_asgn.txt b/test/prism/fixtures/seattlerb/safe_op_asgn.txt new file mode 100644 index 0000000000..8915a1cccf --- /dev/null +++ b/test/prism/fixtures/seattlerb/safe_op_asgn.txt @@ -0,0 +1 @@ +a&.b += x 1 diff --git a/test/prism/fixtures/seattlerb/safe_op_asgn2.txt b/test/prism/fixtures/seattlerb/safe_op_asgn2.txt new file mode 100644 index 0000000000..0960b2548b --- /dev/null +++ b/test/prism/fixtures/seattlerb/safe_op_asgn2.txt @@ -0,0 +1,2 @@ +a&.b ||= +x; diff --git a/test/prism/fixtures/seattlerb/slashy_newlines_within_string.txt b/test/prism/fixtures/seattlerb/slashy_newlines_within_string.txt new file mode 100644 index 0000000000..421989c76f --- /dev/null +++ b/test/prism/fixtures/seattlerb/slashy_newlines_within_string.txt @@ -0,0 +1,7 @@ +puts "hello\ + my\ + dear\ + friend" + +a + b + diff --git a/test/prism/fixtures/seattlerb/stabby_arg_no_paren.txt b/test/prism/fixtures/seattlerb/stabby_arg_no_paren.txt new file mode 100644 index 0000000000..f16bed4ccf --- /dev/null +++ b/test/prism/fixtures/seattlerb/stabby_arg_no_paren.txt @@ -0,0 +1 @@ +->a{} diff --git a/test/prism/fixtures/seattlerb/stabby_arg_opt_splat_arg_block_omfg.txt b/test/prism/fixtures/seattlerb/stabby_arg_opt_splat_arg_block_omfg.txt new file mode 100644 index 0000000000..87a7c5dad3 --- /dev/null +++ b/test/prism/fixtures/seattlerb/stabby_arg_opt_splat_arg_block_omfg.txt @@ -0,0 +1 @@ +->(b, c=1, *d, e, &f){} diff --git a/test/prism/fixtures/seattlerb/stabby_block_iter_call.txt b/test/prism/fixtures/seattlerb/stabby_block_iter_call.txt new file mode 100644 index 0000000000..5e9e3f5527 --- /dev/null +++ b/test/prism/fixtures/seattlerb/stabby_block_iter_call.txt @@ -0,0 +1,4 @@ +x -> () do +a.b do +end +end diff --git a/test/prism/fixtures/seattlerb/stabby_block_iter_call_no_target_with_arg.txt b/test/prism/fixtures/seattlerb/stabby_block_iter_call_no_target_with_arg.txt new file mode 100644 index 0000000000..7235394751 --- /dev/null +++ b/test/prism/fixtures/seattlerb/stabby_block_iter_call_no_target_with_arg.txt @@ -0,0 +1,4 @@ +x -> () do +a(1) do +end +end diff --git a/test/prism/fixtures/seattlerb/stabby_block_kw.txt b/test/prism/fixtures/seattlerb/stabby_block_kw.txt new file mode 100644 index 0000000000..74d9e0a328 --- /dev/null +++ b/test/prism/fixtures/seattlerb/stabby_block_kw.txt @@ -0,0 +1 @@ +-> (k:42) { } diff --git a/test/prism/fixtures/seattlerb/stabby_block_kw__required.txt b/test/prism/fixtures/seattlerb/stabby_block_kw__required.txt new file mode 100644 index 0000000000..bd16ffa73c --- /dev/null +++ b/test/prism/fixtures/seattlerb/stabby_block_kw__required.txt @@ -0,0 +1 @@ +-> (k:) { } diff --git a/test/prism/fixtures/seattlerb/stabby_proc_scope.txt b/test/prism/fixtures/seattlerb/stabby_proc_scope.txt new file mode 100644 index 0000000000..1f7f9ff52b --- /dev/null +++ b/test/prism/fixtures/seattlerb/stabby_proc_scope.txt @@ -0,0 +1 @@ +->(a; b) {} diff --git a/test/prism/fixtures/seattlerb/str_backslashes.txt b/test/prism/fixtures/seattlerb/str_backslashes.txt new file mode 100644 index 0000000000..5fd6da361b --- /dev/null +++ b/test/prism/fixtures/seattlerb/str_backslashes.txt @@ -0,0 +1 @@ +x '\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n' diff --git a/test/prism/fixtures/seattlerb/str_double_double_escaped_newline.txt b/test/prism/fixtures/seattlerb/str_double_double_escaped_newline.txt new file mode 100644 index 0000000000..2b022a55f6 --- /dev/null +++ b/test/prism/fixtures/seattlerb/str_double_double_escaped_newline.txt @@ -0,0 +1 @@ +a "\\n";b diff --git a/test/prism/fixtures/seattlerb/str_double_escaped_newline.txt b/test/prism/fixtures/seattlerb/str_double_escaped_newline.txt new file mode 100644 index 0000000000..e439225344 --- /dev/null +++ b/test/prism/fixtures/seattlerb/str_double_escaped_newline.txt @@ -0,0 +1 @@ +a "\n";b diff --git a/test/prism/fixtures/seattlerb/str_double_newline.txt b/test/prism/fixtures/seattlerb/str_double_newline.txt new file mode 100644 index 0000000000..2d439506ca --- /dev/null +++ b/test/prism/fixtures/seattlerb/str_double_newline.txt @@ -0,0 +1,2 @@ +a " +";b diff --git a/test/prism/fixtures/seattlerb/str_evstr.txt b/test/prism/fixtures/seattlerb/str_evstr.txt new file mode 100644 index 0000000000..86c6d1526d --- /dev/null +++ b/test/prism/fixtures/seattlerb/str_evstr.txt @@ -0,0 +1 @@ +"a #{b}" diff --git a/test/prism/fixtures/seattlerb/str_evstr_escape.txt b/test/prism/fixtures/seattlerb/str_evstr_escape.txt new file mode 100644 index 0000000000..517dfd4778 --- /dev/null +++ b/test/prism/fixtures/seattlerb/str_evstr_escape.txt @@ -0,0 +1 @@ +"a #{b}\302\275" diff --git a/test/prism/fixtures/seattlerb/str_heredoc_interp.txt b/test/prism/fixtures/seattlerb/str_heredoc_interp.txt new file mode 100644 index 0000000000..aa2613008c --- /dev/null +++ b/test/prism/fixtures/seattlerb/str_heredoc_interp.txt @@ -0,0 +1,5 @@ +<<"" +#{x} +blah2 + + diff --git a/test/prism/fixtures/seattlerb/str_interp_ternary_or_label.txt b/test/prism/fixtures/seattlerb/str_interp_ternary_or_label.txt new file mode 100644 index 0000000000..fe6637678f --- /dev/null +++ b/test/prism/fixtures/seattlerb/str_interp_ternary_or_label.txt @@ -0,0 +1 @@ +"#{a.b? ? ""+a+"": ""}" diff --git a/test/prism/fixtures/seattlerb/str_lit_concat_bad_encodings.txt b/test/prism/fixtures/seattlerb/str_lit_concat_bad_encodings.txt new file mode 100644 index 0000000000..f4eb3971bb --- /dev/null +++ b/test/prism/fixtures/seattlerb/str_lit_concat_bad_encodings.txt @@ -0,0 +1,2 @@ +"\xE3\xD3\x8B\xE3\x83\xBC\x83\xE3\x83\xE3\x82\xB3\xA3\x82\x99" \ + "\xE3\x83\xB3\xE3\x83\x8F\xE3\x82\x9A\xC3\xBD;foo@bar.com" diff --git a/test/prism/fixtures/seattlerb/str_newline_hash_line_number.txt b/test/prism/fixtures/seattlerb/str_newline_hash_line_number.txt new file mode 100644 index 0000000000..9c8f702000 --- /dev/null +++ b/test/prism/fixtures/seattlerb/str_newline_hash_line_number.txt @@ -0,0 +1,2 @@ +"\n\n\n\n#" +1 diff --git a/test/prism/fixtures/seattlerb/str_pct_Q_nested.txt b/test/prism/fixtures/seattlerb/str_pct_Q_nested.txt new file mode 100644 index 0000000000..1f3d0613e5 --- /dev/null +++ b/test/prism/fixtures/seattlerb/str_pct_Q_nested.txt @@ -0,0 +1 @@ +%Q[before [#{nest}] after] diff --git a/test/prism/fixtures/seattlerb/str_pct_nested_nested.txt b/test/prism/fixtures/seattlerb/str_pct_nested_nested.txt new file mode 100644 index 0000000000..cb12415215 --- /dev/null +++ b/test/prism/fixtures/seattlerb/str_pct_nested_nested.txt @@ -0,0 +1 @@ +%{ { #{ "#{1}" } } } diff --git a/test/prism/fixtures/seattlerb/str_pct_q.txt b/test/prism/fixtures/seattlerb/str_pct_q.txt new file mode 100644 index 0000000000..65d71197c9 --- /dev/null +++ b/test/prism/fixtures/seattlerb/str_pct_q.txt @@ -0,0 +1 @@ +%q{a b c} diff --git a/test/prism/fixtures/seattlerb/str_single_double_escaped_newline.txt b/test/prism/fixtures/seattlerb/str_single_double_escaped_newline.txt new file mode 100644 index 0000000000..2ff0aec111 --- /dev/null +++ b/test/prism/fixtures/seattlerb/str_single_double_escaped_newline.txt @@ -0,0 +1 @@ +a '\\n';b diff --git a/test/prism/fixtures/seattlerb/str_single_escaped_newline.txt b/test/prism/fixtures/seattlerb/str_single_escaped_newline.txt new file mode 100644 index 0000000000..5abb8d6334 --- /dev/null +++ b/test/prism/fixtures/seattlerb/str_single_escaped_newline.txt @@ -0,0 +1 @@ +a '\n';b diff --git a/test/prism/fixtures/seattlerb/str_single_newline.txt b/test/prism/fixtures/seattlerb/str_single_newline.txt new file mode 100644 index 0000000000..1033cc7e96 --- /dev/null +++ b/test/prism/fixtures/seattlerb/str_single_newline.txt @@ -0,0 +1,2 @@ +a ' +';b diff --git a/test/prism/fixtures/seattlerb/str_str.txt b/test/prism/fixtures/seattlerb/str_str.txt new file mode 100644 index 0000000000..388d777dc2 --- /dev/null +++ b/test/prism/fixtures/seattlerb/str_str.txt @@ -0,0 +1 @@ +"a #{'b'}" diff --git a/test/prism/fixtures/seattlerb/str_str_str.txt b/test/prism/fixtures/seattlerb/str_str_str.txt new file mode 100644 index 0000000000..d64e01dc5d --- /dev/null +++ b/test/prism/fixtures/seattlerb/str_str_str.txt @@ -0,0 +1 @@ +"a #{'b'} c" diff --git a/test/prism/fixtures/seattlerb/super_arg.txt b/test/prism/fixtures/seattlerb/super_arg.txt new file mode 100644 index 0000000000..1b19ecd51c --- /dev/null +++ b/test/prism/fixtures/seattlerb/super_arg.txt @@ -0,0 +1 @@ +super 42 diff --git a/test/prism/fixtures/seattlerb/symbol_empty.txt b/test/prism/fixtures/seattlerb/symbol_empty.txt new file mode 100644 index 0000000000..cbb260bb4e --- /dev/null +++ b/test/prism/fixtures/seattlerb/symbol_empty.txt @@ -0,0 +1 @@ +:'' diff --git a/test/prism/fixtures/seattlerb/symbol_list.txt b/test/prism/fixtures/seattlerb/symbol_list.txt new file mode 100644 index 0000000000..d357195184 --- /dev/null +++ b/test/prism/fixtures/seattlerb/symbol_list.txt @@ -0,0 +1 @@ +%I[#{a} #{b}] diff --git a/test/prism/fixtures/seattlerb/symbols.txt b/test/prism/fixtures/seattlerb/symbols.txt new file mode 100644 index 0000000000..3ec930ce66 --- /dev/null +++ b/test/prism/fixtures/seattlerb/symbols.txt @@ -0,0 +1 @@ +%i(a b c) diff --git a/test/prism/fixtures/seattlerb/symbols_empty.txt b/test/prism/fixtures/seattlerb/symbols_empty.txt new file mode 100644 index 0000000000..840948efb2 --- /dev/null +++ b/test/prism/fixtures/seattlerb/symbols_empty.txt @@ -0,0 +1 @@ +%i() diff --git a/test/prism/fixtures/seattlerb/symbols_empty_space.txt b/test/prism/fixtures/seattlerb/symbols_empty_space.txt new file mode 100644 index 0000000000..16c2e68a2b --- /dev/null +++ b/test/prism/fixtures/seattlerb/symbols_empty_space.txt @@ -0,0 +1 @@ +%i( ) diff --git a/test/prism/fixtures/seattlerb/symbols_interp.txt b/test/prism/fixtures/seattlerb/symbols_interp.txt new file mode 100644 index 0000000000..63116eb632 --- /dev/null +++ b/test/prism/fixtures/seattlerb/symbols_interp.txt @@ -0,0 +1 @@ +%i(a b#{1+1} c) diff --git a/test/prism/fixtures/seattlerb/thingy.txt b/test/prism/fixtures/seattlerb/thingy.txt new file mode 100644 index 0000000000..5aa598c4be --- /dev/null +++ b/test/prism/fixtures/seattlerb/thingy.txt @@ -0,0 +1,3 @@ +f.(42) + +f::(42) diff --git a/test/prism/fixtures/seattlerb/uminus_float.txt b/test/prism/fixtures/seattlerb/uminus_float.txt new file mode 100644 index 0000000000..1344bfd9db --- /dev/null +++ b/test/prism/fixtures/seattlerb/uminus_float.txt @@ -0,0 +1 @@ +-0.0 diff --git a/test/prism/fixtures/seattlerb/unary_minus.txt b/test/prism/fixtures/seattlerb/unary_minus.txt new file mode 100644 index 0000000000..66af866f85 --- /dev/null +++ b/test/prism/fixtures/seattlerb/unary_minus.txt @@ -0,0 +1 @@ +-a diff --git a/test/prism/fixtures/seattlerb/unary_plus.txt b/test/prism/fixtures/seattlerb/unary_plus.txt new file mode 100644 index 0000000000..daea40b71e --- /dev/null +++ b/test/prism/fixtures/seattlerb/unary_plus.txt @@ -0,0 +1 @@ ++a diff --git a/test/prism/fixtures/seattlerb/unary_plus_on_literal.txt b/test/prism/fixtures/seattlerb/unary_plus_on_literal.txt new file mode 100644 index 0000000000..752331df47 --- /dev/null +++ b/test/prism/fixtures/seattlerb/unary_plus_on_literal.txt @@ -0,0 +1 @@ ++:a diff --git a/test/prism/fixtures/seattlerb/unary_tilde.txt b/test/prism/fixtures/seattlerb/unary_tilde.txt new file mode 100644 index 0000000000..f0a507b437 --- /dev/null +++ b/test/prism/fixtures/seattlerb/unary_tilde.txt @@ -0,0 +1 @@ +~a diff --git a/test/prism/fixtures/seattlerb/utf8_bom.txt b/test/prism/fixtures/seattlerb/utf8_bom.txt new file mode 100644 index 0000000000..c8e9e1cbae --- /dev/null +++ b/test/prism/fixtures/seattlerb/utf8_bom.txt @@ -0,0 +1,3 @@ +#!/usr/bin/env ruby -w +p 0 + diff --git a/test/prism/fixtures/seattlerb/when_splat.txt b/test/prism/fixtures/seattlerb/when_splat.txt new file mode 100644 index 0000000000..6b79f5dad0 --- /dev/null +++ b/test/prism/fixtures/seattlerb/when_splat.txt @@ -0,0 +1 @@ +case a; when *b then; end diff --git a/test/prism/fixtures/seattlerb/words_interp.txt b/test/prism/fixtures/seattlerb/words_interp.txt new file mode 100644 index 0000000000..f71486495b --- /dev/null +++ b/test/prism/fixtures/seattlerb/words_interp.txt @@ -0,0 +1 @@ +%W(#{1}b) diff --git a/test/prism/fixtures/seattlerb/yield_arg.txt b/test/prism/fixtures/seattlerb/yield_arg.txt new file mode 100644 index 0000000000..7e752f62e2 --- /dev/null +++ b/test/prism/fixtures/seattlerb/yield_arg.txt @@ -0,0 +1 @@ +yield 42 diff --git a/test/prism/fixtures/seattlerb/yield_call_assocs.txt b/test/prism/fixtures/seattlerb/yield_call_assocs.txt new file mode 100644 index 0000000000..95963dfcf9 --- /dev/null +++ b/test/prism/fixtures/seattlerb/yield_call_assocs.txt @@ -0,0 +1,11 @@ +yield 1, :z => 1 + +yield 1, :z => 1, :w => 2 + +yield y :z=>1 + +yield y z:1 + +yield y(z:1) + +yield y(z=>1) diff --git a/test/prism/fixtures/seattlerb/yield_empty_parens.txt b/test/prism/fixtures/seattlerb/yield_empty_parens.txt new file mode 100644 index 0000000000..cff86b243a --- /dev/null +++ b/test/prism/fixtures/seattlerb/yield_empty_parens.txt @@ -0,0 +1 @@ +yield() diff --git a/test/prism/fixtures/single_quote_heredocs.txt b/test/prism/fixtures/single_quote_heredocs.txt new file mode 100644 index 0000000000..0122b2726c --- /dev/null +++ b/test/prism/fixtures/single_quote_heredocs.txt @@ -0,0 +1,3 @@ +<<-'EOS' + cd L:\Work\MG3710IQPro\Develop +EOS diff --git a/test/prism/fixtures/spanning_heredoc.txt b/test/prism/fixtures/spanning_heredoc.txt new file mode 100644 index 0000000000..a52a4c3c27 --- /dev/null +++ b/test/prism/fixtures/spanning_heredoc.txt @@ -0,0 +1,51 @@ +# test regex, string, and lists that span a heredoc thanks to an escaped newline + +# ripper incorrectly creates a "b\nb" token instead of two separate string tokens +pp <<-A.gsub(/b\ +a +A +b/, "") + +# ripper incorrectly creates a "d\nd" token instead of two separate string tokens +pp <<-A, "d\ +c +A +d" + +# ripper gets this right +pp <<-A, %q[f\ +e +A +f] + +# ripper incorrectly creates a "h\nh" token instead of two separate string tokens +pp <<-A, %Q[h\ +g +A +h] + +# ripper can't parse this successfully, though ruby runs it correctly +pp <<-A, %w[j\ +i +A +j] + +# ripper can't parse this successfully, though ruby runs it correctly +# TODO: yarp does not include the "\n" in "l\nl" in the AST like ruby does +pp <<-A, %W[l\ +k +A +l] + +# ripper can't parse this successfully, though ruby runs it correctly +pp <<-A, %i[n\ +m +A +n] + +# ripper gets this one wrong in the same way that YARP does ... +# TODO: yarp does not include the "\n" in "p\np" in the AST like ruby does +pp <<-A, %I[p\ +o +A +p] diff --git a/test/prism/fixtures/strings.txt b/test/prism/fixtures/strings.txt new file mode 100644 index 0000000000..2ce8b738a3 --- /dev/null +++ b/test/prism/fixtures/strings.txt @@ -0,0 +1,105 @@ +%%abc% + +%^abc^ + +%&abc& + +%*abc* + +%_abc_ + +%+abc+ + +%-abc- + +%:abc: + +%;abc; + +%'abc' + +%~abc~ + +%?abc? + +%w{ } + +%/abc/ + +%`abc` + +"#@@foo" + +%\abc\ + +%{aaa #{bbb} ccc} + +%[foo[]] + +"foo" + +# +"bar" + +%q{abc} + +%s[abc] + +%{abc} + +'' + +"abc" + +"#@---" + +"aaa #{bbb} ccc" + +'abc' + +%w[a b c] + +%w[a[] b[[]] c[]] + +%w[foo\ bar \#{1}] + +%w[foo\ bar baz] + +%W[a b#{c}d e] + +%W[a b c] + +%w[ + a + b + c +] + +'\' foo \' bar' + +'\\ foo \\ bar' + +"#$foo" + +"#@foo" + +"\x7 \x23 \x61" + +"\7 \43 \141" + +%[abc] + +%(abc) + +%@abc@ + +%$abc$ + +?a + +?a "a" + +%Q{abc} + +%^#$^# + +%@#@# diff --git a/test/prism/fixtures/super.txt b/test/prism/fixtures/super.txt new file mode 100644 index 0000000000..b685035970 --- /dev/null +++ b/test/prism/fixtures/super.txt @@ -0,0 +1,7 @@ +super + +super() + +super(1) + +super(1, 2, 3) diff --git a/test/prism/fixtures/symbols.txt b/test/prism/fixtures/symbols.txt new file mode 100644 index 0000000000..7563eb874f --- /dev/null +++ b/test/prism/fixtures/symbols.txt @@ -0,0 +1,93 @@ +:'abc' + +:"#{var}" + +:"abc#{1}" + +[:Υ, :ά, :ŗ, :ρ] + +:-@ + +:- + +:% + +:| + +:+@ + +:+ + +:/ + +:** + +:* + +:~@ + +[1, 1.0, 1r, 1i] + +:~ + +:a + +%i[a b c] + +%i[a b#{1} #{2}c d#{3}f] + +%I[a b#{1} #{2}c d#{3}f] + +:@@a + +:👍 + +%i[a\b] + +:$a + +:@a + +:do + +:& + +:` + +:!@ + +:!~ + +:! + +:[] + +:[]= + +:^ + +:== + +:=== + +:=~ + +:>= + +:>> + +:> + +:<=> + +:<= + +:<< + +:< + +:__LINE__ + +:__FILE__ + +:__ENCODING__ diff --git a/test/prism/fixtures/ternary_operator.txt b/test/prism/fixtures/ternary_operator.txt new file mode 100644 index 0000000000..79d2d7d837 --- /dev/null +++ b/test/prism/fixtures/ternary_operator.txt @@ -0,0 +1,15 @@ +a ? b : c + +a ? defined? b : defined? c + +empty??true:nil + +empty??false:nil + +empty??nil:nil + +a??nil:nil + +a ?var1 : var2 + +nil??_a =2:1 diff --git a/test/prism/fixtures/tilde_heredocs.txt b/test/prism/fixtures/tilde_heredocs.txt new file mode 100644 index 0000000000..415d4d42c8 --- /dev/null +++ b/test/prism/fixtures/tilde_heredocs.txt @@ -0,0 +1,91 @@ +<<~EOF + a +EOF + +<<~EOF + a + b + c +EOF + +<<~EOF + #{1} a +EOF + +<<~EOF + a #{1} +EOF + +<<~EOF + a + #{1} +EOF + +<<~EOF + a + #{1} +EOF + +<<~EOF + a + b +EOF + +<<~EOF + a + b +EOF + +<<~EOF + a + b +EOF + +<<~'EOF' + a #{1} +EOF + +<<~EOF + a + b +EOF + +<<~EOF + a + b +EOF + +<<~EOF + a + b +EOF + +<<~EOF + a + + b +EOF + +<<~EOF + a + + b +EOF + +<<~EOF + a + + + + b +EOF + +<<~EOF + + #{1}a + EOF + +<<~EOT + #{1} + b +EOT diff --git a/test/prism/fixtures/undef.txt b/test/prism/fixtures/undef.txt new file mode 100644 index 0000000000..129c349433 --- /dev/null +++ b/test/prism/fixtures/undef.txt @@ -0,0 +1,17 @@ +undef a + +undef a, b + +undef if + +undef <=> + +undef :a + +undef :a, :b, :c + +undef :'abc' + +undef :"abc#{1}" + +undef Constant diff --git a/test/prism/fixtures/unescaping.txt b/test/prism/fixtures/unescaping.txt new file mode 100644 index 0000000000..e2da5a696c --- /dev/null +++ b/test/prism/fixtures/unescaping.txt @@ -0,0 +1,9 @@ +["\c#{1}"] + +/\c#{1}/ + +"\c#{1}" + +<<~HERE + \c#{1} +HERE diff --git a/test/prism/fixtures/unless.txt b/test/prism/fixtures/unless.txt new file mode 100644 index 0000000000..410d460e69 --- /dev/null +++ b/test/prism/fixtures/unless.txt @@ -0,0 +1,14 @@ +unless true; 1; end + +unless true +1 else 2 end + +1 unless true + +break unless true + +next unless true + +return unless true + +foo :a, :b unless bar? diff --git a/test/prism/fixtures/unparser/LICENSE b/test/prism/fixtures/unparser/LICENSE new file mode 100644 index 0000000000..44863d7afb --- /dev/null +++ b/test/prism/fixtures/unparser/LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2013 Markus Schirp + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/test/prism/fixtures/unparser/corpus/literal/alias.txt b/test/prism/fixtures/unparser/corpus/literal/alias.txt new file mode 100644 index 0000000000..fb06a295e8 --- /dev/null +++ b/test/prism/fixtures/unparser/corpus/literal/alias.txt @@ -0,0 +1,2 @@ +alias $foo $bar +alias :foo :bar diff --git a/test/prism/fixtures/unparser/corpus/literal/assignment.txt b/test/prism/fixtures/unparser/corpus/literal/assignment.txt new file mode 100644 index 0000000000..84a74e8928 --- /dev/null +++ b/test/prism/fixtures/unparser/corpus/literal/assignment.txt @@ -0,0 +1,53 @@ +$a = 1 +($a, $b) = [1, 2] +((a,), b) = 1 +(*a) = [] +(*foo) = [1, 2] +(@@a, @@b) = [1, 2] +(@a, @b) = [1, 2] +(a, (b, c)) = [1, [2, 3]] +(a, *) = [1, 2] +(a, *foo) = [1, 2] +(a, b) = [1, 2] +(a, b) = foo +(a,) = foo +(a.foo, a.bar) = [1, 2] +(a[*foo], a[1]) = [1, 2] +(a[0], a[1]) = [1, 2] +(*c.foo) = 1 +::Foo = ::Bar +@@a = 1 +@a = 1 +CONST = 1 +Name::Spaced::CONST = 1 +a = ((b, c) = 1) +a = 1 +foo = foo() +foo.[]=() +foo.[]=(1, 2) +foo.[]=true +foo[*index] = value +foo[1..2] = value +foo[] = 1 +foo[a, b] = value +foo[index] = value +x = %() +x.x=%() +x[%()] = bar +a[%()] ||= bar +@a ||= %() +x = <<-HEREDOC + #{} +HEREDOC +x.x=<<-HEREDOC + #{} +HEREDOC +x[] = <<-HEREDOC + #{} +HEREDOC +a[<<-HEREDOC] ||= bar + #{} +HEREDOC +@a ||= <<-HEREDOC + #{} +HEREDOC diff --git a/test/prism/fixtures/unparser/corpus/literal/block.txt b/test/prism/fixtures/unparser/corpus/literal/block.txt new file mode 100644 index 0000000000..b2baf1dc12 --- /dev/null +++ b/test/prism/fixtures/unparser/corpus/literal/block.txt @@ -0,0 +1,96 @@ +foo { +} +foo { |a| +} +foo { |a,| +} +foo { |a,; x| +} +foo { |a, b| +} +foo(1) { + nil +} +foo { |a, *b| + nil +} +foo { |a, *| + nil +} +foo { + bar +} +foo.bar { |(a, b), c| + d +} +foo.bar { |*a; b| +} +foo.bar { |a; b| +} +foo.bar { |; a, b| +} +foo.bar { |*| + d +} +foo.bar { |(*)| + d +} +foo.bar { |((*))| + d +} +foo.bar { |(a, (*))| + d +} +foo.bar { |(a, b)| + d +} +foo.bar { +}.baz +m do +rescue Exception => e +end +m do + foo +rescue Exception => bar + bar +end +m do + bar +rescue SomeError, *bar + baz +end +m do + bar +rescue SomeError, *bar => exception + baz +end +m do + bar +rescue *bar + baz +end +m do + bar +rescue LoadError +end +m do + bar +rescue +else + baz +end +m do + bar +rescue *bar => exception + baz +end +m do +ensure +end +m do +rescue +ensure +end +bar { + _1 + _2 +} diff --git a/test/prism/fixtures/unparser/corpus/literal/case.txt b/test/prism/fixtures/unparser/corpus/literal/case.txt new file mode 100644 index 0000000000..c455fd7c39 --- /dev/null +++ b/test/prism/fixtures/unparser/corpus/literal/case.txt @@ -0,0 +1,37 @@ +case +when bar + baz +when baz + bar +end +case foo +when bar +when baz + bar +end +case foo +when bar + baz +when baz + bar +end +case foo +when bar, baz + :other +end +case foo +when *bar + :value +end +case foo +when bar + baz +else + :foo +end +case foo +when *bar | baz +end +case foo +when *bar.baz=1 +end diff --git a/test/prism/fixtures/unparser/corpus/literal/class.txt b/test/prism/fixtures/unparser/corpus/literal/class.txt new file mode 100644 index 0000000000..f0198625e9 --- /dev/null +++ b/test/prism/fixtures/unparser/corpus/literal/class.txt @@ -0,0 +1,35 @@ +class A +end + +class << a +end + +class << a + b +end + +class A::B +end + +class A::B::C +end + +class A < B +end + +class A < B::C +end + +class A::B < C::D +end + +class A + include(B.new) + + def foo + :bar + end +end + +class ::A +end diff --git a/test/prism/fixtures/unparser/corpus/literal/control.txt b/test/prism/fixtures/unparser/corpus/literal/control.txt new file mode 100644 index 0000000000..648782bc96 --- /dev/null +++ b/test/prism/fixtures/unparser/corpus/literal/control.txt @@ -0,0 +1,15 @@ +next +return +break +retry +redo +return 1 +return 1, 2 +return true ? 1 : 2 +break true ? 1 : 2 +next true ? 1 : 2 +return true, if true + 1 +else + 2 +end diff --git a/test/prism/fixtures/unparser/corpus/literal/def.txt b/test/prism/fixtures/unparser/corpus/literal/def.txt new file mode 100644 index 0000000000..61339bd4a6 --- /dev/null +++ b/test/prism/fixtures/unparser/corpus/literal/def.txt @@ -0,0 +1,134 @@ +def foo + a +rescue + b +else + c +ensure + d +end + +def foo + a rescue b +rescue + b +else + c +ensure + d +end + +def foo(bar:, baz:) +end + +def foo +end + +def foo + bar +end + +def foo + foo +rescue + bar +ensure + baz +end + +def foo + bar +ensure + baz +end + +def foo + bar +rescue + baz +end + +def foo(bar) + bar +end + +def foo(bar, baz) + bar +end + +def foo(bar = ()) + bar +end + +def foo(bar = (baz; nil)) +end + +def foo(bar = true) + bar +end + +def foo(bar, baz = true) + bar +end + +def foo(bar: 1) +end + +def foo(bar: baz) +end + +def foo(bar: bar()) +end + +def foo(*) + bar +end + +def foo(*bar) + bar +end + +def foo(bar, *baz) + bar +end + +def foo(baz = true, *bor) + bar +end + +def foo(baz = true, *bor, &block) + bar +end + +def foo(bar, baz = true, *bor) + bar +end + +def foo(&block) + bar +end + +def foo(bar, &block) + bar +end + +def foo + bar + baz +end + +def f(((a))) +end + +def foo(bar:, baz: "value") +end + +def f + <<-HEREDOC + #{} + HEREDOC +end + +def f + %() +end diff --git a/test/prism/fixtures/unparser/corpus/literal/defined.txt b/test/prism/fixtures/unparser/corpus/literal/defined.txt new file mode 100644 index 0000000000..65e7c370fd --- /dev/null +++ b/test/prism/fixtures/unparser/corpus/literal/defined.txt @@ -0,0 +1,3 @@ +defined?(@foo) +defined?(Foo) +defined?(((a, b) = [1, 2])) diff --git a/test/prism/fixtures/unparser/corpus/literal/defs.txt b/test/prism/fixtures/unparser/corpus/literal/defs.txt new file mode 100644 index 0000000000..b70aa9efc5 --- /dev/null +++ b/test/prism/fixtures/unparser/corpus/literal/defs.txt @@ -0,0 +1,40 @@ +def self.foo +end + +def self.foo + bar +end + +def self.foo + bar + baz +end + +def Foo.bar + bar +end + +def (foo { |bar| +}).bar + bar +end + +def (foo(1)).bar + bar +end + +def (Foo::Bar.baz).bar + baz +end + +def (Foo::Bar).bar + baz +end + +def Foo.bar + baz +end + +def foo.bar + baz +end diff --git a/test/prism/fixtures/unparser/corpus/literal/dstr.txt b/test/prism/fixtures/unparser/corpus/literal/dstr.txt new file mode 100644 index 0000000000..8a912d28ed --- /dev/null +++ b/test/prism/fixtures/unparser/corpus/literal/dstr.txt @@ -0,0 +1,37 @@ +if true + "#{}a" +end +if true + <<-HEREDOC +a +#{}a +b + HEREDOC + x +end +<<-HEREDOC +\#{}\#{} +#{} +#{} +#{} +HEREDOC +<<-HEREDOC rescue nil +#{} +a +HEREDOC +"a#$1" +"a#$a" +"a#@a" +"a#@@a" +if true + return <<-HEREDOC + #{42} + HEREDOC +end +foo(<<-HEREDOC) + #{bar} +HEREDOC +foo(<<-HEREDOC) { |x| + #{bar} +HEREDOC +} diff --git a/test/prism/fixtures/unparser/corpus/literal/empty.txt b/test/prism/fixtures/unparser/corpus/literal/empty.txt new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/test/prism/fixtures/unparser/corpus/literal/empty.txt diff --git a/test/prism/fixtures/unparser/corpus/literal/empty_begin.txt b/test/prism/fixtures/unparser/corpus/literal/empty_begin.txt new file mode 100644 index 0000000000..6a452c185a --- /dev/null +++ b/test/prism/fixtures/unparser/corpus/literal/empty_begin.txt @@ -0,0 +1 @@ +() diff --git a/test/prism/fixtures/unparser/corpus/literal/flipflop.txt b/test/prism/fixtures/unparser/corpus/literal/flipflop.txt new file mode 100644 index 0000000000..8badd39d57 --- /dev/null +++ b/test/prism/fixtures/unparser/corpus/literal/flipflop.txt @@ -0,0 +1,6 @@ +if ((i == 4)..(i == 4)) + foo +end +if ((i == 4)...(i == 4)) + foo +end diff --git a/test/prism/fixtures/unparser/corpus/literal/for.txt b/test/prism/fixtures/unparser/corpus/literal/for.txt new file mode 100644 index 0000000000..4c19a352d9 --- /dev/null +++ b/test/prism/fixtures/unparser/corpus/literal/for.txt @@ -0,0 +1,12 @@ +bar(for a in bar do + baz +end) +for a in bar do + baz +end +for (a, *b) in bar do + baz +end +for (a, b) in bar do + baz +end diff --git a/test/prism/fixtures/unparser/corpus/literal/hookexe.txt b/test/prism/fixtures/unparser/corpus/literal/hookexe.txt new file mode 100644 index 0000000000..08f14f47b3 --- /dev/null +++ b/test/prism/fixtures/unparser/corpus/literal/hookexe.txt @@ -0,0 +1,7 @@ +BEGIN { + foo +} +bar +END { + baz +} diff --git a/test/prism/fixtures/unparser/corpus/literal/if.txt b/test/prism/fixtures/unparser/corpus/literal/if.txt new file mode 100644 index 0000000000..0c13801f9e --- /dev/null +++ b/test/prism/fixtures/unparser/corpus/literal/if.txt @@ -0,0 +1,36 @@ +if /foo/ + bar +end +if 3 + 9 +end +if 4 + 5 +else + 6 +end +unless 3 + nil +end +unless 3 + 9 +end +if foo +end + +module A + foo = bar if foo +end + +module B + foo = bar unless foo +end +unless foo + foo = bar +end +if foo { |pair| + pair +} + pair = :foo + foo +end diff --git a/test/prism/fixtures/unparser/corpus/literal/kwbegin.txt b/test/prism/fixtures/unparser/corpus/literal/kwbegin.txt new file mode 100644 index 0000000000..6cc1e74ca6 --- /dev/null +++ b/test/prism/fixtures/unparser/corpus/literal/kwbegin.txt @@ -0,0 +1,80 @@ +begin +rescue +end + +begin +ensure +end + +begin + a +end + +begin + a +rescue + b +end + +begin + a + b +rescue + b +end + +begin +rescue A +end + +begin +rescue A => foo +end + +begin + a +rescue A + b +rescue B + c +ensure + d +end + +begin + begin + foo + bar + rescue + end +rescue + baz + bar +end + +begin + raise(Exception) rescue foo = bar +rescue Exception +end + +begin + foo +rescue => bar + bar +end + +begin + foo +rescue Exception, Other => bar + bar +end + +begin + bar +rescue SomeError, *bar => exception + baz +end + +class << self + undef :bar rescue nil +end diff --git a/test/prism/fixtures/unparser/corpus/literal/lambda.txt b/test/prism/fixtures/unparser/corpus/literal/lambda.txt new file mode 100644 index 0000000000..4eb722dad1 --- /dev/null +++ b/test/prism/fixtures/unparser/corpus/literal/lambda.txt @@ -0,0 +1,13 @@ +lambda { +} +lambda { |a, b| + a +} +->() { +} +->(a) { +} +->(a, b) { +} +->(a, b; c) { +} diff --git a/test/prism/fixtures/unparser/corpus/literal/literal.txt b/test/prism/fixtures/unparser/corpus/literal/literal.txt new file mode 100644 index 0000000000..2fc7cd1d79 --- /dev/null +++ b/test/prism/fixtures/unparser/corpus/literal/literal.txt @@ -0,0 +1,91 @@ +{ "foo" => <<-HEREDOC, "bar" => :baz } + #{} +HEREDOC +{ "foo" => %(), "bar" => :baz } +["foo", %()] +a(<<-HEREDOC).a + #{} +HEREDOC +a(%()).a +{ "foo" => <<-HEREDOC, **baz } + #{} +HEREDOC +{ "foo" => %(), **baz } +"#@a #@@a #$a" +0 +++1 +1 +1 +1r +1.5r +1.3r +5i +-5i +0.6i +-0.6i +1000000000000000000000000000000i +1ri +"foo" "bar" +"foobar #{baz}" +"foo#{1}bar" +"\\\\#{}" +"#{}\#{}" +"\#{}#{}" +"foo\\\#{@bar}" +"\"" +"foo bar" +"foo\nbar" +`foo` +`foo#{@bar}` +`)` +`\`` +`"` +:foo +:"A B" +:foo +:"A B" +:"A\"B" +:"" +/foo/ +/[^-+',.\/:@[:alnum:]\[\]]+/ +/foo#{@bar}/ +/foo#{@bar}/imx +/#{"\u0000"}/ +/\n/ +/\n/ +/\n/x +/\/\//x +:"foo#{bar}baz" +:"#{"foo"}" +(0.0 / 0.0)..1 +1..(0.0 / 0.0) +(0.0 / 0.0)..100 +-0.1 +0.1 +[1, 2] +[1, (), n2] +[1] +[] +[1, *@foo] +[*@foo, 1] +[*@foo, *@baz] +{} +{ () => () } +{ 1 => 2 } +{ 1 => 2, 3 => 4 } +{ a: (1 rescue foo), b: 2 } +{ a: 1, b: 2 } +{ a: :a } +{ :"a b" => 1 } +{ :-@ => 1 } +"#{} +#{}\na" +foo { + "#{} +#{}\na" +} +:"a\\ +b" +` x +#{foo} +#` diff --git a/test/prism/fixtures/unparser/corpus/literal/module.txt b/test/prism/fixtures/unparser/corpus/literal/module.txt new file mode 100644 index 0000000000..cec03f3bfd --- /dev/null +++ b/test/prism/fixtures/unparser/corpus/literal/module.txt @@ -0,0 +1,16 @@ +module A +end + +module A::B +end + +module A::B::C +end + +module A + include(B.new) + + def foo + :bar + end +end diff --git a/test/prism/fixtures/unparser/corpus/literal/opasgn.txt b/test/prism/fixtures/unparser/corpus/literal/opasgn.txt new file mode 100644 index 0000000000..5858d773d0 --- /dev/null +++ b/test/prism/fixtures/unparser/corpus/literal/opasgn.txt @@ -0,0 +1,24 @@ +a += 2 +a -= 2 +a **= 2 +a *= 2 +a /= 2 +a &&= b +a ||= 2 +(a ||= 2).bar +(h ||= {})[k] = v +a.b += 2 +a.b -= 2 +a.b **= 2 +a.b *= 2 +a.b /= 2 +a.b &&= b +a.b ||= 2 +a[b] += 2 +a[b] -= 2 +a[b] **= 2 +a[b] *= 2 +a[b] /= 2 +a[b] &&= b +a[b] ||= 2 +foo.A += 1 diff --git a/test/prism/fixtures/unparser/corpus/literal/pattern.txt b/test/prism/fixtures/unparser/corpus/literal/pattern.txt new file mode 100644 index 0000000000..7cfaa4dc67 --- /dev/null +++ b/test/prism/fixtures/unparser/corpus/literal/pattern.txt @@ -0,0 +1,41 @@ +case foo +in A[1, 2, *a, 3] then + true +in [1, 2, ] then + y +in A(x:) then + true +in {**a} then + true +in {} if true then + true +in [x, y, *] then + true +in {a: 1, aa: 2} then + true +in {} then + true +in {**nil} then + true +in {"a": 1} then + true +in 1 | 2 then + true +in 1 => a then + true +in ^x then + true +in 1 +in 2 then + true +else + true +end +case foo +in A[1, 2, *a, 3] +end +case foo +in A +else +end +1 in [a] diff --git a/test/prism/fixtures/unparser/corpus/literal/pragma.txt b/test/prism/fixtures/unparser/corpus/literal/pragma.txt new file mode 100644 index 0000000000..4f6dd71b38 --- /dev/null +++ b/test/prism/fixtures/unparser/corpus/literal/pragma.txt @@ -0,0 +1,4 @@ +__ENCODING__ +__FILE__ +__LINE__ +__dir__ diff --git a/test/prism/fixtures/unparser/corpus/literal/range.txt b/test/prism/fixtures/unparser/corpus/literal/range.txt new file mode 100644 index 0000000000..eb1f3874c0 --- /dev/null +++ b/test/prism/fixtures/unparser/corpus/literal/range.txt @@ -0,0 +1,4 @@ +(1..) +1..2 +(1...) +1...2 diff --git a/test/prism/fixtures/unparser/corpus/literal/rescue.txt b/test/prism/fixtures/unparser/corpus/literal/rescue.txt new file mode 100644 index 0000000000..a787816808 --- /dev/null +++ b/test/prism/fixtures/unparser/corpus/literal/rescue.txt @@ -0,0 +1,3 @@ +foo rescue bar +foo rescue return bar +x = (foo rescue return bar) diff --git a/test/prism/fixtures/unparser/corpus/literal/send.txt b/test/prism/fixtures/unparser/corpus/literal/send.txt new file mode 100644 index 0000000000..1e9c2a94be --- /dev/null +++ b/test/prism/fixtures/unparser/corpus/literal/send.txt @@ -0,0 +1,84 @@ +module A + foo ||= ((a, _) = b) +end + +module A + local = 1 + local.bar +end +class A +end.bar +module A +end.bar +begin +rescue +end.bar +case (def foo +end; :bar) +when bar +end.baz +case foo +when bar +end.baz +class << self +end.bar +def self.foo +end.bar +def foo +end.bar +until foo +end.bar +while foo +end.bar +loop { +}.bar +if foo +end.baz +(/bar/ =~ :foo).foo +(1..2).max +(foo =~ /bar/).foo +/bar/ =~ :foo +/bar/ =~ foo +1..2.max +A.foo +FOO() +a&.b +a.foo +foo +foo << (bar * baz) +foo =~ /bar/ +foo(&(foo || bar)) +foo(&block) +foo(*args, &block) +foo(*arguments) +foo(1, 2) +foo(bar) +foo(bar, *args) +foo(foo =~ /bar/) +foo.bar(&baz) +foo.bar(*arga, foo, *argb) +foo.bar(*args) +foo.bar(*args, foo) +foo.bar(:baz, &baz) +foo.bar(baz: boz) +foo.bar(foo, "baz" => boz) +foo.bar(foo, *args) +foo.bar(foo, *args, &block) +foo.bar(foo, {}) +foo.bar({ foo: boz }, boz) +foo.bar=:baz +foo(a: b) +foo.&(a: b) +foo.&(**a) +foo[*baz] +foo[1, 2] +foo[] +self.foo +self.foo=:bar +(a + b) / (c - d) +(a + b) / c.-(e, f) +(a + b) / c.-(*f) +x(**foo) +foo&.! +foo.~(b) +a&.+(b) diff --git a/test/prism/fixtures/unparser/corpus/literal/since/27.txt b/test/prism/fixtures/unparser/corpus/literal/since/27.txt new file mode 100644 index 0000000000..c332f9e48e --- /dev/null +++ b/test/prism/fixtures/unparser/corpus/literal/since/27.txt @@ -0,0 +1,4 @@ +-> { + _1 + _2 +} +(..1) diff --git a/test/prism/fixtures/unparser/corpus/literal/since/30.txt b/test/prism/fixtures/unparser/corpus/literal/since/30.txt new file mode 100644 index 0000000000..b73328a4b0 --- /dev/null +++ b/test/prism/fixtures/unparser/corpus/literal/since/30.txt @@ -0,0 +1,4 @@ +1 => [a] +1 => [*] +1 in [*, 42, *] +1 in [*, a, *foo] diff --git a/test/prism/fixtures/unparser/corpus/literal/since/31.txt b/test/prism/fixtures/unparser/corpus/literal/since/31.txt new file mode 100644 index 0000000000..504eb94d5b --- /dev/null +++ b/test/prism/fixtures/unparser/corpus/literal/since/31.txt @@ -0,0 +1,7 @@ +def foo(&) + bar(&) +end + +def foo(a, &) + bar(&) +end diff --git a/test/prism/fixtures/unparser/corpus/literal/since/32.txt b/test/prism/fixtures/unparser/corpus/literal/since/32.txt new file mode 100644 index 0000000000..fa279f11cf --- /dev/null +++ b/test/prism/fixtures/unparser/corpus/literal/since/32.txt @@ -0,0 +1,7 @@ +def foo(argument, **) + bar(argument, **) +end + +def foo(argument, *) + bar(argument, *) +end diff --git a/test/prism/fixtures/unparser/corpus/literal/singletons.txt b/test/prism/fixtures/unparser/corpus/literal/singletons.txt new file mode 100644 index 0000000000..496e6a41ce --- /dev/null +++ b/test/prism/fixtures/unparser/corpus/literal/singletons.txt @@ -0,0 +1,4 @@ +false +nil +self +true diff --git a/test/prism/fixtures/unparser/corpus/literal/super.txt b/test/prism/fixtures/unparser/corpus/literal/super.txt new file mode 100644 index 0000000000..0e73e6f052 --- /dev/null +++ b/test/prism/fixtures/unparser/corpus/literal/super.txt @@ -0,0 +1,21 @@ +super +super() +super(a) +super(a, b) +super(&block) +super(a, &block) +super(a { + foo +}) +super { + foo +} +super(a) { + foo +} +super() { + foo +} +super(a, b) { + foo +} diff --git a/test/prism/fixtures/unparser/corpus/literal/unary.txt b/test/prism/fixtures/unparser/corpus/literal/unary.txt new file mode 100644 index 0000000000..77685cb71d --- /dev/null +++ b/test/prism/fixtures/unparser/corpus/literal/unary.txt @@ -0,0 +1,8 @@ +!1 +!(!1) +!(!(foo || bar)) +!(!1).baz +~a +-a ++a +-(-a).foo diff --git a/test/prism/fixtures/unparser/corpus/literal/undef.txt b/test/prism/fixtures/unparser/corpus/literal/undef.txt new file mode 100644 index 0000000000..a65d8d0cc4 --- /dev/null +++ b/test/prism/fixtures/unparser/corpus/literal/undef.txt @@ -0,0 +1,2 @@ +undef :foo +undef :foo, :bar diff --git a/test/prism/fixtures/unparser/corpus/literal/variables.txt b/test/prism/fixtures/unparser/corpus/literal/variables.txt new file mode 100644 index 0000000000..1de938f376 --- /dev/null +++ b/test/prism/fixtures/unparser/corpus/literal/variables.txt @@ -0,0 +1,10 @@ +a +@a +@@a +$a +$1 +$` +CONST +SCOPED::CONST +::TOPLEVEL +::TOPLEVEL::CONST diff --git a/test/prism/fixtures/unparser/corpus/literal/while.txt b/test/prism/fixtures/unparser/corpus/literal/while.txt new file mode 100644 index 0000000000..19a60ef5ff --- /dev/null +++ b/test/prism/fixtures/unparser/corpus/literal/while.txt @@ -0,0 +1,73 @@ +module A + foo { |bar| + while foo + foo = bar + end + } +end + +def foo + foo = bar while foo != baz +end + +module A + foo = bar while foo +end + +module A + foo = bar until foo +end + +module A + while foo + foo = bar + end +end + +module A + each { |baz| + while foo + foo = bar + end + } +end + +module A + each { |foo| + while foo + foo = bar + end + } +end +x = (begin + foo +end while baz) +begin + foo +end while baz +begin + foo + bar +end until baz +begin + foo + bar +end while baz +while false +end +while false + 3 +end +while (foo { +}) + :body +end +until false +end +until false + 3 +end +until (foo { +}) + :body +end diff --git a/test/prism/fixtures/unparser/corpus/literal/yield.txt b/test/prism/fixtures/unparser/corpus/literal/yield.txt new file mode 100644 index 0000000000..c0b5820842 --- /dev/null +++ b/test/prism/fixtures/unparser/corpus/literal/yield.txt @@ -0,0 +1,3 @@ +yield +yield(a) +yield(a, b) diff --git a/test/prism/fixtures/unparser/corpus/semantic/and.txt b/test/prism/fixtures/unparser/corpus/semantic/and.txt new file mode 100644 index 0000000000..43d1712445 --- /dev/null +++ b/test/prism/fixtures/unparser/corpus/semantic/and.txt @@ -0,0 +1,8 @@ +a...b or c...d +a...b and c...d + +if a...b or c...d +end + +if a...b and c...d +end diff --git a/test/prism/fixtures/unparser/corpus/semantic/block.txt b/test/prism/fixtures/unparser/corpus/semantic/block.txt new file mode 100644 index 0000000000..5891690025 --- /dev/null +++ b/test/prism/fixtures/unparser/corpus/semantic/block.txt @@ -0,0 +1,26 @@ +foo do +end + +foo do +rescue +end + +foo do + nil rescue nil + nil +end + +foo do |a| +end + +foo(<<-DOC) do |a| + b +DOC + a +end + +foo(<<-DOC) do + b +DOC + a +end diff --git a/test/prism/fixtures/unparser/corpus/semantic/def.txt b/test/prism/fixtures/unparser/corpus/semantic/def.txt new file mode 100644 index 0000000000..7574619392 --- /dev/null +++ b/test/prism/fixtures/unparser/corpus/semantic/def.txt @@ -0,0 +1,7 @@ +def foo + (a - b) +end + +def foo + a rescue Exception +end diff --git a/test/prism/fixtures/unparser/corpus/semantic/dstr.txt b/test/prism/fixtures/unparser/corpus/semantic/dstr.txt new file mode 100644 index 0000000000..919e736077 --- /dev/null +++ b/test/prism/fixtures/unparser/corpus/semantic/dstr.txt @@ -0,0 +1,127 @@ +<<DOC +DOC + +<<'DOC' +DOC + +<<~DOC +DOC + +<<~'DOC' +DOC + +<<DOC + a +DOC + +<<'DOC' + a +DOC + +<<DOC + a + #{} +DOC + +<<~DOC + a + #{} +DOC + +<<~DOC + a + #{} + b +DOC + +<<~DOC + a + b +DOC + +<<'DOC' +a + +b +DOC + +<<'DOC' + a + + b +DOC + +<<'DOC' + a\nb +DOC + +<<DOC +#{}a + #{}a +DOC + +<<DOC + #{} + \#{} +DOC + +<<DOC + a#{}b + c +DOC + +<<~DOC + #{} +DOC + +if true + <<~DOC + #{} + DOC +end + +if true + <<~DOC + b#{} + DOC +end + +if true + <<~DOC + #{}a + DOC +end + +if true + <<-'DOC' + a + + b + DOC +end + +"#{}a" + +%(\n"#{}"\n) + +%Q(-\n"#{}"\n) + +"a +#{} +b" + +"a\n#{} +b" + +"a +#{}\nb" + +'a' \ +"#{}" + +"" "" "" + +"a#{@a}" "b" +"a#@a" "b" +"a#$a" "b" +"a#@@a" "b" diff --git a/test/prism/fixtures/unparser/corpus/semantic/kwbegin.txt b/test/prism/fixtures/unparser/corpus/semantic/kwbegin.txt new file mode 100644 index 0000000000..d275a96a5c --- /dev/null +++ b/test/prism/fixtures/unparser/corpus/semantic/kwbegin.txt @@ -0,0 +1,42 @@ +begin +rescue +end + +begin +rescue +else +end + +begin + a +end + +begin + a +rescue + b +end + +begin + a + b +rescue + b +end + +begin +rescue A +else +end + +begin; rescue A; else; end + +begin + a +rescue A + b +rescue B + c +ensure + d +end diff --git a/test/prism/fixtures/unparser/corpus/semantic/literal.txt b/test/prism/fixtures/unparser/corpus/semantic/literal.txt new file mode 100644 index 0000000000..c424db5a53 --- /dev/null +++ b/test/prism/fixtures/unparser/corpus/semantic/literal.txt @@ -0,0 +1,14 @@ +1.0r +-0r +0x1 +1_000 +1e10 +10e10000000000 +-10e10000000000 +?c +%r(/) +%r(\)) +%r(#{@bar}baz) +10.2e10000000000 +-10.2e10000000000 +w(foo bar) diff --git a/test/prism/fixtures/unparser/corpus/semantic/send.txt b/test/prism/fixtures/unparser/corpus/semantic/send.txt new file mode 100644 index 0000000000..a65b27d2f2 --- /dev/null +++ b/test/prism/fixtures/unparser/corpus/semantic/send.txt @@ -0,0 +1,6 @@ +foo +foo(1) + +a.===(b).c == d + +a == d.c.===(c) diff --git a/test/prism/fixtures/unparser/corpus/semantic/undef.txt b/test/prism/fixtures/unparser/corpus/semantic/undef.txt new file mode 100644 index 0000000000..47debc3114 --- /dev/null +++ b/test/prism/fixtures/unparser/corpus/semantic/undef.txt @@ -0,0 +1,2 @@ +undef foo +undef foo, bar diff --git a/test/prism/fixtures/unparser/corpus/semantic/while.txt b/test/prism/fixtures/unparser/corpus/semantic/while.txt new file mode 100644 index 0000000000..a55dcc52fc --- /dev/null +++ b/test/prism/fixtures/unparser/corpus/semantic/while.txt @@ -0,0 +1,25 @@ +a until b? {} + +until b? {} + a +end + +foo = bar while foo + +a until b && a { } + +while a = b + a +end + +a until b(<<-FOO) do +FOO + c +end + +module A + foo = exp + while foo + foo = bar + end +end diff --git a/test/prism/fixtures/until.txt b/test/prism/fixtures/until.txt new file mode 100644 index 0000000000..fa93819e25 --- /dev/null +++ b/test/prism/fixtures/until.txt @@ -0,0 +1,11 @@ +until true; 1; end + +1 until true + +break until true + +next until true + +return until true + +foo :a, :b until bar? diff --git a/test/prism/fixtures/variables.txt b/test/prism/fixtures/variables.txt new file mode 100644 index 0000000000..276dc3b3f1 --- /dev/null +++ b/test/prism/fixtures/variables.txt @@ -0,0 +1,46 @@ +@@abc + +@@abc = 1 + +@@foo, @@bar = 1 + +@@foo = 1, 2 + +$abc = 1 + +$abc + +@abc + +@abc = 1 + +a + +abc = 1 + +$foo, $bar = 1 + +$foo = 1, 2 + +@foo, @bar = 1 + +@foo = 1, 2 + +foo = 1; foo = 1, 2 + +foo = 1, 2 + +foo, * = 1, 2 + +foo, = 1, 2 + +foo, *bar = 1, 2 + +foo, (bar, baz) = 1, [2, 3] + +foo = *bar + +Foo = 1, 2 + +(a; b; c) + diff --git a/test/prism/fixtures/while.txt b/test/prism/fixtures/while.txt new file mode 100644 index 0000000000..ed5ea0f45c --- /dev/null +++ b/test/prism/fixtures/while.txt @@ -0,0 +1,19 @@ +while true; 1; end + +1 while true + +break while true + +next while true + +return while true + +foo :a, :b while bar? + +while def self.foo a = tap do end; end; break; end + +while class Foo a = tap do end; end; break; end + +while class << self; tap do end; end; break; end + +while class << self; a = tap do end; end; break; end diff --git a/test/prism/fixtures/whitequark/LICENSE b/test/prism/fixtures/whitequark/LICENSE new file mode 100644 index 0000000000..971310e3d6 --- /dev/null +++ b/test/prism/fixtures/whitequark/LICENSE @@ -0,0 +1,25 @@ +Copyright (c) 2013-2016 whitequark <whitequark@whitequark.org> + +Parts of the source are derived from ruby_parser: +Copyright (c) Ryan Davis, seattle.rb + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/test/prism/fixtures/whitequark/__ENCODING__.txt b/test/prism/fixtures/whitequark/__ENCODING__.txt new file mode 100644 index 0000000000..d6debf2f92 --- /dev/null +++ b/test/prism/fixtures/whitequark/__ENCODING__.txt @@ -0,0 +1 @@ +__ENCODING__ diff --git a/test/prism/fixtures/whitequark/__ENCODING___legacy_.txt b/test/prism/fixtures/whitequark/__ENCODING___legacy_.txt new file mode 100644 index 0000000000..d6debf2f92 --- /dev/null +++ b/test/prism/fixtures/whitequark/__ENCODING___legacy_.txt @@ -0,0 +1 @@ +__ENCODING__ diff --git a/test/prism/fixtures/whitequark/alias.txt b/test/prism/fixtures/whitequark/alias.txt new file mode 100644 index 0000000000..e33b120022 --- /dev/null +++ b/test/prism/fixtures/whitequark/alias.txt @@ -0,0 +1 @@ +alias :foo bar diff --git a/test/prism/fixtures/whitequark/alias_gvar.txt b/test/prism/fixtures/whitequark/alias_gvar.txt new file mode 100644 index 0000000000..b975d97f8e --- /dev/null +++ b/test/prism/fixtures/whitequark/alias_gvar.txt @@ -0,0 +1,3 @@ +alias $a $+ + +alias $a $b diff --git a/test/prism/fixtures/whitequark/ambiuous_quoted_label_in_ternary_operator.txt b/test/prism/fixtures/whitequark/ambiuous_quoted_label_in_ternary_operator.txt new file mode 100644 index 0000000000..9b2e3afad5 --- /dev/null +++ b/test/prism/fixtures/whitequark/ambiuous_quoted_label_in_ternary_operator.txt @@ -0,0 +1 @@ +a ? b & '': nil diff --git a/test/prism/fixtures/whitequark/and.txt b/test/prism/fixtures/whitequark/and.txt new file mode 100644 index 0000000000..43fa6a65cd --- /dev/null +++ b/test/prism/fixtures/whitequark/and.txt @@ -0,0 +1,3 @@ +foo && bar + +foo and bar diff --git a/test/prism/fixtures/whitequark/and_asgn.txt b/test/prism/fixtures/whitequark/and_asgn.txt new file mode 100644 index 0000000000..a979265914 --- /dev/null +++ b/test/prism/fixtures/whitequark/and_asgn.txt @@ -0,0 +1,3 @@ +foo.a &&= 1 + +foo[0, 1] &&= 2 diff --git a/test/prism/fixtures/whitequark/and_or_masgn.txt b/test/prism/fixtures/whitequark/and_or_masgn.txt new file mode 100644 index 0000000000..e346041604 --- /dev/null +++ b/test/prism/fixtures/whitequark/and_or_masgn.txt @@ -0,0 +1,3 @@ +foo && (a, b = bar) + +foo || (a, b = bar) diff --git a/test/prism/fixtures/whitequark/anonymous_blockarg.txt b/test/prism/fixtures/whitequark/anonymous_blockarg.txt new file mode 100644 index 0000000000..e3eaaad6ce --- /dev/null +++ b/test/prism/fixtures/whitequark/anonymous_blockarg.txt @@ -0,0 +1 @@ +def foo(&); bar(&); end diff --git a/test/prism/fixtures/whitequark/arg.txt b/test/prism/fixtures/whitequark/arg.txt new file mode 100644 index 0000000000..b1984ad5c4 --- /dev/null +++ b/test/prism/fixtures/whitequark/arg.txt @@ -0,0 +1,3 @@ +def f(foo); end + +def f(foo, bar); end diff --git a/test/prism/fixtures/whitequark/arg_duplicate_ignored.txt b/test/prism/fixtures/whitequark/arg_duplicate_ignored.txt new file mode 100644 index 0000000000..0f5cc33961 --- /dev/null +++ b/test/prism/fixtures/whitequark/arg_duplicate_ignored.txt @@ -0,0 +1,3 @@ +def foo(_, _); end + +def foo(_a, _a); end diff --git a/test/prism/fixtures/whitequark/arg_label.txt b/test/prism/fixtures/whitequark/arg_label.txt new file mode 100644 index 0000000000..82db416cb4 --- /dev/null +++ b/test/prism/fixtures/whitequark/arg_label.txt @@ -0,0 +1,6 @@ +def foo + a:b end + +def foo() a:b end + +f { || a:b } diff --git a/test/prism/fixtures/whitequark/arg_scope.txt b/test/prism/fixtures/whitequark/arg_scope.txt new file mode 100644 index 0000000000..6c67ab72e3 --- /dev/null +++ b/test/prism/fixtures/whitequark/arg_scope.txt @@ -0,0 +1 @@ +lambda{|;a|a} diff --git a/test/prism/fixtures/whitequark/args.txt b/test/prism/fixtures/whitequark/args.txt new file mode 100644 index 0000000000..773be477d3 --- /dev/null +++ b/test/prism/fixtures/whitequark/args.txt @@ -0,0 +1,63 @@ +def f &b; end + +def f (((a))); end + +def f ((*)); end + +def f ((*, p)); end + +def f ((*r)); end + +def f ((*r, p)); end + +def f ((a, *)); end + +def f ((a, *, p)); end + +def f ((a, *r)); end + +def f ((a, *r, p)); end + +def f ((a, a1)); end + +def f (foo: 1, &b); end + +def f (foo: 1, bar: 2, **baz, &b); end + +def f **baz, &b; end + +def f *, **; end + +def f *r, &b; end + +def f *r, p, &b; end + +def f ; end + +def f a, &b; end + +def f a, *r, &b; end + +def f a, *r, p, &b; end + +def f a, o=1, &b; end + +def f a, o=1, *r, &b; end + +def f a, o=1, *r, p, &b; end + +def f a, o=1, p, &b; end + +def f foo: +; end + +def f foo: -1 +; end + +def f o=1, &b; end + +def f o=1, *r, &b; end + +def f o=1, *r, p, &b; end + +def f o=1, p, &b; end diff --git a/test/prism/fixtures/whitequark/args_args_assocs.txt b/test/prism/fixtures/whitequark/args_args_assocs.txt new file mode 100644 index 0000000000..445f899442 --- /dev/null +++ b/test/prism/fixtures/whitequark/args_args_assocs.txt @@ -0,0 +1,3 @@ +fun(foo, :foo => 1) + +fun(foo, :foo => 1, &baz) diff --git a/test/prism/fixtures/whitequark/args_args_assocs_comma.txt b/test/prism/fixtures/whitequark/args_args_assocs_comma.txt new file mode 100644 index 0000000000..b566a59037 --- /dev/null +++ b/test/prism/fixtures/whitequark/args_args_assocs_comma.txt @@ -0,0 +1 @@ +foo[bar, :baz => 1,] diff --git a/test/prism/fixtures/whitequark/args_args_comma.txt b/test/prism/fixtures/whitequark/args_args_comma.txt new file mode 100644 index 0000000000..80770716dd --- /dev/null +++ b/test/prism/fixtures/whitequark/args_args_comma.txt @@ -0,0 +1 @@ +foo[bar,] diff --git a/test/prism/fixtures/whitequark/args_args_star.txt b/test/prism/fixtures/whitequark/args_args_star.txt new file mode 100644 index 0000000000..d4dc9cc579 --- /dev/null +++ b/test/prism/fixtures/whitequark/args_args_star.txt @@ -0,0 +1,3 @@ +fun(foo, *bar) + +fun(foo, *bar, &baz) diff --git a/test/prism/fixtures/whitequark/args_assocs.txt b/test/prism/fixtures/whitequark/args_assocs.txt new file mode 100644 index 0000000000..b33e131181 --- /dev/null +++ b/test/prism/fixtures/whitequark/args_assocs.txt @@ -0,0 +1,11 @@ +fun(:foo => 1) + +fun(:foo => 1, &baz) + +self.[]= foo, :a => 1 + +self[:bar => 1] + +super(:foo => 42) + +yield(:foo => 42) diff --git a/test/prism/fixtures/whitequark/args_assocs_comma.txt b/test/prism/fixtures/whitequark/args_assocs_comma.txt new file mode 100644 index 0000000000..15e5cd65dc --- /dev/null +++ b/test/prism/fixtures/whitequark/args_assocs_comma.txt @@ -0,0 +1 @@ +foo[:baz => 1,] diff --git a/test/prism/fixtures/whitequark/args_assocs_legacy.txt b/test/prism/fixtures/whitequark/args_assocs_legacy.txt new file mode 100644 index 0000000000..b33e131181 --- /dev/null +++ b/test/prism/fixtures/whitequark/args_assocs_legacy.txt @@ -0,0 +1,11 @@ +fun(:foo => 1) + +fun(:foo => 1, &baz) + +self.[]= foo, :a => 1 + +self[:bar => 1] + +super(:foo => 42) + +yield(:foo => 42) diff --git a/test/prism/fixtures/whitequark/args_block_pass.txt b/test/prism/fixtures/whitequark/args_block_pass.txt new file mode 100644 index 0000000000..35d7d23885 --- /dev/null +++ b/test/prism/fixtures/whitequark/args_block_pass.txt @@ -0,0 +1 @@ +fun(&bar) diff --git a/test/prism/fixtures/whitequark/args_cmd.txt b/test/prism/fixtures/whitequark/args_cmd.txt new file mode 100644 index 0000000000..dd0c8891d0 --- /dev/null +++ b/test/prism/fixtures/whitequark/args_cmd.txt @@ -0,0 +1 @@ +fun(f bar) diff --git a/test/prism/fixtures/whitequark/args_star.txt b/test/prism/fixtures/whitequark/args_star.txt new file mode 100644 index 0000000000..ce1e6f8465 --- /dev/null +++ b/test/prism/fixtures/whitequark/args_star.txt @@ -0,0 +1,3 @@ +fun(*bar) + +fun(*bar, &baz) diff --git a/test/prism/fixtures/whitequark/array_assocs.txt b/test/prism/fixtures/whitequark/array_assocs.txt new file mode 100644 index 0000000000..fcecfcdefc --- /dev/null +++ b/test/prism/fixtures/whitequark/array_assocs.txt @@ -0,0 +1,3 @@ +[ 1 => 2 ] + +[ 1, 2 => 3 ] diff --git a/test/prism/fixtures/whitequark/array_plain.txt b/test/prism/fixtures/whitequark/array_plain.txt new file mode 100644 index 0000000000..44e2ace7e5 --- /dev/null +++ b/test/prism/fixtures/whitequark/array_plain.txt @@ -0,0 +1 @@ +[1, 2] diff --git a/test/prism/fixtures/whitequark/array_splat.txt b/test/prism/fixtures/whitequark/array_splat.txt new file mode 100644 index 0000000000..144c1eb124 --- /dev/null +++ b/test/prism/fixtures/whitequark/array_splat.txt @@ -0,0 +1,5 @@ +[*foo] + +[1, *foo, 2] + +[1, *foo] diff --git a/test/prism/fixtures/whitequark/array_symbols.txt b/test/prism/fixtures/whitequark/array_symbols.txt new file mode 100644 index 0000000000..a9f9df0404 --- /dev/null +++ b/test/prism/fixtures/whitequark/array_symbols.txt @@ -0,0 +1 @@ +%i[foo bar] diff --git a/test/prism/fixtures/whitequark/array_symbols_empty.txt b/test/prism/fixtures/whitequark/array_symbols_empty.txt new file mode 100644 index 0000000000..da3a89ee9b --- /dev/null +++ b/test/prism/fixtures/whitequark/array_symbols_empty.txt @@ -0,0 +1,3 @@ +%I() + +%i[] diff --git a/test/prism/fixtures/whitequark/array_symbols_interp.txt b/test/prism/fixtures/whitequark/array_symbols_interp.txt new file mode 100644 index 0000000000..d4950d0c05 --- /dev/null +++ b/test/prism/fixtures/whitequark/array_symbols_interp.txt @@ -0,0 +1,3 @@ +%I[foo #{bar}] + +%I[foo#{bar}] diff --git a/test/prism/fixtures/whitequark/array_words.txt b/test/prism/fixtures/whitequark/array_words.txt new file mode 100644 index 0000000000..a07380cadc --- /dev/null +++ b/test/prism/fixtures/whitequark/array_words.txt @@ -0,0 +1 @@ +%w[foo bar] diff --git a/test/prism/fixtures/whitequark/array_words_empty.txt b/test/prism/fixtures/whitequark/array_words_empty.txt new file mode 100644 index 0000000000..7568263f4a --- /dev/null +++ b/test/prism/fixtures/whitequark/array_words_empty.txt @@ -0,0 +1,3 @@ +%W() + +%w[] diff --git a/test/prism/fixtures/whitequark/array_words_interp.txt b/test/prism/fixtures/whitequark/array_words_interp.txt new file mode 100644 index 0000000000..1460f7dc03 --- /dev/null +++ b/test/prism/fixtures/whitequark/array_words_interp.txt @@ -0,0 +1,3 @@ +%W[foo #{bar}] + +%W[foo #{bar}foo#@baz] diff --git a/test/prism/fixtures/whitequark/asgn_cmd.txt b/test/prism/fixtures/whitequark/asgn_cmd.txt new file mode 100644 index 0000000000..81f8cc1c8d --- /dev/null +++ b/test/prism/fixtures/whitequark/asgn_cmd.txt @@ -0,0 +1,3 @@ +foo = bar = m foo + +foo = m foo diff --git a/test/prism/fixtures/whitequark/asgn_mrhs.txt b/test/prism/fixtures/whitequark/asgn_mrhs.txt new file mode 100644 index 0000000000..f0b0055e55 --- /dev/null +++ b/test/prism/fixtures/whitequark/asgn_mrhs.txt @@ -0,0 +1,5 @@ +foo = *bar + +foo = bar, 1 + +foo = baz, *bar diff --git a/test/prism/fixtures/whitequark/back_ref.txt b/test/prism/fixtures/whitequark/back_ref.txt new file mode 100644 index 0000000000..03166e10ee --- /dev/null +++ b/test/prism/fixtures/whitequark/back_ref.txt @@ -0,0 +1 @@ +$+ diff --git a/test/prism/fixtures/whitequark/bang.txt b/test/prism/fixtures/whitequark/bang.txt new file mode 100644 index 0000000000..6cf9410cf5 --- /dev/null +++ b/test/prism/fixtures/whitequark/bang.txt @@ -0,0 +1 @@ +!foo diff --git a/test/prism/fixtures/whitequark/bang_cmd.txt b/test/prism/fixtures/whitequark/bang_cmd.txt new file mode 100644 index 0000000000..0a5252c001 --- /dev/null +++ b/test/prism/fixtures/whitequark/bang_cmd.txt @@ -0,0 +1 @@ +!m foo diff --git a/test/prism/fixtures/whitequark/begin_cmdarg.txt b/test/prism/fixtures/whitequark/begin_cmdarg.txt new file mode 100644 index 0000000000..a5873668e9 --- /dev/null +++ b/test/prism/fixtures/whitequark/begin_cmdarg.txt @@ -0,0 +1 @@ +p begin 1.times do 1 end end diff --git a/test/prism/fixtures/whitequark/beginless_erange_after_newline.txt b/test/prism/fixtures/whitequark/beginless_erange_after_newline.txt new file mode 100644 index 0000000000..ae6c75564a --- /dev/null +++ b/test/prism/fixtures/whitequark/beginless_erange_after_newline.txt @@ -0,0 +1,2 @@ +foo +...100 diff --git a/test/prism/fixtures/whitequark/beginless_irange_after_newline.txt b/test/prism/fixtures/whitequark/beginless_irange_after_newline.txt new file mode 100644 index 0000000000..bfc8d5e5e8 --- /dev/null +++ b/test/prism/fixtures/whitequark/beginless_irange_after_newline.txt @@ -0,0 +1,2 @@ +foo +..100 diff --git a/test/prism/fixtures/whitequark/beginless_range.txt b/test/prism/fixtures/whitequark/beginless_range.txt new file mode 100644 index 0000000000..ef52703b8a --- /dev/null +++ b/test/prism/fixtures/whitequark/beginless_range.txt @@ -0,0 +1,3 @@ +...100 + +..100 diff --git a/test/prism/fixtures/whitequark/blockarg.txt b/test/prism/fixtures/whitequark/blockarg.txt new file mode 100644 index 0000000000..63552e97be --- /dev/null +++ b/test/prism/fixtures/whitequark/blockarg.txt @@ -0,0 +1 @@ +def f(&block); end diff --git a/test/prism/fixtures/whitequark/blockargs.txt b/test/prism/fixtures/whitequark/blockargs.txt new file mode 100644 index 0000000000..cdd2c4f331 --- /dev/null +++ b/test/prism/fixtures/whitequark/blockargs.txt @@ -0,0 +1,71 @@ +f{ } + +f{ | | } + +f{ |&b| } + +f{ |**baz, &b| } + +f{ |*, &b| } + +f{ |*r, p, &b| } + +f{ |*s, &b| } + +f{ |*s| } + +f{ |*| } + +f{ |; +a +| } + +f{ |;a| } + +f{ |a, &b| } + +f{ |a, *, &b| } + +f{ |a, *r, p, &b| } + +f{ |a, *s, &b| } + +f{ |a, *s| } + +f{ |a, *| } + +f{ |a, b,| } + +f{ |a, c| } + +f{ |a, o=1, &b| } + +f{ |a, o=1, *r, p, &b| } + +f{ |a, o=1, o1=2, *r, &b| } + +f{ |a, o=1, p, &b| } + +f{ |a,| } + +f{ |a| } + +f{ |a| } + +f{ |a| } + +f{ |foo: 1, &b| } + +f{ |foo: 1, bar: 2, **baz, &b| } + +f{ |foo:| } + +f{ |o=1, &b| } + +f{ |o=1, *r, &b| } + +f{ |o=1, *r, p, &b| } + +f{ |o=1, p, &b| } + +f{ || } diff --git a/test/prism/fixtures/whitequark/break.txt b/test/prism/fixtures/whitequark/break.txt new file mode 100644 index 0000000000..da51ec7c31 --- /dev/null +++ b/test/prism/fixtures/whitequark/break.txt @@ -0,0 +1,7 @@ +break + +break foo + +break() + +break(foo) diff --git a/test/prism/fixtures/whitequark/break_block.txt b/test/prism/fixtures/whitequark/break_block.txt new file mode 100644 index 0000000000..4b58c58d5e --- /dev/null +++ b/test/prism/fixtures/whitequark/break_block.txt @@ -0,0 +1 @@ +break fun foo do end diff --git a/test/prism/fixtures/whitequark/bug_435.txt b/test/prism/fixtures/whitequark/bug_435.txt new file mode 100644 index 0000000000..3e4e0d5abd --- /dev/null +++ b/test/prism/fixtures/whitequark/bug_435.txt @@ -0,0 +1 @@ +"#{-> foo {}}" diff --git a/test/prism/fixtures/whitequark/bug_447.txt b/test/prism/fixtures/whitequark/bug_447.txt new file mode 100644 index 0000000000..7da59bbc2f --- /dev/null +++ b/test/prism/fixtures/whitequark/bug_447.txt @@ -0,0 +1,3 @@ +m [] do end + +m [], 1 do end diff --git a/test/prism/fixtures/whitequark/bug_452.txt b/test/prism/fixtures/whitequark/bug_452.txt new file mode 100644 index 0000000000..8b41dd6027 --- /dev/null +++ b/test/prism/fixtures/whitequark/bug_452.txt @@ -0,0 +1 @@ +td (1_500).toString(); td.num do; end diff --git a/test/prism/fixtures/whitequark/bug_466.txt b/test/prism/fixtures/whitequark/bug_466.txt new file mode 100644 index 0000000000..ad02ad38ae --- /dev/null +++ b/test/prism/fixtures/whitequark/bug_466.txt @@ -0,0 +1 @@ +foo "#{(1+1).to_i}" do; end diff --git a/test/prism/fixtures/whitequark/bug_473.txt b/test/prism/fixtures/whitequark/bug_473.txt new file mode 100644 index 0000000000..0d2ea883a1 --- /dev/null +++ b/test/prism/fixtures/whitequark/bug_473.txt @@ -0,0 +1 @@ +m "#{[]}" diff --git a/test/prism/fixtures/whitequark/bug_480.txt b/test/prism/fixtures/whitequark/bug_480.txt new file mode 100644 index 0000000000..0558b2c957 --- /dev/null +++ b/test/prism/fixtures/whitequark/bug_480.txt @@ -0,0 +1 @@ +m "#{}#{()}" diff --git a/test/prism/fixtures/whitequark/bug_481.txt b/test/prism/fixtures/whitequark/bug_481.txt new file mode 100644 index 0000000000..6328e9dbbd --- /dev/null +++ b/test/prism/fixtures/whitequark/bug_481.txt @@ -0,0 +1 @@ +m def x(); end; 1.tap do end diff --git a/test/prism/fixtures/whitequark/bug_ascii_8bit_in_literal.txt b/test/prism/fixtures/whitequark/bug_ascii_8bit_in_literal.txt new file mode 100644 index 0000000000..85399bd19a --- /dev/null +++ b/test/prism/fixtures/whitequark/bug_ascii_8bit_in_literal.txt @@ -0,0 +1,2 @@ +# coding:utf-8 + "\xD0\xBF\xD1\x80\xD0\xBE\xD0\xB2\xD0\xB5\xD1\x80\xD0\xBA\xD0\xB0" diff --git a/test/prism/fixtures/whitequark/bug_cmd_string_lookahead.txt b/test/prism/fixtures/whitequark/bug_cmd_string_lookahead.txt new file mode 100644 index 0000000000..7e9e54c518 --- /dev/null +++ b/test/prism/fixtures/whitequark/bug_cmd_string_lookahead.txt @@ -0,0 +1 @@ +desc "foo" do end diff --git a/test/prism/fixtures/whitequark/bug_cmdarg.txt b/test/prism/fixtures/whitequark/bug_cmdarg.txt new file mode 100644 index 0000000000..0281cd6668 --- /dev/null +++ b/test/prism/fixtures/whitequark/bug_cmdarg.txt @@ -0,0 +1,5 @@ +assert do: true + +assert dogs + +f x: -> do meth do end end diff --git a/test/prism/fixtures/whitequark/bug_def_no_paren_eql_begin.txt b/test/prism/fixtures/whitequark/bug_def_no_paren_eql_begin.txt new file mode 100644 index 0000000000..615dc88217 --- /dev/null +++ b/test/prism/fixtures/whitequark/bug_def_no_paren_eql_begin.txt @@ -0,0 +1,4 @@ +def foo +=begin +=end +end diff --git a/test/prism/fixtures/whitequark/bug_do_block_in_call_args.txt b/test/prism/fixtures/whitequark/bug_do_block_in_call_args.txt new file mode 100644 index 0000000000..21340fd6e8 --- /dev/null +++ b/test/prism/fixtures/whitequark/bug_do_block_in_call_args.txt @@ -0,0 +1 @@ +bar def foo; self.each do end end diff --git a/test/prism/fixtures/whitequark/bug_do_block_in_cmdarg.txt b/test/prism/fixtures/whitequark/bug_do_block_in_cmdarg.txt new file mode 100644 index 0000000000..7dece50408 --- /dev/null +++ b/test/prism/fixtures/whitequark/bug_do_block_in_cmdarg.txt @@ -0,0 +1 @@ +tap (proc do end) diff --git a/test/prism/fixtures/whitequark/bug_do_block_in_hash_brace.txt b/test/prism/fixtures/whitequark/bug_do_block_in_hash_brace.txt new file mode 100644 index 0000000000..6c4dd205d2 --- /dev/null +++ b/test/prism/fixtures/whitequark/bug_do_block_in_hash_brace.txt @@ -0,0 +1,9 @@ +p :foo, {"a": proc do end, b: proc do end} + +p :foo, {** proc do end, b: proc do end} + +p :foo, {:a => proc do end, b: proc do end} + +p :foo, {a: proc do end, b: proc do end} + +p :foo, {proc do end => proc do end, b: proc do end} diff --git a/test/prism/fixtures/whitequark/bug_heredoc_do.txt b/test/prism/fixtures/whitequark/bug_heredoc_do.txt new file mode 100644 index 0000000000..06fef0a99f --- /dev/null +++ b/test/prism/fixtures/whitequark/bug_heredoc_do.txt @@ -0,0 +1,3 @@ +f <<-TABLE do +TABLE +end diff --git a/test/prism/fixtures/whitequark/bug_interp_single.txt b/test/prism/fixtures/whitequark/bug_interp_single.txt new file mode 100644 index 0000000000..be0b1a8542 --- /dev/null +++ b/test/prism/fixtures/whitequark/bug_interp_single.txt @@ -0,0 +1,3 @@ +"#{1}" + +%W"#{1}" diff --git a/test/prism/fixtures/whitequark/bug_lambda_leakage.txt b/test/prism/fixtures/whitequark/bug_lambda_leakage.txt new file mode 100644 index 0000000000..372b36929a --- /dev/null +++ b/test/prism/fixtures/whitequark/bug_lambda_leakage.txt @@ -0,0 +1 @@ +->(scope) {}; scope diff --git a/test/prism/fixtures/whitequark/bug_regex_verification.txt b/test/prism/fixtures/whitequark/bug_regex_verification.txt new file mode 100644 index 0000000000..f8483c8b10 --- /dev/null +++ b/test/prism/fixtures/whitequark/bug_regex_verification.txt @@ -0,0 +1 @@ +/#)/x diff --git a/test/prism/fixtures/whitequark/bug_rescue_empty_else.txt b/test/prism/fixtures/whitequark/bug_rescue_empty_else.txt new file mode 100644 index 0000000000..e8c81edc57 --- /dev/null +++ b/test/prism/fixtures/whitequark/bug_rescue_empty_else.txt @@ -0,0 +1 @@ +begin; rescue LoadError; else; end diff --git a/test/prism/fixtures/whitequark/bug_while_not_parens_do.txt b/test/prism/fixtures/whitequark/bug_while_not_parens_do.txt new file mode 100644 index 0000000000..628c36ef13 --- /dev/null +++ b/test/prism/fixtures/whitequark/bug_while_not_parens_do.txt @@ -0,0 +1 @@ +while not (true) do end diff --git a/test/prism/fixtures/whitequark/case_cond.txt b/test/prism/fixtures/whitequark/case_cond.txt new file mode 100644 index 0000000000..a236b27ebd --- /dev/null +++ b/test/prism/fixtures/whitequark/case_cond.txt @@ -0,0 +1 @@ +case; when foo; 'foo'; end diff --git a/test/prism/fixtures/whitequark/case_cond_else.txt b/test/prism/fixtures/whitequark/case_cond_else.txt new file mode 100644 index 0000000000..06eefa4a1b --- /dev/null +++ b/test/prism/fixtures/whitequark/case_cond_else.txt @@ -0,0 +1 @@ +case; when foo; 'foo'; else 'bar'; end diff --git a/test/prism/fixtures/whitequark/case_expr.txt b/test/prism/fixtures/whitequark/case_expr.txt new file mode 100644 index 0000000000..472672c781 --- /dev/null +++ b/test/prism/fixtures/whitequark/case_expr.txt @@ -0,0 +1 @@ +case foo; when 'bar'; bar; end diff --git a/test/prism/fixtures/whitequark/case_expr_else.txt b/test/prism/fixtures/whitequark/case_expr_else.txt new file mode 100644 index 0000000000..3c55826134 --- /dev/null +++ b/test/prism/fixtures/whitequark/case_expr_else.txt @@ -0,0 +1 @@ +case foo; when 'bar'; bar; else baz; end diff --git a/test/prism/fixtures/whitequark/casgn_scoped.txt b/test/prism/fixtures/whitequark/casgn_scoped.txt new file mode 100644 index 0000000000..964d0f4c9b --- /dev/null +++ b/test/prism/fixtures/whitequark/casgn_scoped.txt @@ -0,0 +1 @@ +Bar::Foo = 10 diff --git a/test/prism/fixtures/whitequark/casgn_toplevel.txt b/test/prism/fixtures/whitequark/casgn_toplevel.txt new file mode 100644 index 0000000000..047a3b6745 --- /dev/null +++ b/test/prism/fixtures/whitequark/casgn_toplevel.txt @@ -0,0 +1 @@ +::Foo = 10 diff --git a/test/prism/fixtures/whitequark/casgn_unscoped.txt b/test/prism/fixtures/whitequark/casgn_unscoped.txt new file mode 100644 index 0000000000..5632cf64ee --- /dev/null +++ b/test/prism/fixtures/whitequark/casgn_unscoped.txt @@ -0,0 +1 @@ +Foo = 10 diff --git a/test/prism/fixtures/whitequark/character.txt b/test/prism/fixtures/whitequark/character.txt new file mode 100644 index 0000000000..b22ffbb71a --- /dev/null +++ b/test/prism/fixtures/whitequark/character.txt @@ -0,0 +1 @@ +?a diff --git a/test/prism/fixtures/whitequark/class.txt b/test/prism/fixtures/whitequark/class.txt new file mode 100644 index 0000000000..a30a248e96 --- /dev/null +++ b/test/prism/fixtures/whitequark/class.txt @@ -0,0 +1,3 @@ +class Foo end + +class Foo; end diff --git a/test/prism/fixtures/whitequark/class_definition_in_while_cond.txt b/test/prism/fixtures/whitequark/class_definition_in_while_cond.txt new file mode 100644 index 0000000000..10427314b5 --- /dev/null +++ b/test/prism/fixtures/whitequark/class_definition_in_while_cond.txt @@ -0,0 +1,7 @@ +while class << self; a = tap do end; end; break; end + +while class << self; tap do end; end; break; end + +while class Foo a = tap do end; end; break; end + +while class Foo; tap do end; end; break; end diff --git a/test/prism/fixtures/whitequark/class_super.txt b/test/prism/fixtures/whitequark/class_super.txt new file mode 100644 index 0000000000..8829d82d36 --- /dev/null +++ b/test/prism/fixtures/whitequark/class_super.txt @@ -0,0 +1 @@ +class Foo < Bar; end diff --git a/test/prism/fixtures/whitequark/class_super_label.txt b/test/prism/fixtures/whitequark/class_super_label.txt new file mode 100644 index 0000000000..5d47897ab6 --- /dev/null +++ b/test/prism/fixtures/whitequark/class_super_label.txt @@ -0,0 +1 @@ +class Foo < a:b; end diff --git a/test/prism/fixtures/whitequark/comments_before_leading_dot__27.txt b/test/prism/fixtures/whitequark/comments_before_leading_dot__27.txt new file mode 100644 index 0000000000..208f2d87fe --- /dev/null +++ b/test/prism/fixtures/whitequark/comments_before_leading_dot__27.txt @@ -0,0 +1,19 @@ +a # + # +&.foo + + +a # + # +.foo + + +a # +# +&.foo + + +a # +# +.foo + diff --git a/test/prism/fixtures/whitequark/complex.txt b/test/prism/fixtures/whitequark/complex.txt new file mode 100644 index 0000000000..1dbf2c13f4 --- /dev/null +++ b/test/prism/fixtures/whitequark/complex.txt @@ -0,0 +1,7 @@ +42.1i + +42.1ri + +42i + +42ri diff --git a/test/prism/fixtures/whitequark/cond_begin.txt b/test/prism/fixtures/whitequark/cond_begin.txt new file mode 100644 index 0000000000..49d709b79c --- /dev/null +++ b/test/prism/fixtures/whitequark/cond_begin.txt @@ -0,0 +1 @@ +if (bar); foo; end diff --git a/test/prism/fixtures/whitequark/cond_begin_masgn.txt b/test/prism/fixtures/whitequark/cond_begin_masgn.txt new file mode 100644 index 0000000000..f9b65026b4 --- /dev/null +++ b/test/prism/fixtures/whitequark/cond_begin_masgn.txt @@ -0,0 +1 @@ +if (bar; a, b = foo); end diff --git a/test/prism/fixtures/whitequark/cond_eflipflop.txt b/test/prism/fixtures/whitequark/cond_eflipflop.txt new file mode 100644 index 0000000000..1236c2dbb5 --- /dev/null +++ b/test/prism/fixtures/whitequark/cond_eflipflop.txt @@ -0,0 +1,3 @@ +!(foo...bar) + +if foo...bar; end diff --git a/test/prism/fixtures/whitequark/cond_iflipflop.txt b/test/prism/fixtures/whitequark/cond_iflipflop.txt new file mode 100644 index 0000000000..84bee71a74 --- /dev/null +++ b/test/prism/fixtures/whitequark/cond_iflipflop.txt @@ -0,0 +1,3 @@ +!(foo..bar) + +if foo..bar; end diff --git a/test/prism/fixtures/whitequark/cond_match_current_line.txt b/test/prism/fixtures/whitequark/cond_match_current_line.txt new file mode 100644 index 0000000000..21878c7bd8 --- /dev/null +++ b/test/prism/fixtures/whitequark/cond_match_current_line.txt @@ -0,0 +1,3 @@ +!/wat/ + +if /wat/; end diff --git a/test/prism/fixtures/whitequark/const_op_asgn.txt b/test/prism/fixtures/whitequark/const_op_asgn.txt new file mode 100644 index 0000000000..e72e7adee8 --- /dev/null +++ b/test/prism/fixtures/whitequark/const_op_asgn.txt @@ -0,0 +1,9 @@ +::A += 1 + +A += 1 + +B::A += 1 + +def x; ::A ||= 1; end + +def x; self::A ||= 1; end diff --git a/test/prism/fixtures/whitequark/const_scoped.txt b/test/prism/fixtures/whitequark/const_scoped.txt new file mode 100644 index 0000000000..4b03d85fc0 --- /dev/null +++ b/test/prism/fixtures/whitequark/const_scoped.txt @@ -0,0 +1 @@ +Bar::Foo diff --git a/test/prism/fixtures/whitequark/const_toplevel.txt b/test/prism/fixtures/whitequark/const_toplevel.txt new file mode 100644 index 0000000000..f783ae752b --- /dev/null +++ b/test/prism/fixtures/whitequark/const_toplevel.txt @@ -0,0 +1 @@ +::Foo diff --git a/test/prism/fixtures/whitequark/const_unscoped.txt b/test/prism/fixtures/whitequark/const_unscoped.txt new file mode 100644 index 0000000000..bc56c4d894 --- /dev/null +++ b/test/prism/fixtures/whitequark/const_unscoped.txt @@ -0,0 +1 @@ +Foo diff --git a/test/prism/fixtures/whitequark/cpath.txt b/test/prism/fixtures/whitequark/cpath.txt new file mode 100644 index 0000000000..a4041692d1 --- /dev/null +++ b/test/prism/fixtures/whitequark/cpath.txt @@ -0,0 +1,3 @@ +module ::Foo; end + +module Bar::Foo; end diff --git a/test/prism/fixtures/whitequark/cvar.txt b/test/prism/fixtures/whitequark/cvar.txt new file mode 100644 index 0000000000..4997896e4a --- /dev/null +++ b/test/prism/fixtures/whitequark/cvar.txt @@ -0,0 +1 @@ +@@foo diff --git a/test/prism/fixtures/whitequark/cvasgn.txt b/test/prism/fixtures/whitequark/cvasgn.txt new file mode 100644 index 0000000000..8f7e19c4fe --- /dev/null +++ b/test/prism/fixtures/whitequark/cvasgn.txt @@ -0,0 +1 @@ +@@var = 10 diff --git a/test/prism/fixtures/whitequark/dedenting_heredoc.txt b/test/prism/fixtures/whitequark/dedenting_heredoc.txt new file mode 100644 index 0000000000..84937d84ab --- /dev/null +++ b/test/prism/fixtures/whitequark/dedenting_heredoc.txt @@ -0,0 +1,75 @@ +p <<~"E" + x + #{" y"} +E + +p <<~"E" + x + #{foo} +E + +p <<~E + x + y +E + +p <<~E + x + y +E + +p <<~E + x + y +E + +p <<~E + x + y +E + +p <<~E + x + \ y +E + +p <<~E + x + \ y +E + +p <<~E + E + +p <<~E + x + +y +E + +p <<~E + x + + y +E + +p <<~E + x + y +E + +p <<~E + x +E + +p <<~E + ð +E + +p <<~E +E + +p <<~`E` + x + #{foo} +E diff --git a/test/prism/fixtures/whitequark/dedenting_interpolating_heredoc_fake_line_continuation.txt b/test/prism/fixtures/whitequark/dedenting_interpolating_heredoc_fake_line_continuation.txt new file mode 100644 index 0000000000..0427715d61 --- /dev/null +++ b/test/prism/fixtures/whitequark/dedenting_interpolating_heredoc_fake_line_continuation.txt @@ -0,0 +1,4 @@ +<<~'FOO' + baz\\ + qux +FOO diff --git a/test/prism/fixtures/whitequark/dedenting_non_interpolating_heredoc_line_continuation.txt b/test/prism/fixtures/whitequark/dedenting_non_interpolating_heredoc_line_continuation.txt new file mode 100644 index 0000000000..fd7bc02419 --- /dev/null +++ b/test/prism/fixtures/whitequark/dedenting_non_interpolating_heredoc_line_continuation.txt @@ -0,0 +1,4 @@ +<<~'FOO' + baz\ + qux +FOO diff --git a/test/prism/fixtures/whitequark/def.txt b/test/prism/fixtures/whitequark/def.txt new file mode 100644 index 0000000000..d96a4238b3 --- /dev/null +++ b/test/prism/fixtures/whitequark/def.txt @@ -0,0 +1,11 @@ +def BEGIN; end + +def END; end + +def String; end + +def String=; end + +def foo; end + +def until; end diff --git a/test/prism/fixtures/whitequark/defined.txt b/test/prism/fixtures/whitequark/defined.txt new file mode 100644 index 0000000000..5cf93e22e3 --- /dev/null +++ b/test/prism/fixtures/whitequark/defined.txt @@ -0,0 +1,5 @@ +defined? @foo + +defined? foo + +defined?(foo) diff --git a/test/prism/fixtures/whitequark/defs.txt b/test/prism/fixtures/whitequark/defs.txt new file mode 100644 index 0000000000..e0b7aa86eb --- /dev/null +++ b/test/prism/fixtures/whitequark/defs.txt @@ -0,0 +1,9 @@ +def (foo).foo; end + +def String.foo; end + +def String::foo; end + +def self.foo; end + +def self::foo; end diff --git a/test/prism/fixtures/whitequark/empty_stmt.txt b/test/prism/fixtures/whitequark/empty_stmt.txt new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/test/prism/fixtures/whitequark/empty_stmt.txt @@ -0,0 +1 @@ + diff --git a/test/prism/fixtures/whitequark/endless_comparison_method.txt b/test/prism/fixtures/whitequark/endless_comparison_method.txt new file mode 100644 index 0000000000..e10c3a6ced --- /dev/null +++ b/test/prism/fixtures/whitequark/endless_comparison_method.txt @@ -0,0 +1,11 @@ +def !=(other) = do_something + +def !=(other) = do_something + +def <=(other) = do_something + +def ==(other) = do_something + +def ===(other) = do_something + +def >=(other) = do_something diff --git a/test/prism/fixtures/whitequark/endless_method.txt b/test/prism/fixtures/whitequark/endless_method.txt new file mode 100644 index 0000000000..7002526229 --- /dev/null +++ b/test/prism/fixtures/whitequark/endless_method.txt @@ -0,0 +1,7 @@ +def foo() = 42 + +def inc(x) = x + 1 + +def obj.foo() = 42 + +def obj.inc(x) = x + 1 diff --git a/test/prism/fixtures/whitequark/endless_method_command_syntax.txt b/test/prism/fixtures/whitequark/endless_method_command_syntax.txt new file mode 100644 index 0000000000..d9dad2d747 --- /dev/null +++ b/test/prism/fixtures/whitequark/endless_method_command_syntax.txt @@ -0,0 +1,15 @@ +def foo = puts "Hello" + +def foo() = puts "Hello" + +def foo(x) = puts x + +def obj.foo = puts "Hello" + +def obj.foo() = puts "Hello" + +def obj.foo(x) = puts x + +def rescued(x) = raise "to be caught" rescue "instance #{x}" + +def self.rescued(x) = raise "to be caught" rescue "class #{x}" diff --git a/test/prism/fixtures/whitequark/endless_method_forwarded_args_legacy.txt b/test/prism/fixtures/whitequark/endless_method_forwarded_args_legacy.txt new file mode 100644 index 0000000000..5955e40b5b --- /dev/null +++ b/test/prism/fixtures/whitequark/endless_method_forwarded_args_legacy.txt @@ -0,0 +1 @@ +def foo(...) = bar(...) diff --git a/test/prism/fixtures/whitequark/endless_method_with_rescue_mod.txt b/test/prism/fixtures/whitequark/endless_method_with_rescue_mod.txt new file mode 100644 index 0000000000..93dc63a45d --- /dev/null +++ b/test/prism/fixtures/whitequark/endless_method_with_rescue_mod.txt @@ -0,0 +1,3 @@ +def m() = 1 rescue 2 + +def self.m() = 1 rescue 2 diff --git a/test/prism/fixtures/whitequark/endless_method_without_args.txt b/test/prism/fixtures/whitequark/endless_method_without_args.txt new file mode 100644 index 0000000000..90ea8f7c6d --- /dev/null +++ b/test/prism/fixtures/whitequark/endless_method_without_args.txt @@ -0,0 +1,7 @@ +def foo = 42 + +def foo = 42 rescue nil + +def self.foo = 42 + +def self.foo = 42 rescue nil diff --git a/test/prism/fixtures/whitequark/ensure.txt b/test/prism/fixtures/whitequark/ensure.txt new file mode 100644 index 0000000000..6c4b47c63c --- /dev/null +++ b/test/prism/fixtures/whitequark/ensure.txt @@ -0,0 +1 @@ +begin; meth; ensure; bar; end diff --git a/test/prism/fixtures/whitequark/ensure_empty.txt b/test/prism/fixtures/whitequark/ensure_empty.txt new file mode 100644 index 0000000000..39a175c371 --- /dev/null +++ b/test/prism/fixtures/whitequark/ensure_empty.txt @@ -0,0 +1 @@ +begin ensure end diff --git a/test/prism/fixtures/whitequark/false.txt b/test/prism/fixtures/whitequark/false.txt new file mode 100644 index 0000000000..c508d5366f --- /dev/null +++ b/test/prism/fixtures/whitequark/false.txt @@ -0,0 +1 @@ +false diff --git a/test/prism/fixtures/whitequark/float.txt b/test/prism/fixtures/whitequark/float.txt new file mode 100644 index 0000000000..8c7592a192 --- /dev/null +++ b/test/prism/fixtures/whitequark/float.txt @@ -0,0 +1,3 @@ +-1.33 + +1.33 diff --git a/test/prism/fixtures/whitequark/for.txt b/test/prism/fixtures/whitequark/for.txt new file mode 100644 index 0000000000..a27ae578da --- /dev/null +++ b/test/prism/fixtures/whitequark/for.txt @@ -0,0 +1,3 @@ +for a in foo do p a; end + +for a in foo; p a; end diff --git a/test/prism/fixtures/whitequark/for_mlhs.txt b/test/prism/fixtures/whitequark/for_mlhs.txt new file mode 100644 index 0000000000..53cd5229a4 --- /dev/null +++ b/test/prism/fixtures/whitequark/for_mlhs.txt @@ -0,0 +1 @@ +for a, b in foo; p a, b; end diff --git a/test/prism/fixtures/whitequark/forward_arg.txt b/test/prism/fixtures/whitequark/forward_arg.txt new file mode 100644 index 0000000000..c7590a8d53 --- /dev/null +++ b/test/prism/fixtures/whitequark/forward_arg.txt @@ -0,0 +1 @@ +def foo(...); bar(...); end diff --git a/test/prism/fixtures/whitequark/forward_arg_with_open_args.txt b/test/prism/fixtures/whitequark/forward_arg_with_open_args.txt new file mode 100644 index 0000000000..fd4c06bcb5 --- /dev/null +++ b/test/prism/fixtures/whitequark/forward_arg_with_open_args.txt @@ -0,0 +1,27 @@ +(def foo ... + bar(...) +end) + +(def foo ...; bar(...); end) + +def foo ... +end + +def foo ...; bar(...); end + +def foo a, ... + bar(...) +end + +def foo a, ...; bar(...); end + +def foo a, b = 1, ... +end + +def foo b = 1, ... + bar(...) +end + +def foo b = 1, ...; bar(...); end + +def foo(a, ...) bar(...) end diff --git a/test/prism/fixtures/whitequark/forward_args_legacy.txt b/test/prism/fixtures/whitequark/forward_args_legacy.txt new file mode 100644 index 0000000000..0d9162457f --- /dev/null +++ b/test/prism/fixtures/whitequark/forward_args_legacy.txt @@ -0,0 +1,5 @@ +def foo(...); bar(...); end + +def foo(...); end + +def foo(...); super(...); end diff --git a/test/prism/fixtures/whitequark/forwarded_argument_with_kwrestarg.txt b/test/prism/fixtures/whitequark/forwarded_argument_with_kwrestarg.txt new file mode 100644 index 0000000000..7dbf472232 --- /dev/null +++ b/test/prism/fixtures/whitequark/forwarded_argument_with_kwrestarg.txt @@ -0,0 +1 @@ +def foo(argument, **); bar(argument, **); end diff --git a/test/prism/fixtures/whitequark/forwarded_argument_with_restarg.txt b/test/prism/fixtures/whitequark/forwarded_argument_with_restarg.txt new file mode 100644 index 0000000000..f734bfd9ec --- /dev/null +++ b/test/prism/fixtures/whitequark/forwarded_argument_with_restarg.txt @@ -0,0 +1 @@ +def foo(argument, *); bar(argument, *); end diff --git a/test/prism/fixtures/whitequark/forwarded_kwrestarg.txt b/test/prism/fixtures/whitequark/forwarded_kwrestarg.txt new file mode 100644 index 0000000000..16cd8b2913 --- /dev/null +++ b/test/prism/fixtures/whitequark/forwarded_kwrestarg.txt @@ -0,0 +1 @@ +def foo(**); bar(**); end diff --git a/test/prism/fixtures/whitequark/forwarded_kwrestarg_with_additional_kwarg.txt b/test/prism/fixtures/whitequark/forwarded_kwrestarg_with_additional_kwarg.txt new file mode 100644 index 0000000000..52759b838f --- /dev/null +++ b/test/prism/fixtures/whitequark/forwarded_kwrestarg_with_additional_kwarg.txt @@ -0,0 +1 @@ +def foo(**); bar(**, from_foo: true); end diff --git a/test/prism/fixtures/whitequark/forwarded_restarg.txt b/test/prism/fixtures/whitequark/forwarded_restarg.txt new file mode 100644 index 0000000000..65ac2cc1ed --- /dev/null +++ b/test/prism/fixtures/whitequark/forwarded_restarg.txt @@ -0,0 +1 @@ +def foo(*); bar(*); end diff --git a/test/prism/fixtures/whitequark/gvar.txt b/test/prism/fixtures/whitequark/gvar.txt new file mode 100644 index 0000000000..bbf13489ad --- /dev/null +++ b/test/prism/fixtures/whitequark/gvar.txt @@ -0,0 +1 @@ +$foo diff --git a/test/prism/fixtures/whitequark/gvasgn.txt b/test/prism/fixtures/whitequark/gvasgn.txt new file mode 100644 index 0000000000..2bcc22cdd1 --- /dev/null +++ b/test/prism/fixtures/whitequark/gvasgn.txt @@ -0,0 +1 @@ +$var = 10 diff --git a/test/prism/fixtures/whitequark/hash_empty.txt b/test/prism/fixtures/whitequark/hash_empty.txt new file mode 100644 index 0000000000..ffcd4415b0 --- /dev/null +++ b/test/prism/fixtures/whitequark/hash_empty.txt @@ -0,0 +1 @@ +{ } diff --git a/test/prism/fixtures/whitequark/hash_hashrocket.txt b/test/prism/fixtures/whitequark/hash_hashrocket.txt new file mode 100644 index 0000000000..2cbb3bd96d --- /dev/null +++ b/test/prism/fixtures/whitequark/hash_hashrocket.txt @@ -0,0 +1,3 @@ +{ 1 => 2 } + +{ 1 => 2, :foo => "bar" } diff --git a/test/prism/fixtures/whitequark/hash_kwsplat.txt b/test/prism/fixtures/whitequark/hash_kwsplat.txt new file mode 100644 index 0000000000..921aa97c7c --- /dev/null +++ b/test/prism/fixtures/whitequark/hash_kwsplat.txt @@ -0,0 +1 @@ +{ foo: 2, **bar } diff --git a/test/prism/fixtures/whitequark/hash_label.txt b/test/prism/fixtures/whitequark/hash_label.txt new file mode 100644 index 0000000000..3aacae4b69 --- /dev/null +++ b/test/prism/fixtures/whitequark/hash_label.txt @@ -0,0 +1 @@ +{ foo: 2 } diff --git a/test/prism/fixtures/whitequark/hash_label_end.txt b/test/prism/fixtures/whitequark/hash_label_end.txt new file mode 100644 index 0000000000..ac9f7c4b41 --- /dev/null +++ b/test/prism/fixtures/whitequark/hash_label_end.txt @@ -0,0 +1,5 @@ +f(a ? "a":1) + +{ 'foo': 2 } + +{ 'foo': 2, 'bar': {}} diff --git a/test/prism/fixtures/whitequark/hash_pair_value_omission.txt b/test/prism/fixtures/whitequark/hash_pair_value_omission.txt new file mode 100644 index 0000000000..9d8ccb5877 --- /dev/null +++ b/test/prism/fixtures/whitequark/hash_pair_value_omission.txt @@ -0,0 +1,5 @@ +{BAR:} + +{a:, b:} + +{puts:} diff --git a/test/prism/fixtures/whitequark/heredoc.txt b/test/prism/fixtures/whitequark/heredoc.txt new file mode 100644 index 0000000000..1bfc963f94 --- /dev/null +++ b/test/prism/fixtures/whitequark/heredoc.txt @@ -0,0 +1,14 @@ +<<'HERE' +foo +bar +HERE + +<<HERE +foo +bar +HERE + +<<`HERE` +foo +bar +HERE diff --git a/test/prism/fixtures/whitequark/if.txt b/test/prism/fixtures/whitequark/if.txt new file mode 100644 index 0000000000..3de3525286 --- /dev/null +++ b/test/prism/fixtures/whitequark/if.txt @@ -0,0 +1,3 @@ +if foo then bar; end + +if foo; bar; end diff --git a/test/prism/fixtures/whitequark/if_else.txt b/test/prism/fixtures/whitequark/if_else.txt new file mode 100644 index 0000000000..62bab8138c --- /dev/null +++ b/test/prism/fixtures/whitequark/if_else.txt @@ -0,0 +1,3 @@ +if foo then bar; else baz; end + +if foo; bar; else baz; end diff --git a/test/prism/fixtures/whitequark/if_elsif.txt b/test/prism/fixtures/whitequark/if_elsif.txt new file mode 100644 index 0000000000..4d71e82214 --- /dev/null +++ b/test/prism/fixtures/whitequark/if_elsif.txt @@ -0,0 +1 @@ +if foo; bar; elsif baz; 1; else 2; end diff --git a/test/prism/fixtures/whitequark/if_masgn__24.txt b/test/prism/fixtures/whitequark/if_masgn__24.txt new file mode 100644 index 0000000000..0c2c8bb04f --- /dev/null +++ b/test/prism/fixtures/whitequark/if_masgn__24.txt @@ -0,0 +1 @@ +if (a, b = foo); end diff --git a/test/prism/fixtures/whitequark/if_mod.txt b/test/prism/fixtures/whitequark/if_mod.txt new file mode 100644 index 0000000000..da177b5606 --- /dev/null +++ b/test/prism/fixtures/whitequark/if_mod.txt @@ -0,0 +1 @@ +bar if foo diff --git a/test/prism/fixtures/whitequark/if_nl_then.txt b/test/prism/fixtures/whitequark/if_nl_then.txt new file mode 100644 index 0000000000..b68107bad2 --- /dev/null +++ b/test/prism/fixtures/whitequark/if_nl_then.txt @@ -0,0 +1,2 @@ +if foo +then bar end diff --git a/test/prism/fixtures/whitequark/if_while_after_class__since_32.txt b/test/prism/fixtures/whitequark/if_while_after_class__since_32.txt new file mode 100644 index 0000000000..1552494d28 --- /dev/null +++ b/test/prism/fixtures/whitequark/if_while_after_class__since_32.txt @@ -0,0 +1,7 @@ +class if true; Object end::Kernel; end + +class while true; break Object end::Kernel; end + +module if true; Object end::Kernel; end + +module while true; break Object end::Kernel; end diff --git a/test/prism/fixtures/whitequark/int.txt b/test/prism/fixtures/whitequark/int.txt new file mode 100644 index 0000000000..6d419918c6 --- /dev/null +++ b/test/prism/fixtures/whitequark/int.txt @@ -0,0 +1,5 @@ ++42 + +-42 + +42 diff --git a/test/prism/fixtures/whitequark/int___LINE__.txt b/test/prism/fixtures/whitequark/int___LINE__.txt new file mode 100644 index 0000000000..05dcf7afe0 --- /dev/null +++ b/test/prism/fixtures/whitequark/int___LINE__.txt @@ -0,0 +1 @@ +__LINE__ diff --git a/test/prism/fixtures/whitequark/interp_digit_var.txt b/test/prism/fixtures/whitequark/interp_digit_var.txt new file mode 100644 index 0000000000..1ae5a2e3e0 --- /dev/null +++ b/test/prism/fixtures/whitequark/interp_digit_var.txt @@ -0,0 +1,87 @@ + "#@1" + + "#@@1" + + %I[#@1] + + %I[#@@1] + + %Q{#@1} + + %Q{#@@1} + + %W[#@1] + + %W[#@@1] + + %i[ #@1 ] + + %i[ #@@1 ] + + %q{#@1} + + %q{#@@1} + + %r{#@1} + + %r{#@@1} + + %s{#@1} + + %s{#@@1} + + %w[ #@1 ] + + %w[ #@@1 ] + + %x{#@1} + + %x{#@@1} + + %{#@1} + + %{#@@1} + + '#@1' + + '#@@1' + + /#@1/ + + /#@@1/ + + :"#@1" + + :"#@@1" + + :'#@1' + + :'#@@1' + + `#@1` + + `#@@1` + +<<-"HERE" +#@1 +HERE + +<<-"HERE" +#@@1 +HERE + +<<-'HERE' +#@1 +HERE + +<<-'HERE' +#@@1 +HERE + +<<-`HERE` +#@1 +HERE + +<<-`HERE` +#@@1 +HERE diff --git a/test/prism/fixtures/whitequark/ivar.txt b/test/prism/fixtures/whitequark/ivar.txt new file mode 100644 index 0000000000..9149fc67f9 --- /dev/null +++ b/test/prism/fixtures/whitequark/ivar.txt @@ -0,0 +1 @@ +@foo diff --git a/test/prism/fixtures/whitequark/ivasgn.txt b/test/prism/fixtures/whitequark/ivasgn.txt new file mode 100644 index 0000000000..ac291799db --- /dev/null +++ b/test/prism/fixtures/whitequark/ivasgn.txt @@ -0,0 +1 @@ +@var = 10 diff --git a/test/prism/fixtures/whitequark/keyword_argument_omission.txt b/test/prism/fixtures/whitequark/keyword_argument_omission.txt new file mode 100644 index 0000000000..47883dc9a5 --- /dev/null +++ b/test/prism/fixtures/whitequark/keyword_argument_omission.txt @@ -0,0 +1 @@ +foo(a:, b:) diff --git a/test/prism/fixtures/whitequark/kwarg.txt b/test/prism/fixtures/whitequark/kwarg.txt new file mode 100644 index 0000000000..ca02a1fd2a --- /dev/null +++ b/test/prism/fixtures/whitequark/kwarg.txt @@ -0,0 +1 @@ +def f(foo:); end diff --git a/test/prism/fixtures/whitequark/kwbegin_compstmt.txt b/test/prism/fixtures/whitequark/kwbegin_compstmt.txt new file mode 100644 index 0000000000..33ceff2489 --- /dev/null +++ b/test/prism/fixtures/whitequark/kwbegin_compstmt.txt @@ -0,0 +1 @@ +begin foo!; bar! end diff --git a/test/prism/fixtures/whitequark/kwnilarg.txt b/test/prism/fixtures/whitequark/kwnilarg.txt new file mode 100644 index 0000000000..8fc482d5af --- /dev/null +++ b/test/prism/fixtures/whitequark/kwnilarg.txt @@ -0,0 +1,5 @@ +->(**nil) {} + +def f(**nil); end + +m { |**nil| } diff --git a/test/prism/fixtures/whitequark/kwoptarg.txt b/test/prism/fixtures/whitequark/kwoptarg.txt new file mode 100644 index 0000000000..dc3ce728d6 --- /dev/null +++ b/test/prism/fixtures/whitequark/kwoptarg.txt @@ -0,0 +1 @@ +def f(foo: 1); end diff --git a/test/prism/fixtures/whitequark/kwoptarg_with_kwrestarg_and_forwarded_args.txt b/test/prism/fixtures/whitequark/kwoptarg_with_kwrestarg_and_forwarded_args.txt new file mode 100644 index 0000000000..99dcc7239b --- /dev/null +++ b/test/prism/fixtures/whitequark/kwoptarg_with_kwrestarg_and_forwarded_args.txt @@ -0,0 +1 @@ +def f(a: nil, **); b(**) end diff --git a/test/prism/fixtures/whitequark/kwrestarg_named.txt b/test/prism/fixtures/whitequark/kwrestarg_named.txt new file mode 100644 index 0000000000..e17a661001 --- /dev/null +++ b/test/prism/fixtures/whitequark/kwrestarg_named.txt @@ -0,0 +1 @@ +def f(**foo); end diff --git a/test/prism/fixtures/whitequark/kwrestarg_unnamed.txt b/test/prism/fixtures/whitequark/kwrestarg_unnamed.txt new file mode 100644 index 0000000000..1b26b1d2ac --- /dev/null +++ b/test/prism/fixtures/whitequark/kwrestarg_unnamed.txt @@ -0,0 +1 @@ +def f(**); end diff --git a/test/prism/fixtures/whitequark/lbrace_arg_after_command_args.txt b/test/prism/fixtures/whitequark/lbrace_arg_after_command_args.txt new file mode 100644 index 0000000000..277c200c9f --- /dev/null +++ b/test/prism/fixtures/whitequark/lbrace_arg_after_command_args.txt @@ -0,0 +1 @@ +let (:a) { m do; end } diff --git a/test/prism/fixtures/whitequark/lparenarg_after_lvar__since_25.txt b/test/prism/fixtures/whitequark/lparenarg_after_lvar__since_25.txt new file mode 100644 index 0000000000..dc3a98b1c8 --- /dev/null +++ b/test/prism/fixtures/whitequark/lparenarg_after_lvar__since_25.txt @@ -0,0 +1,3 @@ +foo (-1.3).abs + +meth (-1.3).abs diff --git a/test/prism/fixtures/whitequark/lvar.txt b/test/prism/fixtures/whitequark/lvar.txt new file mode 100644 index 0000000000..257cc5642c --- /dev/null +++ b/test/prism/fixtures/whitequark/lvar.txt @@ -0,0 +1 @@ +foo diff --git a/test/prism/fixtures/whitequark/lvar_injecting_match.txt b/test/prism/fixtures/whitequark/lvar_injecting_match.txt new file mode 100644 index 0000000000..ba814a1088 --- /dev/null +++ b/test/prism/fixtures/whitequark/lvar_injecting_match.txt @@ -0,0 +1 @@ +/(?<match>bar)/ =~ 'bar'; match diff --git a/test/prism/fixtures/whitequark/lvasgn.txt b/test/prism/fixtures/whitequark/lvasgn.txt new file mode 100644 index 0000000000..330b8eff27 --- /dev/null +++ b/test/prism/fixtures/whitequark/lvasgn.txt @@ -0,0 +1 @@ +var = 10; var diff --git a/test/prism/fixtures/whitequark/masgn.txt b/test/prism/fixtures/whitequark/masgn.txt new file mode 100644 index 0000000000..032124287c --- /dev/null +++ b/test/prism/fixtures/whitequark/masgn.txt @@ -0,0 +1,5 @@ +(foo, bar) = 1, 2 + +foo, bar = 1, 2 + +foo, bar, baz = 1, 2 diff --git a/test/prism/fixtures/whitequark/masgn_attr.txt b/test/prism/fixtures/whitequark/masgn_attr.txt new file mode 100644 index 0000000000..91a703ef44 --- /dev/null +++ b/test/prism/fixtures/whitequark/masgn_attr.txt @@ -0,0 +1,5 @@ +self.A, foo = foo + +self.a, self[1, 2] = foo + +self::a, foo = foo diff --git a/test/prism/fixtures/whitequark/masgn_cmd.txt b/test/prism/fixtures/whitequark/masgn_cmd.txt new file mode 100644 index 0000000000..18e096f1ee --- /dev/null +++ b/test/prism/fixtures/whitequark/masgn_cmd.txt @@ -0,0 +1 @@ +foo, bar = m foo diff --git a/test/prism/fixtures/whitequark/masgn_const.txt b/test/prism/fixtures/whitequark/masgn_const.txt new file mode 100644 index 0000000000..3b6fba588a --- /dev/null +++ b/test/prism/fixtures/whitequark/masgn_const.txt @@ -0,0 +1,3 @@ +::A, foo = foo + +self::A, foo = foo diff --git a/test/prism/fixtures/whitequark/masgn_nested.txt b/test/prism/fixtures/whitequark/masgn_nested.txt new file mode 100644 index 0000000000..a1ccf4e385 --- /dev/null +++ b/test/prism/fixtures/whitequark/masgn_nested.txt @@ -0,0 +1,3 @@ +((b, )) = foo + +a, (b, c) = foo diff --git a/test/prism/fixtures/whitequark/masgn_splat.txt b/test/prism/fixtures/whitequark/masgn_splat.txt new file mode 100644 index 0000000000..a15dab10f2 --- /dev/null +++ b/test/prism/fixtures/whitequark/masgn_splat.txt @@ -0,0 +1,19 @@ +* = bar + +*, c, d = bar + +*b = bar + +*b, c = bar + +@foo, @@bar = *foo + +a, * = bar + +a, *, c = bar + +a, *b = bar + +a, *b, c = bar + +a, b = *foo, bar diff --git a/test/prism/fixtures/whitequark/method_definition_in_while_cond.txt b/test/prism/fixtures/whitequark/method_definition_in_while_cond.txt new file mode 100644 index 0000000000..6ec38906a1 --- /dev/null +++ b/test/prism/fixtures/whitequark/method_definition_in_while_cond.txt @@ -0,0 +1,7 @@ +while def foo a = tap do end; end; break; end + +while def foo; tap do end; end; break; end + +while def self.foo a = tap do end; end; break; end + +while def self.foo; tap do end; end; break; end diff --git a/test/prism/fixtures/whitequark/module.txt b/test/prism/fixtures/whitequark/module.txt new file mode 100644 index 0000000000..f999df3791 --- /dev/null +++ b/test/prism/fixtures/whitequark/module.txt @@ -0,0 +1 @@ +module Foo; end diff --git a/test/prism/fixtures/whitequark/multiple_pattern_matches.txt b/test/prism/fixtures/whitequark/multiple_pattern_matches.txt new file mode 100644 index 0000000000..54a4bb4774 --- /dev/null +++ b/test/prism/fixtures/whitequark/multiple_pattern_matches.txt @@ -0,0 +1,5 @@ +{a: 0} => a: +{a: 0} => a: + +{a: 0} in a: +{a: 0} in a: diff --git a/test/prism/fixtures/whitequark/newline_in_hash_argument.txt b/test/prism/fixtures/whitequark/newline_in_hash_argument.txt new file mode 100644 index 0000000000..1681844331 --- /dev/null +++ b/test/prism/fixtures/whitequark/newline_in_hash_argument.txt @@ -0,0 +1,14 @@ +case foo +in a: +0 +true +in "b": +0 +true +end + +obj.set "foo": +1 + +obj.set foo: +1 diff --git a/test/prism/fixtures/whitequark/next.txt b/test/prism/fixtures/whitequark/next.txt new file mode 100644 index 0000000000..7556ac2b74 --- /dev/null +++ b/test/prism/fixtures/whitequark/next.txt @@ -0,0 +1,7 @@ +next + +next foo + +next() + +next(foo) diff --git a/test/prism/fixtures/whitequark/next_block.txt b/test/prism/fixtures/whitequark/next_block.txt new file mode 100644 index 0000000000..d3b51dfa21 --- /dev/null +++ b/test/prism/fixtures/whitequark/next_block.txt @@ -0,0 +1 @@ +next fun foo do end diff --git a/test/prism/fixtures/whitequark/nil.txt b/test/prism/fixtures/whitequark/nil.txt new file mode 100644 index 0000000000..607602cfc6 --- /dev/null +++ b/test/prism/fixtures/whitequark/nil.txt @@ -0,0 +1 @@ +nil diff --git a/test/prism/fixtures/whitequark/nil_expression.txt b/test/prism/fixtures/whitequark/nil_expression.txt new file mode 100644 index 0000000000..aabf53f005 --- /dev/null +++ b/test/prism/fixtures/whitequark/nil_expression.txt @@ -0,0 +1,3 @@ +() + +begin end diff --git a/test/prism/fixtures/whitequark/non_lvar_injecting_match.txt b/test/prism/fixtures/whitequark/non_lvar_injecting_match.txt new file mode 100644 index 0000000000..f1eb7d3c2c --- /dev/null +++ b/test/prism/fixtures/whitequark/non_lvar_injecting_match.txt @@ -0,0 +1 @@ +/#{1}(?<match>bar)/ =~ 'bar' diff --git a/test/prism/fixtures/whitequark/not.txt b/test/prism/fixtures/whitequark/not.txt new file mode 100644 index 0000000000..d87f68f48c --- /dev/null +++ b/test/prism/fixtures/whitequark/not.txt @@ -0,0 +1,5 @@ +not foo + +not() + +not(foo) diff --git a/test/prism/fixtures/whitequark/not_cmd.txt b/test/prism/fixtures/whitequark/not_cmd.txt new file mode 100644 index 0000000000..685ec209ee --- /dev/null +++ b/test/prism/fixtures/whitequark/not_cmd.txt @@ -0,0 +1 @@ +not m foo diff --git a/test/prism/fixtures/whitequark/not_masgn__24.txt b/test/prism/fixtures/whitequark/not_masgn__24.txt new file mode 100644 index 0000000000..cb93b9103d --- /dev/null +++ b/test/prism/fixtures/whitequark/not_masgn__24.txt @@ -0,0 +1 @@ +!(a, b = foo) diff --git a/test/prism/fixtures/whitequark/nth_ref.txt b/test/prism/fixtures/whitequark/nth_ref.txt new file mode 100644 index 0000000000..16ef65b105 --- /dev/null +++ b/test/prism/fixtures/whitequark/nth_ref.txt @@ -0,0 +1 @@ +$10 diff --git a/test/prism/fixtures/whitequark/numbered_args_after_27.txt b/test/prism/fixtures/whitequark/numbered_args_after_27.txt new file mode 100644 index 0000000000..96fe7a32e2 --- /dev/null +++ b/test/prism/fixtures/whitequark/numbered_args_after_27.txt @@ -0,0 +1,7 @@ +-> do _1 + _9 end + +-> { _1 + _9} + +m do _1 + _9 end + +m { _1 + _9 } diff --git a/test/prism/fixtures/whitequark/numparam_outside_block.txt b/test/prism/fixtures/whitequark/numparam_outside_block.txt new file mode 100644 index 0000000000..37cbce182d --- /dev/null +++ b/test/prism/fixtures/whitequark/numparam_outside_block.txt @@ -0,0 +1,9 @@ +_1 + +class << foo; _1; end + +class A; _1; end + +def self.m; _1; end + +module A; _1; end diff --git a/test/prism/fixtures/whitequark/op_asgn.txt b/test/prism/fixtures/whitequark/op_asgn.txt new file mode 100644 index 0000000000..a5a28b1010 --- /dev/null +++ b/test/prism/fixtures/whitequark/op_asgn.txt @@ -0,0 +1,5 @@ +foo.A += 1 + +foo.a += 1 + +foo::a += 1 diff --git a/test/prism/fixtures/whitequark/op_asgn_cmd.txt b/test/prism/fixtures/whitequark/op_asgn_cmd.txt new file mode 100644 index 0000000000..017aa9bef7 --- /dev/null +++ b/test/prism/fixtures/whitequark/op_asgn_cmd.txt @@ -0,0 +1,7 @@ +foo.A += m foo + +foo.a += m foo + +foo::A += m foo + +foo::a += m foo diff --git a/test/prism/fixtures/whitequark/op_asgn_index.txt b/test/prism/fixtures/whitequark/op_asgn_index.txt new file mode 100644 index 0000000000..92cfb225fc --- /dev/null +++ b/test/prism/fixtures/whitequark/op_asgn_index.txt @@ -0,0 +1 @@ +foo[0, 1] += 2 diff --git a/test/prism/fixtures/whitequark/op_asgn_index_cmd.txt b/test/prism/fixtures/whitequark/op_asgn_index_cmd.txt new file mode 100644 index 0000000000..161b244bd4 --- /dev/null +++ b/test/prism/fixtures/whitequark/op_asgn_index_cmd.txt @@ -0,0 +1 @@ +foo[0, 1] += m foo diff --git a/test/prism/fixtures/whitequark/optarg.txt b/test/prism/fixtures/whitequark/optarg.txt new file mode 100644 index 0000000000..9d60609961 --- /dev/null +++ b/test/prism/fixtures/whitequark/optarg.txt @@ -0,0 +1,3 @@ +def f foo = 1; end + +def f(foo=1, bar=2); end diff --git a/test/prism/fixtures/whitequark/or.txt b/test/prism/fixtures/whitequark/or.txt new file mode 100644 index 0000000000..c2042ebb41 --- /dev/null +++ b/test/prism/fixtures/whitequark/or.txt @@ -0,0 +1,3 @@ +foo or bar + +foo || bar diff --git a/test/prism/fixtures/whitequark/or_asgn.txt b/test/prism/fixtures/whitequark/or_asgn.txt new file mode 100644 index 0000000000..6e4ecc9f93 --- /dev/null +++ b/test/prism/fixtures/whitequark/or_asgn.txt @@ -0,0 +1,3 @@ +foo.a ||= 1 + +foo[0, 1] ||= 2 diff --git a/test/prism/fixtures/whitequark/parser_bug_272.txt b/test/prism/fixtures/whitequark/parser_bug_272.txt new file mode 100644 index 0000000000..2f2f2b84d2 --- /dev/null +++ b/test/prism/fixtures/whitequark/parser_bug_272.txt @@ -0,0 +1 @@ +a @b do |c|;end diff --git a/test/prism/fixtures/whitequark/parser_bug_490.txt b/test/prism/fixtures/whitequark/parser_bug_490.txt new file mode 100644 index 0000000000..cf544b1ff6 --- /dev/null +++ b/test/prism/fixtures/whitequark/parser_bug_490.txt @@ -0,0 +1,5 @@ +def m; class << self; A = nil; end; end + +def m; class << self; class C; end; end; end + +def m; class << self; module M; end; end; end diff --git a/test/prism/fixtures/whitequark/parser_bug_507.txt b/test/prism/fixtures/whitequark/parser_bug_507.txt new file mode 100644 index 0000000000..bf616b85c8 --- /dev/null +++ b/test/prism/fixtures/whitequark/parser_bug_507.txt @@ -0,0 +1 @@ +m = -> *args do end diff --git a/test/prism/fixtures/whitequark/parser_bug_518.txt b/test/prism/fixtures/whitequark/parser_bug_518.txt new file mode 100644 index 0000000000..22f4afe3c8 --- /dev/null +++ b/test/prism/fixtures/whitequark/parser_bug_518.txt @@ -0,0 +1,2 @@ +class A < B +end diff --git a/test/prism/fixtures/whitequark/parser_bug_525.txt b/test/prism/fixtures/whitequark/parser_bug_525.txt new file mode 100644 index 0000000000..59d0e735b4 --- /dev/null +++ b/test/prism/fixtures/whitequark/parser_bug_525.txt @@ -0,0 +1 @@ +m1 :k => m2 do; m3() do end; end diff --git a/test/prism/fixtures/whitequark/parser_bug_604.txt b/test/prism/fixtures/whitequark/parser_bug_604.txt new file mode 100644 index 0000000000..7eb91c2f46 --- /dev/null +++ b/test/prism/fixtures/whitequark/parser_bug_604.txt @@ -0,0 +1 @@ +m a + b do end diff --git a/test/prism/fixtures/whitequark/parser_bug_640.txt b/test/prism/fixtures/whitequark/parser_bug_640.txt new file mode 100644 index 0000000000..fb62ded04c --- /dev/null +++ b/test/prism/fixtures/whitequark/parser_bug_640.txt @@ -0,0 +1,4 @@ +<<~FOO + baz\ + qux +FOO diff --git a/test/prism/fixtures/whitequark/parser_bug_645.txt b/test/prism/fixtures/whitequark/parser_bug_645.txt new file mode 100644 index 0000000000..cb1e5a0dcf --- /dev/null +++ b/test/prism/fixtures/whitequark/parser_bug_645.txt @@ -0,0 +1 @@ +-> (arg={}) {} diff --git a/test/prism/fixtures/whitequark/parser_bug_830.txt b/test/prism/fixtures/whitequark/parser_bug_830.txt new file mode 100644 index 0000000000..e5865e960d --- /dev/null +++ b/test/prism/fixtures/whitequark/parser_bug_830.txt @@ -0,0 +1 @@ +/\(/ diff --git a/test/prism/fixtures/whitequark/parser_drops_truncated_parts_of_squiggly_heredoc.txt b/test/prism/fixtures/whitequark/parser_drops_truncated_parts_of_squiggly_heredoc.txt new file mode 100644 index 0000000000..bddae8e153 --- /dev/null +++ b/test/prism/fixtures/whitequark/parser_drops_truncated_parts_of_squiggly_heredoc.txt @@ -0,0 +1,3 @@ +<<~HERE + #{} +HERE diff --git a/test/prism/fixtures/whitequark/parser_slash_slash_n_escaping_in_literals.txt b/test/prism/fixtures/whitequark/parser_slash_slash_n_escaping_in_literals.txt new file mode 100644 index 0000000000..564cebdd74 --- /dev/null +++ b/test/prism/fixtures/whitequark/parser_slash_slash_n_escaping_in_literals.txt @@ -0,0 +1,62 @@ +"a\ +b" + +%I{a\ +b} + +%Q{a\ +b} + +%W{a\ +b} + +%i{a\ +b} + +%q{a\ +b} + +%r{a\ +b} + +%s{a\ +b} + +%w{a\ +b} + +%x{a\ +b} + +%{a\ +b} + +'a\ +b' + +/a\ +b/ + +:"a\ +b" + +:'a\ +b' + +<<-"HERE" +a\ +b +HERE + +<<-'HERE' +a\ +b +HERE + +<<-`HERE` +a\ +b +HERE + +`a\ +b` diff --git a/test/prism/fixtures/whitequark/pattern_matching__FILE__LINE_literals.txt b/test/prism/fixtures/whitequark/pattern_matching__FILE__LINE_literals.txt new file mode 100644 index 0000000000..fe0edaed55 --- /dev/null +++ b/test/prism/fixtures/whitequark/pattern_matching__FILE__LINE_literals.txt @@ -0,0 +1,4 @@ + case [__FILE__, __LINE__ + 1, __ENCODING__] + in [__FILE__, __LINE__, __ENCODING__] + end + diff --git a/test/prism/fixtures/whitequark/pattern_matching_blank_else.txt b/test/prism/fixtures/whitequark/pattern_matching_blank_else.txt new file mode 100644 index 0000000000..6bf059af41 --- /dev/null +++ b/test/prism/fixtures/whitequark/pattern_matching_blank_else.txt @@ -0,0 +1 @@ +case 1; in 2; 3; else; end diff --git a/test/prism/fixtures/whitequark/pattern_matching_else.txt b/test/prism/fixtures/whitequark/pattern_matching_else.txt new file mode 100644 index 0000000000..29f14c91ab --- /dev/null +++ b/test/prism/fixtures/whitequark/pattern_matching_else.txt @@ -0,0 +1 @@ +case 1; in 2; 3; else; 4; end diff --git a/test/prism/fixtures/whitequark/pattern_matching_single_line.txt b/test/prism/fixtures/whitequark/pattern_matching_single_line.txt new file mode 100644 index 0000000000..12279afa24 --- /dev/null +++ b/test/prism/fixtures/whitequark/pattern_matching_single_line.txt @@ -0,0 +1,3 @@ +1 => [a]; a + +1 in [a]; a diff --git a/test/prism/fixtures/whitequark/pattern_matching_single_line_allowed_omission_of_parentheses.txt b/test/prism/fixtures/whitequark/pattern_matching_single_line_allowed_omission_of_parentheses.txt new file mode 100644 index 0000000000..1e429335d0 --- /dev/null +++ b/test/prism/fixtures/whitequark/pattern_matching_single_line_allowed_omission_of_parentheses.txt @@ -0,0 +1,11 @@ +[1, 2] => a, b; a + +[1, 2] in a, b; a + +{a: 1} => a:; a + +{a: 1} in a:; a + +{key: :value} => key: value; value + +{key: :value} in key: value; value diff --git a/test/prism/fixtures/whitequark/postexe.txt b/test/prism/fixtures/whitequark/postexe.txt new file mode 100644 index 0000000000..baee33af66 --- /dev/null +++ b/test/prism/fixtures/whitequark/postexe.txt @@ -0,0 +1 @@ +END { 1 } diff --git a/test/prism/fixtures/whitequark/preexe.txt b/test/prism/fixtures/whitequark/preexe.txt new file mode 100644 index 0000000000..9e802f3f4e --- /dev/null +++ b/test/prism/fixtures/whitequark/preexe.txt @@ -0,0 +1 @@ +BEGIN { 1 } diff --git a/test/prism/fixtures/whitequark/procarg0.txt b/test/prism/fixtures/whitequark/procarg0.txt new file mode 100644 index 0000000000..74cae2c2eb --- /dev/null +++ b/test/prism/fixtures/whitequark/procarg0.txt @@ -0,0 +1,3 @@ +m { |(foo, bar)| } + +m { |foo| } diff --git a/test/prism/fixtures/whitequark/range_exclusive.txt b/test/prism/fixtures/whitequark/range_exclusive.txt new file mode 100644 index 0000000000..9e07faed27 --- /dev/null +++ b/test/prism/fixtures/whitequark/range_exclusive.txt @@ -0,0 +1 @@ +1...2 diff --git a/test/prism/fixtures/whitequark/range_inclusive.txt b/test/prism/fixtures/whitequark/range_inclusive.txt new file mode 100644 index 0000000000..8c12abf7de --- /dev/null +++ b/test/prism/fixtures/whitequark/range_inclusive.txt @@ -0,0 +1 @@ +1..2 diff --git a/test/prism/fixtures/whitequark/rational.txt b/test/prism/fixtures/whitequark/rational.txt new file mode 100644 index 0000000000..e11cacc742 --- /dev/null +++ b/test/prism/fixtures/whitequark/rational.txt @@ -0,0 +1,3 @@ +42.1r + +42r diff --git a/test/prism/fixtures/whitequark/redo.txt b/test/prism/fixtures/whitequark/redo.txt new file mode 100644 index 0000000000..f49789cbab --- /dev/null +++ b/test/prism/fixtures/whitequark/redo.txt @@ -0,0 +1 @@ +redo diff --git a/test/prism/fixtures/whitequark/regex_interp.txt b/test/prism/fixtures/whitequark/regex_interp.txt new file mode 100644 index 0000000000..f9ad7fcbc8 --- /dev/null +++ b/test/prism/fixtures/whitequark/regex_interp.txt @@ -0,0 +1 @@ +/foo#{bar}baz/ diff --git a/test/prism/fixtures/whitequark/regex_plain.txt b/test/prism/fixtures/whitequark/regex_plain.txt new file mode 100644 index 0000000000..b86faecf98 --- /dev/null +++ b/test/prism/fixtures/whitequark/regex_plain.txt @@ -0,0 +1 @@ +/source/im diff --git a/test/prism/fixtures/whitequark/resbody_list.txt b/test/prism/fixtures/whitequark/resbody_list.txt new file mode 100644 index 0000000000..e40d45fc45 --- /dev/null +++ b/test/prism/fixtures/whitequark/resbody_list.txt @@ -0,0 +1 @@ +begin; meth; rescue Exception; bar; end diff --git a/test/prism/fixtures/whitequark/resbody_list_mrhs.txt b/test/prism/fixtures/whitequark/resbody_list_mrhs.txt new file mode 100644 index 0000000000..92b8bb2c02 --- /dev/null +++ b/test/prism/fixtures/whitequark/resbody_list_mrhs.txt @@ -0,0 +1 @@ +begin; meth; rescue Exception, foo; bar; end diff --git a/test/prism/fixtures/whitequark/resbody_list_var.txt b/test/prism/fixtures/whitequark/resbody_list_var.txt new file mode 100644 index 0000000000..0a2fb90b6d --- /dev/null +++ b/test/prism/fixtures/whitequark/resbody_list_var.txt @@ -0,0 +1 @@ +begin; meth; rescue foo => ex; bar; end diff --git a/test/prism/fixtures/whitequark/resbody_var.txt b/test/prism/fixtures/whitequark/resbody_var.txt new file mode 100644 index 0000000000..2104ac58e7 --- /dev/null +++ b/test/prism/fixtures/whitequark/resbody_var.txt @@ -0,0 +1,3 @@ +begin; meth; rescue => @ex; bar; end + +begin; meth; rescue => ex; bar; end diff --git a/test/prism/fixtures/whitequark/rescue.txt b/test/prism/fixtures/whitequark/rescue.txt new file mode 100644 index 0000000000..2d3be9dc56 --- /dev/null +++ b/test/prism/fixtures/whitequark/rescue.txt @@ -0,0 +1 @@ +begin; meth; rescue; foo; end diff --git a/test/prism/fixtures/whitequark/rescue_else.txt b/test/prism/fixtures/whitequark/rescue_else.txt new file mode 100644 index 0000000000..a22f8d100e --- /dev/null +++ b/test/prism/fixtures/whitequark/rescue_else.txt @@ -0,0 +1 @@ +begin; meth; rescue; foo; else; bar; end diff --git a/test/prism/fixtures/whitequark/rescue_else_ensure.txt b/test/prism/fixtures/whitequark/rescue_else_ensure.txt new file mode 100644 index 0000000000..167eee194a --- /dev/null +++ b/test/prism/fixtures/whitequark/rescue_else_ensure.txt @@ -0,0 +1 @@ +begin; meth; rescue; baz; else foo; ensure; bar end diff --git a/test/prism/fixtures/whitequark/rescue_ensure.txt b/test/prism/fixtures/whitequark/rescue_ensure.txt new file mode 100644 index 0000000000..8237257c41 --- /dev/null +++ b/test/prism/fixtures/whitequark/rescue_ensure.txt @@ -0,0 +1 @@ +begin; meth; rescue; baz; ensure; bar; end diff --git a/test/prism/fixtures/whitequark/rescue_in_lambda_block.txt b/test/prism/fixtures/whitequark/rescue_in_lambda_block.txt new file mode 100644 index 0000000000..ccd8ed72c5 --- /dev/null +++ b/test/prism/fixtures/whitequark/rescue_in_lambda_block.txt @@ -0,0 +1 @@ +-> do rescue; end diff --git a/test/prism/fixtures/whitequark/rescue_mod.txt b/test/prism/fixtures/whitequark/rescue_mod.txt new file mode 100644 index 0000000000..06375d3e9b --- /dev/null +++ b/test/prism/fixtures/whitequark/rescue_mod.txt @@ -0,0 +1 @@ +meth rescue bar diff --git a/test/prism/fixtures/whitequark/rescue_mod_asgn.txt b/test/prism/fixtures/whitequark/rescue_mod_asgn.txt new file mode 100644 index 0000000000..abf7cd9a3d --- /dev/null +++ b/test/prism/fixtures/whitequark/rescue_mod_asgn.txt @@ -0,0 +1 @@ +foo = meth rescue bar diff --git a/test/prism/fixtures/whitequark/rescue_mod_masgn.txt b/test/prism/fixtures/whitequark/rescue_mod_masgn.txt new file mode 100644 index 0000000000..0716eb1f67 --- /dev/null +++ b/test/prism/fixtures/whitequark/rescue_mod_masgn.txt @@ -0,0 +1 @@ +foo, bar = meth rescue [1, 2] diff --git a/test/prism/fixtures/whitequark/rescue_mod_op_assign.txt b/test/prism/fixtures/whitequark/rescue_mod_op_assign.txt new file mode 100644 index 0000000000..178efa3a20 --- /dev/null +++ b/test/prism/fixtures/whitequark/rescue_mod_op_assign.txt @@ -0,0 +1 @@ +foo += meth rescue bar diff --git a/test/prism/fixtures/whitequark/rescue_without_begin_end.txt b/test/prism/fixtures/whitequark/rescue_without_begin_end.txt new file mode 100644 index 0000000000..8416569e2c --- /dev/null +++ b/test/prism/fixtures/whitequark/rescue_without_begin_end.txt @@ -0,0 +1 @@ +meth do; foo; rescue; bar; end diff --git a/test/prism/fixtures/whitequark/restarg_named.txt b/test/prism/fixtures/whitequark/restarg_named.txt new file mode 100644 index 0000000000..355cd8f493 --- /dev/null +++ b/test/prism/fixtures/whitequark/restarg_named.txt @@ -0,0 +1 @@ +def f(*foo); end diff --git a/test/prism/fixtures/whitequark/restarg_unnamed.txt b/test/prism/fixtures/whitequark/restarg_unnamed.txt new file mode 100644 index 0000000000..c9932dd30c --- /dev/null +++ b/test/prism/fixtures/whitequark/restarg_unnamed.txt @@ -0,0 +1 @@ +def f(*); end diff --git a/test/prism/fixtures/whitequark/retry.txt b/test/prism/fixtures/whitequark/retry.txt new file mode 100644 index 0000000000..77428f7b73 --- /dev/null +++ b/test/prism/fixtures/whitequark/retry.txt @@ -0,0 +1 @@ +retry diff --git a/test/prism/fixtures/whitequark/return.txt b/test/prism/fixtures/whitequark/return.txt new file mode 100644 index 0000000000..e3d966bda0 --- /dev/null +++ b/test/prism/fixtures/whitequark/return.txt @@ -0,0 +1,7 @@ +return + +return foo + +return() + +return(foo) diff --git a/test/prism/fixtures/whitequark/return_block.txt b/test/prism/fixtures/whitequark/return_block.txt new file mode 100644 index 0000000000..00723a7517 --- /dev/null +++ b/test/prism/fixtures/whitequark/return_block.txt @@ -0,0 +1 @@ +return fun foo do end diff --git a/test/prism/fixtures/whitequark/ruby_bug_10279.txt b/test/prism/fixtures/whitequark/ruby_bug_10279.txt new file mode 100644 index 0000000000..4d0fb213d8 --- /dev/null +++ b/test/prism/fixtures/whitequark/ruby_bug_10279.txt @@ -0,0 +1 @@ +{a: if true then 42 end} diff --git a/test/prism/fixtures/whitequark/ruby_bug_10653.txt b/test/prism/fixtures/whitequark/ruby_bug_10653.txt new file mode 100644 index 0000000000..51354a1f70 --- /dev/null +++ b/test/prism/fixtures/whitequark/ruby_bug_10653.txt @@ -0,0 +1,5 @@ +false ? raise do end : tap do end + +false ? raise {} : tap {} + +true ? 1.tap do |n| p n end : 0 diff --git a/test/prism/fixtures/whitequark/ruby_bug_11107.txt b/test/prism/fixtures/whitequark/ruby_bug_11107.txt new file mode 100644 index 0000000000..1f28cb06f6 --- /dev/null +++ b/test/prism/fixtures/whitequark/ruby_bug_11107.txt @@ -0,0 +1 @@ +p ->() do a() do end end diff --git a/test/prism/fixtures/whitequark/ruby_bug_11380.txt b/test/prism/fixtures/whitequark/ruby_bug_11380.txt new file mode 100644 index 0000000000..1631548e3a --- /dev/null +++ b/test/prism/fixtures/whitequark/ruby_bug_11380.txt @@ -0,0 +1 @@ +p -> { :hello }, a: 1 do end diff --git a/test/prism/fixtures/whitequark/ruby_bug_11873.txt b/test/prism/fixtures/whitequark/ruby_bug_11873.txt new file mode 100644 index 0000000000..a25aa9e267 --- /dev/null +++ b/test/prism/fixtures/whitequark/ruby_bug_11873.txt @@ -0,0 +1,23 @@ +a b(c d), "x" do end + +a b(c d), /x/ do end + +a b(c d), /x/m do end + +a b(c(d)), "x" do end + +a b(c(d)), /x/ do end + +a b(c(d)), /x/m do end + +a b{c d}, "x" do end + +a b{c d}, /x/ do end + +a b{c d}, /x/m do end + +a b{c(d)}, "x" do end + +a b{c(d)}, /x/ do end + +a b{c(d)}, /x/m do end diff --git a/test/prism/fixtures/whitequark/ruby_bug_11873_a.txt b/test/prism/fixtures/whitequark/ruby_bug_11873_a.txt new file mode 100644 index 0000000000..1856235ce5 --- /dev/null +++ b/test/prism/fixtures/whitequark/ruby_bug_11873_a.txt @@ -0,0 +1,39 @@ +a b(c d), 1 do end + +a b(c d), 1.0 do end + +a b(c d), 1.0i do end + +a b(c d), 1.0r do end + +a b(c d), :e do end + +a b(c(d)), 1 do end + +a b(c(d)), 1.0 do end + +a b(c(d)), 1.0i do end + +a b(c(d)), 1.0r do end + +a b(c(d)), :e do end + +a b{c d}, 1 do end + +a b{c d}, 1.0 do end + +a b{c d}, 1.0i do end + +a b{c d}, 1.0r do end + +a b{c d}, :e do end + +a b{c(d)}, 1 do end + +a b{c(d)}, 1.0 do end + +a b{c(d)}, 1.0i do end + +a b{c(d)}, 1.0r do end + +a b{c(d)}, :e do end diff --git a/test/prism/fixtures/whitequark/ruby_bug_11873_b.txt b/test/prism/fixtures/whitequark/ruby_bug_11873_b.txt new file mode 100644 index 0000000000..1b86662008 --- /dev/null +++ b/test/prism/fixtures/whitequark/ruby_bug_11873_b.txt @@ -0,0 +1 @@ +p p{p(p);p p}, tap do end diff --git a/test/prism/fixtures/whitequark/ruby_bug_11989.txt b/test/prism/fixtures/whitequark/ruby_bug_11989.txt new file mode 100644 index 0000000000..d49b8614ed --- /dev/null +++ b/test/prism/fixtures/whitequark/ruby_bug_11989.txt @@ -0,0 +1,3 @@ +p <<~"E" + x\n y +E diff --git a/test/prism/fixtures/whitequark/ruby_bug_11990.txt b/test/prism/fixtures/whitequark/ruby_bug_11990.txt new file mode 100644 index 0000000000..d0fe7b2739 --- /dev/null +++ b/test/prism/fixtures/whitequark/ruby_bug_11990.txt @@ -0,0 +1,3 @@ +p <<~E " y" + x +E diff --git a/test/prism/fixtures/whitequark/ruby_bug_12073.txt b/test/prism/fixtures/whitequark/ruby_bug_12073.txt new file mode 100644 index 0000000000..b2e3784422 --- /dev/null +++ b/test/prism/fixtures/whitequark/ruby_bug_12073.txt @@ -0,0 +1,3 @@ +a = 1; a b: 1 + +def foo raise; raise A::B, ''; end diff --git a/test/prism/fixtures/whitequark/ruby_bug_12402.txt b/test/prism/fixtures/whitequark/ruby_bug_12402.txt new file mode 100644 index 0000000000..060d5d95a1 --- /dev/null +++ b/test/prism/fixtures/whitequark/ruby_bug_12402.txt @@ -0,0 +1,27 @@ +foo += raise bar rescue nil + +foo += raise(bar) rescue nil + +foo = raise bar rescue nil + +foo = raise(bar) rescue nil + +foo.C += raise bar rescue nil + +foo.C += raise(bar) rescue nil + +foo.m += raise bar rescue nil + +foo.m += raise(bar) rescue nil + +foo::C ||= raise bar rescue nil + +foo::C ||= raise(bar) rescue nil + +foo::m += raise bar rescue nil + +foo::m += raise(bar) rescue nil + +foo[0] += raise bar rescue nil + +foo[0] += raise(bar) rescue nil diff --git a/test/prism/fixtures/whitequark/ruby_bug_12669.txt b/test/prism/fixtures/whitequark/ruby_bug_12669.txt new file mode 100644 index 0000000000..cd89689446 --- /dev/null +++ b/test/prism/fixtures/whitequark/ruby_bug_12669.txt @@ -0,0 +1,7 @@ +a += b += raise :x + +a += b = raise :x + +a = b += raise :x + +a = b = raise :x diff --git a/test/prism/fixtures/whitequark/ruby_bug_12686.txt b/test/prism/fixtures/whitequark/ruby_bug_12686.txt new file mode 100644 index 0000000000..7742e791b8 --- /dev/null +++ b/test/prism/fixtures/whitequark/ruby_bug_12686.txt @@ -0,0 +1 @@ +f (g rescue nil) diff --git a/test/prism/fixtures/whitequark/ruby_bug_13547.txt b/test/prism/fixtures/whitequark/ruby_bug_13547.txt new file mode 100644 index 0000000000..29eafc3a4c --- /dev/null +++ b/test/prism/fixtures/whitequark/ruby_bug_13547.txt @@ -0,0 +1 @@ +meth[] {} diff --git a/test/prism/fixtures/whitequark/ruby_bug_14690.txt b/test/prism/fixtures/whitequark/ruby_bug_14690.txt new file mode 100644 index 0000000000..b73b1d8aad --- /dev/null +++ b/test/prism/fixtures/whitequark/ruby_bug_14690.txt @@ -0,0 +1 @@ +let () { m(a) do; end } diff --git a/test/prism/fixtures/whitequark/ruby_bug_15789.txt b/test/prism/fixtures/whitequark/ruby_bug_15789.txt new file mode 100644 index 0000000000..6324db5110 --- /dev/null +++ b/test/prism/fixtures/whitequark/ruby_bug_15789.txt @@ -0,0 +1,3 @@ +m ->(a = ->{_1}) {a} + +m ->(a: ->{_1}) {a} diff --git a/test/prism/fixtures/whitequark/ruby_bug_9669.txt b/test/prism/fixtures/whitequark/ruby_bug_9669.txt new file mode 100644 index 0000000000..60dfa09d51 --- /dev/null +++ b/test/prism/fixtures/whitequark/ruby_bug_9669.txt @@ -0,0 +1,8 @@ +def a b: +return +end + +o = { +a: +1 +} diff --git a/test/prism/fixtures/whitequark/sclass.txt b/test/prism/fixtures/whitequark/sclass.txt new file mode 100644 index 0000000000..e6aadaef21 --- /dev/null +++ b/test/prism/fixtures/whitequark/sclass.txt @@ -0,0 +1 @@ +class << foo; nil; end diff --git a/test/prism/fixtures/whitequark/self.txt b/test/prism/fixtures/whitequark/self.txt new file mode 100644 index 0000000000..31f9efa4a1 --- /dev/null +++ b/test/prism/fixtures/whitequark/self.txt @@ -0,0 +1 @@ +self diff --git a/test/prism/fixtures/whitequark/send_attr_asgn.txt b/test/prism/fixtures/whitequark/send_attr_asgn.txt new file mode 100644 index 0000000000..b477966b2a --- /dev/null +++ b/test/prism/fixtures/whitequark/send_attr_asgn.txt @@ -0,0 +1,7 @@ +foo.A = 1 + +foo.a = 1 + +foo::A = 1 + +foo::a = 1 diff --git a/test/prism/fixtures/whitequark/send_attr_asgn_conditional.txt b/test/prism/fixtures/whitequark/send_attr_asgn_conditional.txt new file mode 100644 index 0000000000..1279e02cfc --- /dev/null +++ b/test/prism/fixtures/whitequark/send_attr_asgn_conditional.txt @@ -0,0 +1 @@ +a&.b = 1 diff --git a/test/prism/fixtures/whitequark/send_binary_op.txt b/test/prism/fixtures/whitequark/send_binary_op.txt new file mode 100644 index 0000000000..3e3e9300b3 --- /dev/null +++ b/test/prism/fixtures/whitequark/send_binary_op.txt @@ -0,0 +1,41 @@ +foo != 1 + +foo !~ 1 + +foo % 1 + +foo & 1 + +foo * 1 + +foo ** 1 + +foo + 1 + +foo - 1 + +foo / 1 + +foo < 1 + +foo << 1 + +foo <= 1 + +foo <=> 1 + +foo == 1 + +foo === 1 + +foo =~ 1 + +foo > 1 + +foo >= 1 + +foo >> 1 + +foo ^ 1 + +foo | 1 diff --git a/test/prism/fixtures/whitequark/send_block_chain_cmd.txt b/test/prism/fixtures/whitequark/send_block_chain_cmd.txt new file mode 100644 index 0000000000..c6fe1aab0e --- /dev/null +++ b/test/prism/fixtures/whitequark/send_block_chain_cmd.txt @@ -0,0 +1,13 @@ +meth 1 do end.fun bar + +meth 1 do end.fun bar do end + +meth 1 do end.fun {} + +meth 1 do end.fun(bar) + +meth 1 do end.fun(bar) {} + +meth 1 do end::fun bar + +meth 1 do end::fun(bar) diff --git a/test/prism/fixtures/whitequark/send_block_conditional.txt b/test/prism/fixtures/whitequark/send_block_conditional.txt new file mode 100644 index 0000000000..dcc8361762 --- /dev/null +++ b/test/prism/fixtures/whitequark/send_block_conditional.txt @@ -0,0 +1 @@ +foo&.bar {} diff --git a/test/prism/fixtures/whitequark/send_call.txt b/test/prism/fixtures/whitequark/send_call.txt new file mode 100644 index 0000000000..99701270bb --- /dev/null +++ b/test/prism/fixtures/whitequark/send_call.txt @@ -0,0 +1,3 @@ +foo.(1) + +foo::(1) diff --git a/test/prism/fixtures/whitequark/send_conditional.txt b/test/prism/fixtures/whitequark/send_conditional.txt new file mode 100644 index 0000000000..8ecd27e0fe --- /dev/null +++ b/test/prism/fixtures/whitequark/send_conditional.txt @@ -0,0 +1 @@ +a&.b diff --git a/test/prism/fixtures/whitequark/send_index.txt b/test/prism/fixtures/whitequark/send_index.txt new file mode 100644 index 0000000000..f9c4dafc4e --- /dev/null +++ b/test/prism/fixtures/whitequark/send_index.txt @@ -0,0 +1 @@ +foo[1, 2] diff --git a/test/prism/fixtures/whitequark/send_index_asgn.txt b/test/prism/fixtures/whitequark/send_index_asgn.txt new file mode 100644 index 0000000000..e232fa3b96 --- /dev/null +++ b/test/prism/fixtures/whitequark/send_index_asgn.txt @@ -0,0 +1 @@ +foo[1, 2] = 3 diff --git a/test/prism/fixtures/whitequark/send_index_asgn_legacy.txt b/test/prism/fixtures/whitequark/send_index_asgn_legacy.txt new file mode 100644 index 0000000000..e232fa3b96 --- /dev/null +++ b/test/prism/fixtures/whitequark/send_index_asgn_legacy.txt @@ -0,0 +1 @@ +foo[1, 2] = 3 diff --git a/test/prism/fixtures/whitequark/send_index_cmd.txt b/test/prism/fixtures/whitequark/send_index_cmd.txt new file mode 100644 index 0000000000..32090e7536 --- /dev/null +++ b/test/prism/fixtures/whitequark/send_index_cmd.txt @@ -0,0 +1 @@ +foo[m bar] diff --git a/test/prism/fixtures/whitequark/send_index_legacy.txt b/test/prism/fixtures/whitequark/send_index_legacy.txt new file mode 100644 index 0000000000..f9c4dafc4e --- /dev/null +++ b/test/prism/fixtures/whitequark/send_index_legacy.txt @@ -0,0 +1 @@ +foo[1, 2] diff --git a/test/prism/fixtures/whitequark/send_lambda.txt b/test/prism/fixtures/whitequark/send_lambda.txt new file mode 100644 index 0000000000..eadd6c9c03 --- /dev/null +++ b/test/prism/fixtures/whitequark/send_lambda.txt @@ -0,0 +1,5 @@ +-> * { } + +-> do end + +->{ } diff --git a/test/prism/fixtures/whitequark/send_lambda_args.txt b/test/prism/fixtures/whitequark/send_lambda_args.txt new file mode 100644 index 0000000000..68392f2f34 --- /dev/null +++ b/test/prism/fixtures/whitequark/send_lambda_args.txt @@ -0,0 +1,3 @@ +-> (a) { } + +->(a) { } diff --git a/test/prism/fixtures/whitequark/send_lambda_args_noparen.txt b/test/prism/fixtures/whitequark/send_lambda_args_noparen.txt new file mode 100644 index 0000000000..c0ae077f95 --- /dev/null +++ b/test/prism/fixtures/whitequark/send_lambda_args_noparen.txt @@ -0,0 +1,3 @@ +-> a: 1 { } + +-> a: { } diff --git a/test/prism/fixtures/whitequark/send_lambda_args_shadow.txt b/test/prism/fixtures/whitequark/send_lambda_args_shadow.txt new file mode 100644 index 0000000000..230f35ab89 --- /dev/null +++ b/test/prism/fixtures/whitequark/send_lambda_args_shadow.txt @@ -0,0 +1 @@ +->(a; foo, bar) { } diff --git a/test/prism/fixtures/whitequark/send_lambda_legacy.txt b/test/prism/fixtures/whitequark/send_lambda_legacy.txt new file mode 100644 index 0000000000..a509407c43 --- /dev/null +++ b/test/prism/fixtures/whitequark/send_lambda_legacy.txt @@ -0,0 +1 @@ +->{ } diff --git a/test/prism/fixtures/whitequark/send_op_asgn_conditional.txt b/test/prism/fixtures/whitequark/send_op_asgn_conditional.txt new file mode 100644 index 0000000000..906088dcd1 --- /dev/null +++ b/test/prism/fixtures/whitequark/send_op_asgn_conditional.txt @@ -0,0 +1 @@ +a&.b &&= 1 diff --git a/test/prism/fixtures/whitequark/send_plain.txt b/test/prism/fixtures/whitequark/send_plain.txt new file mode 100644 index 0000000000..ebaf1d18c7 --- /dev/null +++ b/test/prism/fixtures/whitequark/send_plain.txt @@ -0,0 +1,5 @@ +foo.fun + +foo::Fun() + +foo::fun diff --git a/test/prism/fixtures/whitequark/send_plain_cmd.txt b/test/prism/fixtures/whitequark/send_plain_cmd.txt new file mode 100644 index 0000000000..e3fd63f272 --- /dev/null +++ b/test/prism/fixtures/whitequark/send_plain_cmd.txt @@ -0,0 +1,5 @@ +foo.fun bar + +foo::Fun bar + +foo::fun bar diff --git a/test/prism/fixtures/whitequark/send_self.txt b/test/prism/fixtures/whitequark/send_self.txt new file mode 100644 index 0000000000..f084b9bca7 --- /dev/null +++ b/test/prism/fixtures/whitequark/send_self.txt @@ -0,0 +1,5 @@ +fun + +fun! + +fun(1) diff --git a/test/prism/fixtures/whitequark/send_self_block.txt b/test/prism/fixtures/whitequark/send_self_block.txt new file mode 100644 index 0000000000..1cd6703c82 --- /dev/null +++ b/test/prism/fixtures/whitequark/send_self_block.txt @@ -0,0 +1,7 @@ +fun do end + +fun { } + +fun() { } + +fun(1) { } diff --git a/test/prism/fixtures/whitequark/send_unary_op.txt b/test/prism/fixtures/whitequark/send_unary_op.txt new file mode 100644 index 0000000000..73814d199f --- /dev/null +++ b/test/prism/fixtures/whitequark/send_unary_op.txt @@ -0,0 +1,5 @@ ++foo + +-foo + +~foo diff --git a/test/prism/fixtures/whitequark/slash_newline_in_heredocs.txt b/test/prism/fixtures/whitequark/slash_newline_in_heredocs.txt new file mode 100644 index 0000000000..4962a058ea --- /dev/null +++ b/test/prism/fixtures/whitequark/slash_newline_in_heredocs.txt @@ -0,0 +1,13 @@ +<<-E + 1 \ + 2 + 3 +E + + +<<~E + 1 \ + 2 + 3 +E + diff --git a/test/prism/fixtures/whitequark/space_args_arg.txt b/test/prism/fixtures/whitequark/space_args_arg.txt new file mode 100644 index 0000000000..47957cba54 --- /dev/null +++ b/test/prism/fixtures/whitequark/space_args_arg.txt @@ -0,0 +1 @@ +fun (1) diff --git a/test/prism/fixtures/whitequark/space_args_arg_block.txt b/test/prism/fixtures/whitequark/space_args_arg_block.txt new file mode 100644 index 0000000000..5560a82818 --- /dev/null +++ b/test/prism/fixtures/whitequark/space_args_arg_block.txt @@ -0,0 +1,5 @@ +foo.fun (1) {} + +foo::fun (1) {} + +fun (1) {} diff --git a/test/prism/fixtures/whitequark/space_args_arg_call.txt b/test/prism/fixtures/whitequark/space_args_arg_call.txt new file mode 100644 index 0000000000..3b0ae831fe --- /dev/null +++ b/test/prism/fixtures/whitequark/space_args_arg_call.txt @@ -0,0 +1 @@ +fun (1).to_i diff --git a/test/prism/fixtures/whitequark/space_args_arg_newline.txt b/test/prism/fixtures/whitequark/space_args_arg_newline.txt new file mode 100644 index 0000000000..a6cdac6ed1 --- /dev/null +++ b/test/prism/fixtures/whitequark/space_args_arg_newline.txt @@ -0,0 +1,2 @@ +fun (1 +) diff --git a/test/prism/fixtures/whitequark/space_args_block.txt b/test/prism/fixtures/whitequark/space_args_block.txt new file mode 100644 index 0000000000..555a097605 --- /dev/null +++ b/test/prism/fixtures/whitequark/space_args_block.txt @@ -0,0 +1 @@ +fun () {} diff --git a/test/prism/fixtures/whitequark/space_args_cmd.txt b/test/prism/fixtures/whitequark/space_args_cmd.txt new file mode 100644 index 0000000000..a749695cb7 --- /dev/null +++ b/test/prism/fixtures/whitequark/space_args_cmd.txt @@ -0,0 +1 @@ +fun (f bar) diff --git a/test/prism/fixtures/whitequark/string___FILE__.txt b/test/prism/fixtures/whitequark/string___FILE__.txt new file mode 100644 index 0000000000..4815727d05 --- /dev/null +++ b/test/prism/fixtures/whitequark/string___FILE__.txt @@ -0,0 +1 @@ +__FILE__ diff --git a/test/prism/fixtures/whitequark/string_concat.txt b/test/prism/fixtures/whitequark/string_concat.txt new file mode 100644 index 0000000000..30cc4f8116 --- /dev/null +++ b/test/prism/fixtures/whitequark/string_concat.txt @@ -0,0 +1 @@ +"foo#@a" "bar" diff --git a/test/prism/fixtures/whitequark/string_dvar.txt b/test/prism/fixtures/whitequark/string_dvar.txt new file mode 100644 index 0000000000..bbe5b617b2 --- /dev/null +++ b/test/prism/fixtures/whitequark/string_dvar.txt @@ -0,0 +1 @@ +"#@a #@@a #$a" diff --git a/test/prism/fixtures/whitequark/string_interp.txt b/test/prism/fixtures/whitequark/string_interp.txt new file mode 100644 index 0000000000..5fdd803341 --- /dev/null +++ b/test/prism/fixtures/whitequark/string_interp.txt @@ -0,0 +1 @@ +"foo#{bar}baz" diff --git a/test/prism/fixtures/whitequark/string_plain.txt b/test/prism/fixtures/whitequark/string_plain.txt new file mode 100644 index 0000000000..4aca78decb --- /dev/null +++ b/test/prism/fixtures/whitequark/string_plain.txt @@ -0,0 +1,3 @@ +%q(foobar) + +'foobar' diff --git a/test/prism/fixtures/whitequark/super.txt b/test/prism/fixtures/whitequark/super.txt new file mode 100644 index 0000000000..9e68a9e988 --- /dev/null +++ b/test/prism/fixtures/whitequark/super.txt @@ -0,0 +1,5 @@ +super foo + +super() + +super(foo) diff --git a/test/prism/fixtures/whitequark/super_block.txt b/test/prism/fixtures/whitequark/super_block.txt new file mode 100644 index 0000000000..05a7d7fdd8 --- /dev/null +++ b/test/prism/fixtures/whitequark/super_block.txt @@ -0,0 +1,3 @@ +super do end + +super foo, bar do end diff --git a/test/prism/fixtures/whitequark/symbol_interp.txt b/test/prism/fixtures/whitequark/symbol_interp.txt new file mode 100644 index 0000000000..d5011b270d --- /dev/null +++ b/test/prism/fixtures/whitequark/symbol_interp.txt @@ -0,0 +1 @@ +:"foo#{bar}baz" diff --git a/test/prism/fixtures/whitequark/symbol_plain.txt b/test/prism/fixtures/whitequark/symbol_plain.txt new file mode 100644 index 0000000000..fd1fd0017c --- /dev/null +++ b/test/prism/fixtures/whitequark/symbol_plain.txt @@ -0,0 +1,3 @@ +:'foo' + +:foo diff --git a/test/prism/fixtures/whitequark/ternary.txt b/test/prism/fixtures/whitequark/ternary.txt new file mode 100644 index 0000000000..3a149d4e1c --- /dev/null +++ b/test/prism/fixtures/whitequark/ternary.txt @@ -0,0 +1 @@ +foo ? 1 : 2 diff --git a/test/prism/fixtures/whitequark/ternary_ambiguous_symbol.txt b/test/prism/fixtures/whitequark/ternary_ambiguous_symbol.txt new file mode 100644 index 0000000000..19aa523c07 --- /dev/null +++ b/test/prism/fixtures/whitequark/ternary_ambiguous_symbol.txt @@ -0,0 +1 @@ +t=1;(foo)?t:T diff --git a/test/prism/fixtures/whitequark/trailing_forward_arg.txt b/test/prism/fixtures/whitequark/trailing_forward_arg.txt new file mode 100644 index 0000000000..043870ade2 --- /dev/null +++ b/test/prism/fixtures/whitequark/trailing_forward_arg.txt @@ -0,0 +1 @@ +def foo(a, b, ...); bar(a, 42, ...); end diff --git a/test/prism/fixtures/whitequark/true.txt b/test/prism/fixtures/whitequark/true.txt new file mode 100644 index 0000000000..27ba77ddaf --- /dev/null +++ b/test/prism/fixtures/whitequark/true.txt @@ -0,0 +1 @@ +true diff --git a/test/prism/fixtures/whitequark/unary_num_pow_precedence.txt b/test/prism/fixtures/whitequark/unary_num_pow_precedence.txt new file mode 100644 index 0000000000..f0343e3c8b --- /dev/null +++ b/test/prism/fixtures/whitequark/unary_num_pow_precedence.txt @@ -0,0 +1,5 @@ ++2.0 ** 10 + +-2 ** 10 + +-2.0 ** 10 diff --git a/test/prism/fixtures/whitequark/undef.txt b/test/prism/fixtures/whitequark/undef.txt new file mode 100644 index 0000000000..3e88ec7084 --- /dev/null +++ b/test/prism/fixtures/whitequark/undef.txt @@ -0,0 +1 @@ +undef foo, :bar, :"foo#{1}" diff --git a/test/prism/fixtures/whitequark/unless.txt b/test/prism/fixtures/whitequark/unless.txt new file mode 100644 index 0000000000..d04043ed90 --- /dev/null +++ b/test/prism/fixtures/whitequark/unless.txt @@ -0,0 +1,3 @@ +unless foo then bar; end + +unless foo; bar; end diff --git a/test/prism/fixtures/whitequark/unless_else.txt b/test/prism/fixtures/whitequark/unless_else.txt new file mode 100644 index 0000000000..8243d42031 --- /dev/null +++ b/test/prism/fixtures/whitequark/unless_else.txt @@ -0,0 +1,3 @@ +unless foo then bar; else baz; end + +unless foo; bar; else baz; end diff --git a/test/prism/fixtures/whitequark/unless_mod.txt b/test/prism/fixtures/whitequark/unless_mod.txt new file mode 100644 index 0000000000..2d0376a310 --- /dev/null +++ b/test/prism/fixtures/whitequark/unless_mod.txt @@ -0,0 +1 @@ +bar unless foo diff --git a/test/prism/fixtures/whitequark/until.txt b/test/prism/fixtures/whitequark/until.txt new file mode 100644 index 0000000000..06082233cb --- /dev/null +++ b/test/prism/fixtures/whitequark/until.txt @@ -0,0 +1,3 @@ +until foo do meth end + +until foo; meth end diff --git a/test/prism/fixtures/whitequark/until_mod.txt b/test/prism/fixtures/whitequark/until_mod.txt new file mode 100644 index 0000000000..46a85d2ba9 --- /dev/null +++ b/test/prism/fixtures/whitequark/until_mod.txt @@ -0,0 +1 @@ +meth until foo diff --git a/test/prism/fixtures/whitequark/until_post.txt b/test/prism/fixtures/whitequark/until_post.txt new file mode 100644 index 0000000000..988e43b665 --- /dev/null +++ b/test/prism/fixtures/whitequark/until_post.txt @@ -0,0 +1 @@ +begin meth end until foo diff --git a/test/prism/fixtures/whitequark/var_and_asgn.txt b/test/prism/fixtures/whitequark/var_and_asgn.txt new file mode 100644 index 0000000000..25502968f9 --- /dev/null +++ b/test/prism/fixtures/whitequark/var_and_asgn.txt @@ -0,0 +1 @@ +a &&= 1 diff --git a/test/prism/fixtures/whitequark/var_op_asgn.txt b/test/prism/fixtures/whitequark/var_op_asgn.txt new file mode 100644 index 0000000000..402d818a7e --- /dev/null +++ b/test/prism/fixtures/whitequark/var_op_asgn.txt @@ -0,0 +1,7 @@ +@@var |= 10 + +@a |= 1 + +a += 1 + +def a; @@var |= 10; end diff --git a/test/prism/fixtures/whitequark/var_op_asgn_cmd.txt b/test/prism/fixtures/whitequark/var_op_asgn_cmd.txt new file mode 100644 index 0000000000..33f4bc0e73 --- /dev/null +++ b/test/prism/fixtures/whitequark/var_op_asgn_cmd.txt @@ -0,0 +1 @@ +foo += m foo diff --git a/test/prism/fixtures/whitequark/var_or_asgn.txt b/test/prism/fixtures/whitequark/var_or_asgn.txt new file mode 100644 index 0000000000..aa30b3d5ca --- /dev/null +++ b/test/prism/fixtures/whitequark/var_or_asgn.txt @@ -0,0 +1 @@ +a ||= 1 diff --git a/test/prism/fixtures/whitequark/when_multi.txt b/test/prism/fixtures/whitequark/when_multi.txt new file mode 100644 index 0000000000..b4fbd33125 --- /dev/null +++ b/test/prism/fixtures/whitequark/when_multi.txt @@ -0,0 +1 @@ +case foo; when 'bar', 'baz'; bar; end diff --git a/test/prism/fixtures/whitequark/when_splat.txt b/test/prism/fixtures/whitequark/when_splat.txt new file mode 100644 index 0000000000..695e5da34e --- /dev/null +++ b/test/prism/fixtures/whitequark/when_splat.txt @@ -0,0 +1 @@ +case foo; when 1, *baz; bar; when *foo; end diff --git a/test/prism/fixtures/whitequark/when_then.txt b/test/prism/fixtures/whitequark/when_then.txt new file mode 100644 index 0000000000..63293452b3 --- /dev/null +++ b/test/prism/fixtures/whitequark/when_then.txt @@ -0,0 +1 @@ +case foo; when 'bar' then bar; end diff --git a/test/prism/fixtures/whitequark/while.txt b/test/prism/fixtures/whitequark/while.txt new file mode 100644 index 0000000000..28b204f247 --- /dev/null +++ b/test/prism/fixtures/whitequark/while.txt @@ -0,0 +1,3 @@ +while foo do meth end + +while foo; meth end diff --git a/test/prism/fixtures/whitequark/while_mod.txt b/test/prism/fixtures/whitequark/while_mod.txt new file mode 100644 index 0000000000..ce3cf01d14 --- /dev/null +++ b/test/prism/fixtures/whitequark/while_mod.txt @@ -0,0 +1 @@ +meth while foo diff --git a/test/prism/fixtures/whitequark/while_post.txt b/test/prism/fixtures/whitequark/while_post.txt new file mode 100644 index 0000000000..ac6e05008b --- /dev/null +++ b/test/prism/fixtures/whitequark/while_post.txt @@ -0,0 +1 @@ +begin meth end while foo diff --git a/test/prism/fixtures/whitequark/xstring_interp.txt b/test/prism/fixtures/whitequark/xstring_interp.txt new file mode 100644 index 0000000000..dfede8123f --- /dev/null +++ b/test/prism/fixtures/whitequark/xstring_interp.txt @@ -0,0 +1 @@ +`foo#{bar}baz` diff --git a/test/prism/fixtures/whitequark/xstring_plain.txt b/test/prism/fixtures/whitequark/xstring_plain.txt new file mode 100644 index 0000000000..fce255049d --- /dev/null +++ b/test/prism/fixtures/whitequark/xstring_plain.txt @@ -0,0 +1 @@ +`foobar` diff --git a/test/prism/fixtures/whitequark/yield.txt b/test/prism/fixtures/whitequark/yield.txt new file mode 100644 index 0000000000..0ecf639589 --- /dev/null +++ b/test/prism/fixtures/whitequark/yield.txt @@ -0,0 +1,7 @@ +yield + +yield foo + +yield() + +yield(foo) diff --git a/test/prism/fixtures/whitequark/zsuper.txt b/test/prism/fixtures/whitequark/zsuper.txt new file mode 100644 index 0000000000..16f5c2d3aa --- /dev/null +++ b/test/prism/fixtures/whitequark/zsuper.txt @@ -0,0 +1 @@ +super diff --git a/test/prism/fixtures/xstring.txt b/test/prism/fixtures/xstring.txt new file mode 100644 index 0000000000..01bcc09fc5 --- /dev/null +++ b/test/prism/fixtures/xstring.txt @@ -0,0 +1,7 @@ +%x[foo] + +`foo #{bar} baz` + +`f\oo` + +`foo` diff --git a/test/prism/fixtures/yield.txt b/test/prism/fixtures/yield.txt new file mode 100644 index 0000000000..d75ab57a18 --- /dev/null +++ b/test/prism/fixtures/yield.txt @@ -0,0 +1,7 @@ +yield + +yield() + +yield(1) + +yield(1, 2, 3) |