From 4f85f5148fc7ce874e2e40a8c174460b0a5856ae Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Fri, 27 Sep 2019 10:52:43 -0400 Subject: [PATCH] Define an Unmarshal instance for Py.Term. --- semantic-tags/src/Language/Python.hs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/semantic-tags/src/Language/Python.hs b/semantic-tags/src/Language/Python.hs index fd2cb92eb..66c5803a1 100644 --- a/semantic-tags/src/Language/Python.hs +++ b/semantic-tags/src/Language/Python.hs @@ -6,8 +6,12 @@ module Language.Python import qualified Language.Python.Tags as PyTags import qualified Tags.Tagging.Precise as Tags import qualified TreeSitter.Python.AST as Py +import qualified TreeSitter.Unmarshal as TS newtype Term a = Term { getTerm :: Py.Module a } +instance TS.Unmarshal Term where + unmarshalNode node = Term <$> TS.unmarshalNode node + instance Tags.ToTags Term where tags src = Tags.runTagging src . PyTags.tags . getTerm