From 315c5e6e9b41b83076332afaa0a057db25ea9d90 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Wed, 5 Apr 2017 16:17:04 -0400 Subject: [PATCH] Use the `Program` rule at the top level. --- src/Language/Ruby/Syntax.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Language/Ruby/Syntax.hs b/src/Language/Ruby/Syntax.hs index ba5cbb668..e02b4dacc 100644 --- a/src/Language/Ruby/Syntax.hs +++ b/src/Language/Ruby/Syntax.hs @@ -55,7 +55,8 @@ data Grammar = Program | Uninterpreted | BeginBlock | EndBlock | Undef | Alias | -- | Assignment from AST in Ruby’s grammar onto a program in Ruby’s syntax. assignment :: Assignment Grammar (Program Syntax (Maybe ())) -assignment = foldr (>>) (return Nothing) <$> rule Program +assignment = foldr (>>) (pure Nothing) <$> (rule Program <> children) + comment :: Assignment Grammar (Program Syntax a) comment = wrapU . Comment.Comment <$> (rule Comment <> content)