From fdde8b02554716f917864d6b1b5add5b98b80264 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Fri, 21 Apr 2017 13:28:11 -0400 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20bind=20node=20fields=20explicit?= =?UTF-8?q?ly.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Data/Syntax/Assignment.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Data/Syntax/Assignment.hs b/src/Data/Syntax/Assignment.hs index 9bc1b46cb..f324f9ced 100644 --- a/src/Data/Syntax/Assignment.hs +++ b/src/Data/Syntax/Assignment.hs @@ -102,8 +102,8 @@ runAssignment :: (Symbol grammar, Eq grammar, Show grammar) => Assignment (Node runAssignment = iterFreer (\ assignment yield offset source nodes -> case (assignment, dropAnonymous nodes) of -- Nullability: some rules, e.g. 'pure a' and 'many a', should match at the end of input. Either side of an alternation may be nullable, ergo Alt can match at the end of input. (Alt a b, nodes) -> yield a offset source nodes <|> yield b offset source nodes -- FIXME: Symbol `Alt` Symbol `Alt` Symbol is inefficient, should build and match against an IntMap instead. - (assignment, subtree@(Rose (nodeSymbol :. range :. sourceSpan :. Nil) children) : rest) -> case assignment of - Get -> yield (nodeSymbol :. range :. sourceSpan :. Nil) offset source nodes + (assignment, subtree@(Rose node children) : rest) -> case assignment of + Get -> yield node offset source nodes Source -> yield "" offset source rest Children childAssignment -> do c <- assignAllFrom childAssignment offset source children