Skip to content

Commit d472ff9

Browse files
committed
eval: introduce a top-level defer context for top-level statements
Fixes neugram#210.
1 parent b21309f commit d472ff9

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

eval/eval.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,7 @@ func New(path string, shellState *shell.State) *Program {
123123
Path: path,
124124
Cur: &Scope{
125125
Parent: universe,
126-
// FIXME(sbinet): what should this be?
127-
// fct: "ng-main",
126+
fct: "۰ng-main",
128127
},
129128
ShellState: shellState,
130129
reflector: newReflector(),

eval/testdata/defer8.ng

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
defer func() {} ()
2+
3+
print("OK")

0 commit comments

Comments
 (0)