Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

Commit d64e12d

Browse files
robrixpatrickt
andcommitted
Compile identifiers.
Co-Authored-By: Patrick Thomson <patrickt@users.noreply.github.com>
1 parent 31d396e commit d64e12d

File tree

1 file changed

+4
-1
lines changed
  • semantic-python/src/Language/Python

1 file changed

+4
-1
lines changed

semantic-python/src/Language/Python/Core.hs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ module Language.Python.Core
55

66
import Control.Monad.Fail
77
import Data.Core as Core
8+
import Data.Name as Name
89
import GHC.Generics
910
import Prelude hiding (fail)
1011
import qualified TreeSitter.Python.AST as Py
@@ -55,7 +56,9 @@ instance Compile Py.FunctionDefinition
5556
instance Compile Py.FutureImportStatement
5657
instance Compile Py.GeneratorExpression
5758
instance Compile Py.GlobalStatement
58-
instance Compile Py.Identifier
59+
60+
instance Compile Py.Identifier where
61+
compile (Py.Identifier text) = pure (Var (User text))
5962

6063
instance Compile Py.IfStatement where
6164
compile Py.IfStatement{..} = If <$> compile condition <*> compile consequence <*> case alternative of

0 commit comments

Comments
 (0)