1
1
mirror of https://github.com/github/semantic.git synced 2024-12-25 07:55:12 +03:00

Compile identifiers.

Co-Authored-By: Patrick Thomson <patrickt@users.noreply.github.com>
This commit is contained in:
Rob Rix 2019-06-17 11:18:08 -04:00
parent 31d396ee91
commit d64e12d868
No known key found for this signature in database
GPG Key ID: F188A01508EA1CF7

View File

@ -5,6 +5,7 @@ module Language.Python.Core
import Control.Monad.Fail
import Data.Core as Core
import Data.Name as Name
import GHC.Generics
import Prelude hiding (fail)
import qualified TreeSitter.Python.AST as Py
@ -55,7 +56,9 @@ instance Compile Py.FunctionDefinition
instance Compile Py.FutureImportStatement
instance Compile Py.GeneratorExpression
instance Compile Py.GlobalStatement
instance Compile Py.Identifier
instance Compile Py.Identifier where
compile (Py.Identifier text) = pure (Var (User text))
instance Compile Py.IfStatement where
compile Py.IfStatement{..} = If <$> compile condition <*> compile consequence <*> case alternative of