From 38ec3182e8221d4733434be147cc070feb1f8e35 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Thu, 31 Aug 2017 12:33:24 -0400 Subject: [PATCH] `symbol` constructs Jump nodes. --- src/Data/Syntax/Assignment.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Data/Syntax/Assignment.hs b/src/Data/Syntax/Assignment.hs index a769235db..69adbe76a 100644 --- a/src/Data/Syntax/Assignment.hs +++ b/src/Data/Syntax/Assignment.hs @@ -167,7 +167,7 @@ currentNode = tracing CurrentNode `Then` return -- | Zero-width match of a node with the given symbol, producing the current node’s location. symbol :: (Bounded grammar, Ix grammar, HasCallStack) => grammar -> Assignment ast grammar (Record Location) -symbol s = tracing (Choose [s] (IntMap.singleton (toIndex s) location) Nothing) `Then` id +symbol s = tracing (Jump [s] (array (s, s) [(s, Just location)]) Nothing) `Then` id -- | A rule to produce a node’s source as a ByteString. source :: HasCallStack => Assignment ast grammar ByteString