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

Commit fecfa07

Browse files
committed
Let.
1 parent e1a6215 commit fecfa07

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

  • semantic-analysis/src/Analysis/Syntax

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ module Analysis.Syntax.Python
1616
, pattern Bool''
1717
, pattern String''
1818
, pattern Throw''
19+
, pattern Let''
1920
, pattern (:>>>>)
2021
, pattern Import''
2122
, pattern Function''
@@ -81,6 +82,7 @@ data Python (arity :: T.Nat) where
8182
Bool' :: Bool -> Python T.N0
8283
String' :: Text -> Python T.N0
8384
Throw' :: Python T.N1
85+
Let' :: Name -> Python T.N2
8486
(:>>>) :: Python T.N2
8587
Import' :: NonEmpty Text -> Python T.N0
8688
Function' :: Name -> [Name] -> Python T.N1
@@ -106,6 +108,9 @@ pattern String'' t = String' t T.:$: T.Nil
106108
pattern Throw'' :: T.Term Python v -> T.Term Python v
107109
pattern Throw'' e = Throw' T.:$: T.Cons e T.Nil
108110

111+
pattern Let'' :: Name -> T.Term Python v -> T.Term Python v -> T.Term Python v
112+
pattern Let'' n v b = Let' n T.:$: T.Cons v (T.Cons b T.Nil)
113+
109114
pattern (:>>>>) :: T.Term Python v -> T.Term Python v -> T.Term Python v
110115
pattern s :>>>> t = (:>>>) T.:$: T.Cons s (T.Cons t T.Nil)
111116

@@ -139,7 +144,7 @@ pattern ACons'' a as = ACons' T.:$: T.Cons a (T.Cons as T.Nil)
139144
pattern Locate'' :: Span -> T.Term Python v -> T.Term Python v
140145
pattern Locate'' s t = Locate' s T.:$: T.Cons t T.Nil
141146

142-
{-# COMPLETE Noop'', Iff'', Bool'', String'', Throw'', (:>>>>), Import'', Function'', Call'', Locate'' #-}
147+
{-# COMPLETE Noop'', Iff'', Bool'', String'', Throw'', Let'', (:>>>>), Import'', Function'', Call'', Locate'' #-}
143148

144149

145150
-- Abstract interpretation

0 commit comments

Comments
 (0)