1
1
mirror of https://github.com/github/semantic.git synced 2024-11-28 10:15:55 +03:00

Transition ruby test fixtures

This commit is contained in:
Timothy Clem 2017-02-22 14:36:22 -08:00
parent ef17e87366
commit ea453bf57e
348 changed files with 2041 additions and 30 deletions

View File

@ -1,3 +1 @@
foo and bar
bar or foo
bar and foo
foo and bar

View File

@ -1 +1,2 @@
foo or bar
a or b and c

View File

@ -7,11 +7,10 @@
(Identifier)
(Other "or")
(Identifier)) }
{-(Binary
(Identifier)
(Other "or")
(Identifier))-}
{-(Binary
(Identifier)
{+(Binary
(Binary
(Identifier)
(Other "or")
(Identifier))
(Other "and")
(Identifier))-})
(Identifier))+})

View File

@ -1,15 +1,16 @@
(Program
{+(Binary
{ (Binary
(Identifier)
(Other "and")
(Identifier))+}
(Binary
{ (Identifier)
->(Identifier) }
(Other "or")
{ (Identifier)
->(Identifier) })
{+(Binary
(Identifier))
->(Binary
(Identifier)
(Other "and")
(Identifier))+})
(Identifier)) }
{-(Binary
(Binary
(Identifier)
(Other "or")
(Identifier))
(Other "and")
(Identifier))-})

View File

@ -2,12 +2,4 @@
(Binary
(Identifier)
(Other "and")
(Identifier))
(Binary
(Identifier)
(Other "or")
(Identifier))
(Binary
(Identifier)
(Other "and")
(Identifier)))
(Identifier)))

View File

@ -2,4 +2,11 @@
(Binary
(Identifier)
(Other "or")
(Identifier)))
(Identifier))
(Binary
(Binary
(Identifier)
(Other "or")
(Identifier))
(Other "and")
(Identifier)))

1
test/fixtures/ruby/array.A.rb vendored Normal file
View File

@ -0,0 +1 @@
[ 1, 2, 3]

1
test/fixtures/ruby/array.B.rb vendored Normal file
View File

@ -0,0 +1 @@
['a', 'b', 'c']

8
test/fixtures/ruby/array.diffA-B.txt vendored Normal file
View File

@ -0,0 +1,8 @@
(Program
(ArrayLiteral
{+(StringLiteral)+}
{+(StringLiteral)+}
{+(StringLiteral)+}
{-(IntegerLiteral)-}
{-(IntegerLiteral)-}
{-(IntegerLiteral)-}))

8
test/fixtures/ruby/array.diffB-A.txt vendored Normal file
View File

@ -0,0 +1,8 @@
(Program
(ArrayLiteral
{+(IntegerLiteral)+}
{+(IntegerLiteral)+}
{+(IntegerLiteral)+}
{-(StringLiteral)-}
{-(StringLiteral)-}
{-(StringLiteral)-}))

5
test/fixtures/ruby/array.parseA.txt vendored Normal file
View File

@ -0,0 +1,5 @@
(Program
(ArrayLiteral
(IntegerLiteral)
(IntegerLiteral)
(IntegerLiteral)))

5
test/fixtures/ruby/array.parseB.txt vendored Normal file
View File

@ -0,0 +1,5 @@
(Program
(ArrayLiteral
(StringLiteral)
(StringLiteral)
(StringLiteral)))

1
test/fixtures/ruby/assignment.A.rb vendored Normal file
View File

@ -0,0 +1 @@
x = 0

1
test/fixtures/ruby/assignment.B.rb vendored Normal file
View File

@ -0,0 +1 @@
x = 1

View File

@ -0,0 +1,5 @@
(Program
(Assignment
(Identifier)
{ (IntegerLiteral)
->(IntegerLiteral) }))

View File

@ -0,0 +1,5 @@
(Program
(Assignment
(Identifier)
{ (IntegerLiteral)
->(IntegerLiteral) }))

View File

@ -0,0 +1,4 @@
(Program
(Assignment
(Identifier)
(IntegerLiteral)))

View File

@ -0,0 +1,4 @@
(Program
(Assignment
(Identifier)
(IntegerLiteral)))

3
test/fixtures/ruby/begin-block.A.rb vendored Normal file
View File

@ -0,0 +1,3 @@
BEGIN {
foo
}

4
test/fixtures/ruby/begin-block.B.rb vendored Normal file
View File

@ -0,0 +1,4 @@
foo
BEGIN {
bar
}

View File

@ -0,0 +1,5 @@
(Program
{+(Identifier)+}
(BeginBlock
{ (Identifier)
->(Identifier) }))

View File

@ -0,0 +1,6 @@
(Program
{+(BeginBlock
(Identifier))+}
{-(Identifier)-}
{-(BeginBlock
(Identifier))-})

View File

@ -0,0 +1,3 @@
(Program
(BeginBlock
(Identifier)))

View File

@ -0,0 +1,4 @@
(Program
(Identifier)
(BeginBlock
(Identifier)))

4
test/fixtures/ruby/begin.A.rb vendored Normal file
View File

@ -0,0 +1,4 @@
def foo
begin
end
end

5
test/fixtures/ruby/begin.B.rb vendored Normal file
View File

@ -0,0 +1,5 @@
def foo
begin
puts 'hi'
end
end

7
test/fixtures/ruby/begin.diffA-B.txt vendored Normal file
View File

@ -0,0 +1,7 @@
(Program
(Method
(Identifier)
(Begin
{+(MethodCall
(Identifier)
(StringLiteral))+})))

7
test/fixtures/ruby/begin.diffB-A.txt vendored Normal file
View File

@ -0,0 +1,7 @@
(Program
(Method
(Identifier)
(Begin
{-(MethodCall
(Identifier)
(StringLiteral))-})))

4
test/fixtures/ruby/begin.parseA.txt vendored Normal file
View File

@ -0,0 +1,4 @@
(Program
(Method
(Identifier)
(Begin)))

7
test/fixtures/ruby/begin.parseB.txt vendored Normal file
View File

@ -0,0 +1,7 @@
(Program
(Method
(Identifier)
(Begin
(MethodCall
(Identifier)
(StringLiteral)))))

View File

@ -0,0 +1,3 @@
a | b
a >> b
a ^ b

View File

@ -0,0 +1,2 @@
a & b
a << b

View File

@ -0,0 +1,21 @@
(Program
{ (Binary
(Identifier)
(Other "|")
(Identifier))
->(Binary
(Identifier)
(Other "&")
(Identifier)) }
{ (Binary
(Identifier)
(Other ">>")
(Identifier))
->(Binary
(Identifier)
(Other "<<")
(Identifier)) }
{-(Binary
(Identifier)
(Other "^")
(Identifier))-})

View File

@ -0,0 +1,21 @@
(Program
{ (Binary
(Identifier)
(Other "&")
(Identifier))
->(Binary
(Identifier)
(Other "|")
(Identifier)) }
{ (Binary
(Identifier)
(Other "<<")
(Identifier))
->(Binary
(Identifier)
(Other ">>")
(Identifier)) }
{+(Binary
(Identifier)
(Other "^")
(Identifier))+})

View File

@ -0,0 +1,13 @@
(Program
(Binary
(Identifier)
(Other "|")
(Identifier))
(Binary
(Identifier)
(Other ">>")
(Identifier))
(Binary
(Identifier)
(Other "^")
(Identifier)))

View File

@ -0,0 +1,9 @@
(Program
(Binary
(Identifier)
(Other "&")
(Identifier))
(Binary
(Identifier)
(Other "<<")
(Identifier)))

View File

@ -0,0 +1 @@
a || b

View File

@ -0,0 +1 @@
a && b

View File

@ -0,0 +1,9 @@
(Program
{ (Binary
(Identifier)
(Other "||")
(Identifier))
->(Binary
(Identifier)
(Other "&&")
(Identifier)) })

View File

@ -0,0 +1,9 @@
(Program
{ (Binary
(Identifier)
(Other "&&")
(Identifier))
->(Binary
(Identifier)
(Other "||")
(Identifier)) })

View File

@ -0,0 +1,5 @@
(Program
(Binary
(Identifier)
(Other "||")
(Identifier)))

View File

@ -0,0 +1,5 @@
(Program
(Binary
(Identifier)
(Other "&&")
(Identifier)))

3
test/fixtures/ruby/class.A.rb vendored Normal file
View File

@ -0,0 +1,3 @@
class Foo < Super
def test; end
end

3
test/fixtures/ruby/class.B.rb vendored Normal file
View File

@ -0,0 +1,3 @@
class Foo
def test; end
end

7
test/fixtures/ruby/class.diffA-B.txt vendored Normal file
View File

@ -0,0 +1,7 @@
(Program
(Class
(Constant)
{-(Superclass
(Constant))-}
(Method
(Identifier))))

7
test/fixtures/ruby/class.diffB-A.txt vendored Normal file
View File

@ -0,0 +1,7 @@
(Program
(Class
(Constant)
{+(Superclass
(Constant))+}
(Method
(Identifier))))

7
test/fixtures/ruby/class.parseA.txt vendored Normal file
View File

@ -0,0 +1,7 @@
(Program
(Class
(Constant)
(Superclass
(Constant))
(Method
(Identifier))))

5
test/fixtures/ruby/class.parseB.txt vendored Normal file
View File

@ -0,0 +1,5 @@
(Program
(Class
(Constant)
(Method
(Identifier))))

1
test/fixtures/ruby/comment.A.rb vendored Normal file
View File

@ -0,0 +1 @@
# This is a comment

4
test/fixtures/ruby/comment.B.rb vendored Normal file
View File

@ -0,0 +1,4 @@
=begin
This is a multiline
comment
=end

14
test/fixtures/ruby/comment.diffA-B.txt vendored Normal file
View File

@ -0,0 +1,14 @@
(Program
{+(ParseError
(Other "right_assignment_list"
(Begin
(MethodCall
(Constant)
(MethodCall
(Identifier)
(MethodCall
(Identifier)
(Identifier))))
(Identifier)
(ParseError))))+}
{-(Comment)-})

14
test/fixtures/ruby/comment.diffB-A.txt vendored Normal file
View File

@ -0,0 +1,14 @@
(Program
{+(Comment)+}
{-(ParseError
(Other "right_assignment_list"
(Begin
(MethodCall
(Constant)
(MethodCall
(Identifier)
(MethodCall
(Identifier)
(Identifier))))
(Identifier)
(ParseError))))-})

2
test/fixtures/ruby/comment.parseA.txt vendored Normal file
View File

@ -0,0 +1,2 @@
(Program
(Comment))

13
test/fixtures/ruby/comment.parseB.txt vendored Normal file
View File

@ -0,0 +1,13 @@
(Program
(ParseError
(Other "right_assignment_list"
(Begin
(MethodCall
(Constant)
(MethodCall
(Identifier)
(MethodCall
(Identifier)
(Identifier))))
(Identifier)
(ParseError)))))

View File

@ -0,0 +1,2 @@
x < y
a > b

View File

@ -0,0 +1,2 @@
x <= y
a >= b

View File

@ -0,0 +1,17 @@
(Program
{ (Binary
(Identifier)
(Other "<")
(Identifier))
->(Binary
(Identifier)
(Other "<=")
(Identifier)) }
{ (Binary
(Identifier)
(Other ">")
(Identifier))
->(Binary
(Identifier)
(Other ">=")
(Identifier)) })

View File

@ -0,0 +1,17 @@
(Program
{ (Binary
(Identifier)
(Other "<=")
(Identifier))
->(Binary
(Identifier)
(Other "<")
(Identifier)) }
{ (Binary
(Identifier)
(Other ">=")
(Identifier))
->(Binary
(Identifier)
(Other ">")
(Identifier)) })

View File

@ -0,0 +1,9 @@
(Program
(Binary
(Identifier)
(Other "<")
(Identifier))
(Binary
(Identifier)
(Other ">")
(Identifier)))

View File

@ -0,0 +1,9 @@
(Program
(Binary
(Identifier)
(Other "<=")
(Identifier))
(Binary
(Identifier)
(Other ">=")
(Identifier)))

View File

@ -0,0 +1 @@
x ||= 5

View File

@ -0,0 +1 @@
x &&= 7

View File

@ -0,0 +1,5 @@
(Program
(OperatorAssignment
(Identifier)
{ (IntegerLiteral)
->(IntegerLiteral) }))

View File

@ -0,0 +1,5 @@
(Program
(OperatorAssignment
(Identifier)
{ (IntegerLiteral)
->(IntegerLiteral) }))

View File

@ -0,0 +1,4 @@
(Program
(OperatorAssignment
(Identifier)
(IntegerLiteral)))

View File

@ -0,0 +1,4 @@
(Program
(OperatorAssignment
(Identifier)
(IntegerLiteral)))

6
test/fixtures/ruby/delimiter.A.rb vendored Normal file
View File

@ -0,0 +1,6 @@
%q#a#
%q<a<b>c>
%#a#
%Q#a#
%<a<b>c>
%Q<a<b>c>

6
test/fixtures/ruby/delimiter.B.rb vendored Normal file
View File

@ -0,0 +1,6 @@
%q/b/
%q{d{e}f}
%/b/
%Q/b/
%{d{e}f}
%Q{d{e}f}

View File

@ -0,0 +1,13 @@
(Program
{+(StringLiteral)+}
{+(StringLiteral)+}
{ (StringLiteral)
->(StringLiteral) }
{+(StringLiteral)+}
{+(StringLiteral)+}
{+(StringLiteral)+}
{-(StringLiteral)-}
{-(StringLiteral)-}
{-(StringLiteral)-}
{-(StringLiteral)-}
{-(StringLiteral)-})

View File

@ -0,0 +1,13 @@
(Program
{+(StringLiteral)+}
{ (StringLiteral)
->(StringLiteral) }
{+(StringLiteral)+}
{ (StringLiteral)
->(StringLiteral) }
{+(StringLiteral)+}
{+(StringLiteral)+}
{-(StringLiteral)-}
{-(StringLiteral)-}
{-(StringLiteral)-}
{-(StringLiteral)-})

View File

@ -0,0 +1,7 @@
(Program
(StringLiteral)
(StringLiteral)
(StringLiteral)
(StringLiteral)
(StringLiteral)
(StringLiteral))

View File

@ -0,0 +1,7 @@
(Program
(StringLiteral)
(StringLiteral)
(StringLiteral)
(StringLiteral)
(StringLiteral)
(StringLiteral))

View File

@ -0,0 +1,3 @@
foo[bar]
foo[:bar]
foo[bar] = 1

View File

@ -0,0 +1,2 @@
x["b"]
x[:"c"]

View File

@ -0,0 +1,17 @@
(Program
{ (SubscriptAccess
(Identifier)
(Identifier))
->(SubscriptAccess
(Identifier)
(StringLiteral)) }
(SubscriptAccess
{ (Identifier)
->(Identifier) }
{ (SymbolLiteral)
->(SymbolLiteral) })
{-(Assignment
(SubscriptAccess
(Identifier)
(Identifier))
(IntegerLiteral))-})

View File

@ -0,0 +1,17 @@
(Program
{ (SubscriptAccess
(Identifier)
(StringLiteral))
->(SubscriptAccess
(Identifier)
(Identifier)) }
(SubscriptAccess
{ (Identifier)
->(Identifier) }
{ (SymbolLiteral)
->(SymbolLiteral) })
{+(Assignment
(SubscriptAccess
(Identifier)
(Identifier))
(IntegerLiteral))+})

View File

@ -0,0 +1,12 @@
(Program
(SubscriptAccess
(Identifier)
(Identifier))
(SubscriptAccess
(Identifier)
(SymbolLiteral))
(Assignment
(SubscriptAccess
(Identifier)
(Identifier))
(IntegerLiteral)))

View File

@ -0,0 +1,7 @@
(Program
(SubscriptAccess
(Identifier)
(StringLiteral))
(SubscriptAccess
(Identifier)
(SymbolLiteral)))

4
test/fixtures/ruby/else.A.rb vendored Normal file
View File

@ -0,0 +1,4 @@
begin
foo()
else
end

5
test/fixtures/ruby/else.B.rb vendored Normal file
View File

@ -0,0 +1,5 @@
begin
foo()
else
bar()
end

8
test/fixtures/ruby/else.diffA-B.txt vendored Normal file
View File

@ -0,0 +1,8 @@
(Program
(Begin
(MethodCall
(Identifier))
{ (Else)
->(Else
(MethodCall
(Identifier))) }))

8
test/fixtures/ruby/else.diffB-A.txt vendored Normal file
View File

@ -0,0 +1,8 @@
(Program
(Begin
(MethodCall
(Identifier))
{ (Else
(MethodCall
(Identifier)))
->(Else) }))

5
test/fixtures/ruby/else.parseA.txt vendored Normal file
View File

@ -0,0 +1,5 @@
(Program
(Begin
(MethodCall
(Identifier))
(Else)))

7
test/fixtures/ruby/else.parseB.txt vendored Normal file
View File

@ -0,0 +1,7 @@
(Program
(Begin
(MethodCall
(Identifier))
(Else
(MethodCall
(Identifier)))))

4
test/fixtures/ruby/elsif.A.rb vendored Normal file
View File

@ -0,0 +1,4 @@
if bar
foo()
elsif baz
end

5
test/fixtures/ruby/elsif.B.rb vendored Normal file
View File

@ -0,0 +1,5 @@
if bar
foo()
elsif baz
qoz()
end

9
test/fixtures/ruby/elsif.diffA-B.txt vendored Normal file
View File

@ -0,0 +1,9 @@
(Program
(If
(Identifier)
(MethodCall
(Identifier))
(Elsif
(Identifier)
{+(MethodCall
(Identifier))+})))

9
test/fixtures/ruby/elsif.diffB-A.txt vendored Normal file
View File

@ -0,0 +1,9 @@
(Program
(If
(Identifier)
(MethodCall
(Identifier))
(Elsif
(Identifier)
{-(MethodCall
(Identifier))-})))

7
test/fixtures/ruby/elsif.parseA.txt vendored Normal file
View File

@ -0,0 +1,7 @@
(Program
(If
(Identifier)
(MethodCall
(Identifier))
(Elsif
(Identifier))))

9
test/fixtures/ruby/elsif.parseB.txt vendored Normal file
View File

@ -0,0 +1,9 @@
(Program
(If
(Identifier)
(MethodCall
(Identifier))
(Elsif
(Identifier)
(MethodCall
(Identifier)))))

3
test/fixtures/ruby/end-block.A.rb vendored Normal file
View File

@ -0,0 +1,3 @@
END {
foo
}

4
test/fixtures/ruby/end-block.B.rb vendored Normal file
View File

@ -0,0 +1,4 @@
foo
END {
bar
}

View File

@ -0,0 +1,5 @@
(Program
{+(Identifier)+}
(EndBlock
{ (Identifier)
->(Identifier) }))

View File

@ -0,0 +1,6 @@
(Program
{+(EndBlock
(Identifier))+}
{-(Identifier)-}
{-(EndBlock
(Identifier))-})

View File

@ -0,0 +1,3 @@
(Program
(EndBlock
(Identifier)))

View File

@ -0,0 +1,4 @@
(Program
(Identifier)
(EndBlock
(Identifier)))

4
test/fixtures/ruby/ensure.A.rb vendored Normal file
View File

@ -0,0 +1,4 @@
begin
foo
ensure
end

5
test/fixtures/ruby/ensure.B.rb vendored Normal file
View File

@ -0,0 +1,5 @@
begin
foo
ensure
bar
end

6
test/fixtures/ruby/ensure.diffA-B.txt vendored Normal file
View File

@ -0,0 +1,6 @@
(Program
(Begin
(Identifier)
{ (Ensure)
->(Ensure
(Identifier)) }))

6
test/fixtures/ruby/ensure.diffB-A.txt vendored Normal file
View File

@ -0,0 +1,6 @@
(Program
(Begin
(Identifier)
{ (Ensure
(Identifier))
->(Ensure) }))

Some files were not shown because too many files have changed in this diff Show More