Add an io_bind keyword

This commit is contained in:
Nigel Tao committed 2018-04-28 11:45:33 +10:00
1 parent 00f660af60
commit 395890c287
11 files changed
+127 -18

No files matched your search

+11
View File
@@ -128,6 +128,17 @@ func (g *gen) writeStatement(b *buffer, n *a.Node, depth uint32) error {
b.writes(";\n")
return nil
case a.KIOBind:
n := n.IOBind()
b.writes("// io_bind placeholder {\n")
for _, o := range n.Body() {
if err := g.writeStatement(b, o, depth); err != nil {
return err
}
}
b.writes("// io_bind placeholder }\n")
return nil
case a.KIf:
// TODO: for writeSuspendibles, make sure that we get order of
// sub-expression evaluation correct.
+7 -2
View File
@@ -276,8 +276,8 @@ func (g *gen) visitVars(b *buffer, block []*a.Node, depth uint32, f func(*gen, *
}
}
case a.KVar:
if err := f(g, b, o.Var()); err != nil {
case a.KIOBind:
if err := g.visitVars(b, o.IOBind().Body(), depth, f); err != nil {
return err
}
@@ -289,6 +289,11 @@ func (g *gen) visitVars(b *buffer, block []*a.Node, depth uint32, f func(*gen, *
return err
}
case a.KVar:
if err := f(g, b, o.Var()); err != nil {
return err
}
case a.KWhile:
if err := g.visitVars(b, o.While().Body(), depth, f); err != nil {
return err