From 3986e0ae1a8fd68b6c123156d0a0d272a05216ef Mon Sep 17 00:00:00 2001 From: Timothy Clem Date: Thu, 10 Nov 2016 12:51:26 -0800 Subject: [PATCH] Optional parameter error case, note about keyword parameter fall through --- src/Language/Ruby.hs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Language/Ruby.hs b/src/Language/Ruby.hs index 10ad193e3..6bda7dfd4 100644 --- a/src/Language/Ruby.hs +++ b/src/Language/Ruby.hs @@ -49,7 +49,11 @@ termConstructor source sourceSpan name range children ("argument_pair", [ k, v ] ) -> S.Pair k v ("argument_pair", _ ) -> S.Error children ("keyword_parameter", [ k, v ] ) -> S.Pair k v + -- NB: ("keyword_parameter", k) is a required keyword parameter, e.g.: + -- def foo(name:); end + -- Let it fall through to generate an Indexed syntax. ("optional_parameter", [ k, v ] ) -> S.Pair k v + ("optional_parameter", _ ) -> S.Error children ("array", _ ) -> S.Array children ("assignment", [ identifier, value ]) -> S.Assignment identifier value ("assignment", _ ) -> S.Error children