Skip to content

Commit 789fa09

Browse files
committed
some more comments
1 parent 878f489 commit 789fa09

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

ast/ast.go

+12-3
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,26 @@ type Expression interface {
2525
expressionNode()
2626
}
2727

28+
// Deferrable is used to be able to
29+
// check whether an expression needs
30+
// to be executed now or at the end
31+
// of the scope
2832
type Deferrable interface {
2933
IsDeferred() bool
3034
SetDeferred(bool)
3135
}
3236

37+
// Deferred is a struct that can be embedded
38+
// in order to define whether the current node
39+
// needs to be executed right away or whether
40+
// it should be deferred until the end of the
41+
// current scope.
3342
type Deferred struct {
34-
Defer bool
43+
deferred bool
3544
}
3645

37-
func (d *Deferred) IsDeferred() bool { return d.Defer }
38-
func (d *Deferred) SetDeferred(deferred bool) { d.Defer = deferred }
46+
func (d *Deferred) IsDeferred() bool { return d.deferred }
47+
func (d *Deferred) SetDeferred(deferred bool) { d.deferred = deferred }
3948

4049
// Represents the whole program
4150
// as a bunch of statements

0 commit comments

Comments
 (0)