1
1
mirror of https://github.com/github/semantic.git synced 2024-11-29 02:44:36 +03:00

Define an Unmarshal instance for Py.Term.

This commit is contained in:
Rob Rix 2019-09-27 10:52:43 -04:00
parent 9b704006b4
commit 4f85f5148f
No known key found for this signature in database
GPG Key ID: F188A01508EA1CF7

View File

@ -6,8 +6,12 @@ module Language.Python
import qualified Language.Python.Tags as PyTags import qualified Language.Python.Tags as PyTags
import qualified Tags.Tagging.Precise as Tags import qualified Tags.Tagging.Precise as Tags
import qualified TreeSitter.Python.AST as Py import qualified TreeSitter.Python.AST as Py
import qualified TreeSitter.Unmarshal as TS
newtype Term a = Term { getTerm :: Py.Module a } newtype Term a = Term { getTerm :: Py.Module a }
instance TS.Unmarshal Term where
unmarshalNode node = Term <$> TS.unmarshalNode node
instance Tags.ToTags Term where instance Tags.ToTags Term where
tags src = Tags.runTagging src . PyTags.tags . getTerm tags src = Tags.runTagging src . PyTags.tags . getTerm