mirror of
https://github.com/github/semantic.git
synced 2024-11-25 11:04:00 +03:00
Define an Unmarshal instance for Py.Term.
This commit is contained in:
parent
9b704006b4
commit
4f85f5148f
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user