File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed
Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ pye = QuasiQuoter
6060-- call return
6161pyf :: QuasiQuoter
6262pyf = QuasiQuoter
63- { quoteExp = \ txt -> [| runPy $ evalutorPyf $ (expQQ Fun txt) | ]
63+ { quoteExp = \ txt -> [| runPy $ evaluatorPyf $ (expQQ Fun txt) | ]
6464 , quotePat = error " quotePat"
6565 , quoteType = error " quoteType"
6666 , quoteDec = error " quoteDec"
Original file line number Diff line number Diff line change @@ -81,4 +81,26 @@ tests = testGroup "Run python"
8181 except NameError:
8282 pass
8383 |]
84+ , testCase " Scope pyf->any" $ do
85+ _ <- [pyf |
86+ x = 12
87+ x
88+ return 12
89+ |]
90+ -- Not visible
91+ throwsPy $ void [pye | x |]
92+ [py_ |
93+ try:
94+ x
95+ assert False, "x shouln't be visible (1)"
96+ except NameError:
97+ pass
98+ |]
99+ [pymain |
100+ try:
101+ x
102+ assert False, "x shouln't be visible (2)"
103+ except NameError:
104+ pass
105+ |]
84106 ]
You can’t perform that action at this time.
0 commit comments