From a81beeb125d465122c53061a8f72243fb3d9c360 Mon Sep 17 00:00:00 2001 From: Charlie Somerville Date: Wed, 11 Apr 2018 15:47:52 +1000 Subject: [PATCH] ruby: register parameters as local identifier names --- src/Language/Ruby/Assignment.hs | 3 +-- test/fixtures/ruby/lambda.diffA-B.txt | 3 +-- test/fixtures/ruby/lambda.diffB-A.txt | 3 +-- test/fixtures/ruby/lambda.parseB.txt | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/Language/Ruby/Assignment.hs b/src/Language/Ruby/Assignment.hs index c0c619121..05a95d6d0 100644 --- a/src/Language/Ruby/Assignment.hs +++ b/src/Language/Ruby/Assignment.hs @@ -230,8 +230,7 @@ scopeResolution = makeTerm <$> symbol ScopeResolution <*> children (Expression.S parameter :: Assignment parameter = - mk Identifier - <|> mk Identifier' + lhsIdent <|> mk SplatParameter <|> mk HashSplatParameter <|> mk BlockParameter diff --git a/test/fixtures/ruby/lambda.diffA-B.txt b/test/fixtures/ruby/lambda.diffA-B.txt index 347a6dbfa..67d452c63 100644 --- a/test/fixtures/ruby/lambda.diffA-B.txt +++ b/test/fixtures/ruby/lambda.diffA-B.txt @@ -6,8 +6,7 @@ {+(Identifier)+} { ([]) ->(Plus - {+(Send - {+(Identifier)+})+} + {+(Identifier)+} {+(Integer)+}) })) {-(Send {-(Identifier)-} diff --git a/test/fixtures/ruby/lambda.diffB-A.txt b/test/fixtures/ruby/lambda.diffB-A.txt index fd3c37ae8..1f25ddb9c 100644 --- a/test/fixtures/ruby/lambda.diffB-A.txt +++ b/test/fixtures/ruby/lambda.diffB-A.txt @@ -5,8 +5,7 @@ (Empty) {-(Identifier)-} { (Plus - {-(Send - {-(Identifier)-})-} + {-(Identifier)-} {-(Integer)-}) ->([]) })) {+(Send diff --git a/test/fixtures/ruby/lambda.parseB.txt b/test/fixtures/ruby/lambda.parseB.txt index 0ae3a43d2..23f3795f0 100644 --- a/test/fixtures/ruby/lambda.parseB.txt +++ b/test/fixtures/ruby/lambda.parseB.txt @@ -5,6 +5,5 @@ (Empty) (Identifier) (Plus - (Send - (Identifier)) + (Identifier) (Integer)))))