mirror of
https://github.com/github/semantic.git
synced 2025-01-01 11:46:14 +03:00
Fix lambdas
This commit is contained in:
parent
fef4fb1c41
commit
0bbeefb8b2
@ -1,9 +1,13 @@
|
||||
(Program
|
||||
(AnonymousFunction
|
||||
(Function
|
||||
(Identifier)
|
||||
{-(Identifier)-}
|
||||
{-(Identifier)-}
|
||||
{-(Identifier)-}
|
||||
(ExpressionStatements
|
||||
{+(Identifier)+}
|
||||
{-(IntegerLiteral)-}
|
||||
{-(IntegerLiteral)-})))
|
||||
(
|
||||
(Function
|
||||
(Empty)
|
||||
(
|
||||
{ (Integer)
|
||||
->(Identifier) }
|
||||
{-(Integer)-})))))
|
||||
|
@ -1,9 +1,13 @@
|
||||
(Program
|
||||
(AnonymousFunction
|
||||
(Function
|
||||
(Identifier)
|
||||
{+(Identifier)+}
|
||||
{+(Identifier)+}
|
||||
{+(Identifier)+}
|
||||
(ExpressionStatements
|
||||
{+(IntegerLiteral)+}
|
||||
{+(IntegerLiteral)+}
|
||||
{-(Identifier)-})))
|
||||
(
|
||||
(Function
|
||||
(Empty)
|
||||
(
|
||||
{ (Identifier)
|
||||
->(Integer) }
|
||||
{+(Integer)+})))))
|
||||
|
12
test/fixtures/ruby/lambda-dash-rocket.parseA.txt
vendored
12
test/fixtures/ruby/lambda-dash-rocket.parseA.txt
vendored
@ -1,8 +1,12 @@
|
||||
(Program
|
||||
(AnonymousFunction
|
||||
(Function
|
||||
(Identifier)
|
||||
(Identifier)
|
||||
(Identifier)
|
||||
(ExpressionStatements
|
||||
(IntegerLiteral)
|
||||
(IntegerLiteral))))
|
||||
(Identifier)
|
||||
(
|
||||
(Function
|
||||
(Empty)
|
||||
(
|
||||
(Integer)
|
||||
(Integer))))))
|
||||
|
10
test/fixtures/ruby/lambda-dash-rocket.parseB.txt
vendored
10
test/fixtures/ruby/lambda-dash-rocket.parseB.txt
vendored
@ -1,4 +1,8 @@
|
||||
(Program
|
||||
(AnonymousFunction
|
||||
(ExpressionStatements
|
||||
(Identifier))))
|
||||
(Function
|
||||
(Identifier)
|
||||
(
|
||||
(Function
|
||||
(Empty)
|
||||
(
|
||||
(Identifier))))))
|
||||
|
82
test/fixtures/ruby/lambda.diffA-B.txt
vendored
82
test/fixtures/ruby/lambda.diffA-B.txt
vendored
@ -1,43 +1,61 @@
|
||||
(Program
|
||||
{+(MethodCall
|
||||
{+(Call
|
||||
(Identifier)
|
||||
(Params
|
||||
(Identifier))
|
||||
(Binary
|
||||
(Function
|
||||
(Empty)
|
||||
(Identifier)
|
||||
(Other "+")
|
||||
(IntegerLiteral)))+}
|
||||
{-(MethodCall
|
||||
(
|
||||
(Plus
|
||||
(Identifier)
|
||||
(Integer)))))+}
|
||||
{-(Call
|
||||
(Identifier)
|
||||
(Object))-}
|
||||
{-(MethodCall
|
||||
(Hash)
|
||||
(Empty))-}
|
||||
{-(Call
|
||||
(Identifier)
|
||||
(Identifier))-}
|
||||
{-(MethodCall
|
||||
(Function
|
||||
(Empty)
|
||||
(
|
||||
(Identifier))))-}
|
||||
{-(Call
|
||||
(Identifier)
|
||||
(Params
|
||||
(Function
|
||||
(Empty)
|
||||
(Identifier)
|
||||
(KeywordParameter
|
||||
(Identifier)
|
||||
(Boolean))
|
||||
(OptionalParameter
|
||||
(Identifier)
|
||||
(Identifier)))
|
||||
(IntegerLiteral))-}
|
||||
{-(AnonymousFunction
|
||||
(ExpressionStatements))-}
|
||||
{-(AnonymousFunction
|
||||
(ExpressionStatements
|
||||
(Identifier)))-}
|
||||
{-(AnonymousFunction
|
||||
(Identifier)
|
||||
(Identifier)
|
||||
(
|
||||
(Integer))))-}
|
||||
{-(Function
|
||||
(Identifier)
|
||||
(ExpressionStatements
|
||||
(IntegerLiteral)))-}
|
||||
{-(AnonymousFunction
|
||||
(
|
||||
(Function
|
||||
(Empty)
|
||||
([]))))-}
|
||||
{-(Function
|
||||
(Identifier)
|
||||
(SplatParameter
|
||||
(Identifier))
|
||||
(Other "destructured_parameter"
|
||||
(
|
||||
(Function
|
||||
(Empty)
|
||||
(
|
||||
(Identifier)))))-}
|
||||
{-(Function
|
||||
(Identifier)
|
||||
(Identifier)
|
||||
(
|
||||
(Function
|
||||
(Empty)
|
||||
(
|
||||
(Integer)))))-}
|
||||
{-(Function
|
||||
(Identifier)
|
||||
(Identifier)
|
||||
(Identifier)
|
||||
(
|
||||
(Identifier)
|
||||
(Identifier))
|
||||
(ExpressionStatements))-})
|
||||
(
|
||||
(Function
|
||||
(Empty)
|
||||
([]))))-})
|
||||
|
76
test/fixtures/ruby/lambda.diffB-A.txt
vendored
76
test/fixtures/ruby/lambda.diffB-A.txt
vendored
@ -1,40 +1,56 @@
|
||||
(Program
|
||||
{+(MethodCall
|
||||
{+(Call
|
||||
(Identifier)
|
||||
(Object))+}
|
||||
{+(MethodCall
|
||||
(Hash)
|
||||
(Empty))+}
|
||||
{+(Call
|
||||
(Identifier)
|
||||
(Identifier))+}
|
||||
(MethodCall
|
||||
(Function
|
||||
(Empty)
|
||||
(
|
||||
(Identifier))))+}
|
||||
(Call
|
||||
(Identifier)
|
||||
(Params
|
||||
(Function
|
||||
(Empty)
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
{+(KeywordParameter
|
||||
(Identifier)
|
||||
(Boolean))+}
|
||||
{+(OptionalParameter
|
||||
(Identifier)
|
||||
(Identifier))+})
|
||||
{+(IntegerLiteral)+}
|
||||
{-(Binary
|
||||
(Identifier)
|
||||
(Other "+")
|
||||
(IntegerLiteral))-})
|
||||
{+(AnonymousFunction
|
||||
(ExpressionStatements))+}
|
||||
{+(AnonymousFunction
|
||||
(ExpressionStatements
|
||||
(Identifier)))+}
|
||||
{+(AnonymousFunction
|
||||
{+(Identifier)+}
|
||||
{+(Identifier)+}
|
||||
(
|
||||
{+(Integer)+}
|
||||
{-(Plus
|
||||
(Identifier)
|
||||
(Integer))-})))
|
||||
{+(Function
|
||||
(Identifier)
|
||||
(ExpressionStatements
|
||||
(IntegerLiteral)))+}
|
||||
{+(AnonymousFunction
|
||||
(
|
||||
(Function
|
||||
(Empty)
|
||||
([]))))+}
|
||||
{+(Function
|
||||
(Identifier)
|
||||
(SplatParameter
|
||||
(Identifier))
|
||||
(Other "destructured_parameter"
|
||||
(
|
||||
(Function
|
||||
(Empty)
|
||||
(
|
||||
(Identifier)))))+}
|
||||
{+(Function
|
||||
(Identifier)
|
||||
(Identifier)
|
||||
(
|
||||
(Function
|
||||
(Empty)
|
||||
(
|
||||
(Integer)))))+}
|
||||
{+(Function
|
||||
(Identifier)
|
||||
(Identifier)
|
||||
(Identifier)
|
||||
(
|
||||
(Identifier)
|
||||
(Identifier))
|
||||
(ExpressionStatements))+})
|
||||
(
|
||||
(Function
|
||||
(Empty)
|
||||
([]))))+})
|
||||
|
69
test/fixtures/ruby/lambda.parseA.txt
vendored
69
test/fixtures/ruby/lambda.parseA.txt
vendored
@ -1,35 +1,52 @@
|
||||
(Program
|
||||
(MethodCall
|
||||
(Call
|
||||
(Identifier)
|
||||
(Object))
|
||||
(MethodCall
|
||||
(Hash)
|
||||
(Empty))
|
||||
(Call
|
||||
(Identifier)
|
||||
(Identifier))
|
||||
(MethodCall
|
||||
(Function
|
||||
(Empty)
|
||||
(
|
||||
(Identifier))))
|
||||
(Call
|
||||
(Identifier)
|
||||
(Params
|
||||
(Function
|
||||
(Empty)
|
||||
(Identifier)
|
||||
(KeywordParameter
|
||||
(Identifier)
|
||||
(Boolean))
|
||||
(OptionalParameter
|
||||
(Identifier)
|
||||
(Identifier)))
|
||||
(IntegerLiteral))
|
||||
(AnonymousFunction
|
||||
(ExpressionStatements))
|
||||
(AnonymousFunction
|
||||
(ExpressionStatements
|
||||
(Identifier)))
|
||||
(AnonymousFunction
|
||||
(Identifier)
|
||||
(Identifier)
|
||||
(
|
||||
(Integer))))
|
||||
(Function
|
||||
(Identifier)
|
||||
(ExpressionStatements
|
||||
(IntegerLiteral)))
|
||||
(AnonymousFunction
|
||||
(
|
||||
(Function
|
||||
(Empty)
|
||||
([]))))
|
||||
(Function
|
||||
(Identifier)
|
||||
(SplatParameter
|
||||
(Identifier))
|
||||
(Other "destructured_parameter"
|
||||
(
|
||||
(Function
|
||||
(Empty)
|
||||
(
|
||||
(Identifier)))))
|
||||
(Function
|
||||
(Identifier)
|
||||
(Identifier)
|
||||
(
|
||||
(Function
|
||||
(Empty)
|
||||
(
|
||||
(Integer)))))
|
||||
(Function
|
||||
(Identifier)
|
||||
(Identifier)
|
||||
(Identifier)
|
||||
(
|
||||
(Identifier)
|
||||
(Identifier))
|
||||
(ExpressionStatements)))
|
||||
(
|
||||
(Function
|
||||
(Empty)
|
||||
([])))))
|
||||
|
13
test/fixtures/ruby/lambda.parseB.txt
vendored
13
test/fixtures/ruby/lambda.parseB.txt
vendored
@ -1,9 +1,10 @@
|
||||
(Program
|
||||
(MethodCall
|
||||
(Call
|
||||
(Identifier)
|
||||
(Params
|
||||
(Identifier))
|
||||
(Binary
|
||||
(Function
|
||||
(Empty)
|
||||
(Identifier)
|
||||
(Other "+")
|
||||
(IntegerLiteral))))
|
||||
(
|
||||
(Plus
|
||||
(Identifier)
|
||||
(Integer))))))
|
||||
|
Loading…
Reference in New Issue
Block a user