8000 :fire: the old Python type. · github/semantic@cdad4dc · GitHub
[go: up one dir, main page]

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

Commit cdad4dc

Browse files
committed
🔥 the old Python type.
1 parent 1fc29e8 commit cdad4dc

File tree

1 file changed

+2
-20
lines changed
  • semantic-analysis/src/Analysis/Syntax

1 file changed

+2
-20
lines changed

semantic-analysis/src/Analysis/Syntax/Python.hs

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
{-# LANGUAGE DeriveTraversable #-}
21
{-# LANGUAGE FlexibleContexts #-}
32
{-# LANGUAGE LambdaCase #-}
43
-- | This belongs in @semantic-python@ instead of @semantic-analysis@, but for the sake of expedience…
54
module Analysis.Syntax.Python
65
( -- * Syntax
76
Term
8-
, Python(..)
97
-- * Abstract interpretation
108
, eval0
119
, eval
@@ -23,32 +21,16 @@ import Control.Effect.Reader
2321
import Control.Monad (foldM)
2422
import Data.Foldable (for_)
2523
import Data.Function (fix)
26-
import Data.List.NonEmpty (NonEmpty (..), nonEmpty)
24+
import Data.List.NonEmpty (nonEmpty)
2725
import Data.Maybe (mapMaybe)
28-
import Data.Text (Text, pack)
26+
import Data.Text (pack)
2927
import qualified Language.Python.Common as Py
3028
import Language.Python.Version3.Parser
3129
import Source.Span (Pos (..), Span (..), point)
3230
import System.FilePath (takeBaseName)
3331

3432
-- Syntax
3533

36-
data Python t
37-
= Noop
38-
| Iff t t t
39-
| Bool Bool
40-
| String Text
41-
| Throw t
42-
| Let Name t t
43-
| t :>> t
44-
| Import (NonEmpty Text)
45-
| Function Name [Name] t
46-
| Call t [t]
47-
| Locate Span t
48-
deriving (Eq, Foldable, Functor, Ord, Show, Traversable)
49-
50-
infixl 1 :>>
51-
5234
data Term
5335
= Module (Py.Module Py.SrcSpan)
5436
| Statement (Py.Statement Py.SrcSpan)

0 commit comments

Comments
 (0)
0