mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-18 08:32:11 +01:00
Tweak io_bind syntax
This commit is contained in:
1 parent
e992921dce
commit
badbdfc487
7 files changed
+62
-88
No files matched your search
@@ -173,9 +173,8 @@ const (
|
||||
)
|
||||
|
||||
const (
|
||||
maxIOBinds = 100
|
||||
maxIOBindInFields = 100
|
||||
maxTemp = 10000
|
||||
maxIOBinds = 100
|
||||
maxTemp = 10000
|
||||
)
|
||||
|
||||
type status struct {
|
||||
|
||||
@@ -225,12 +225,7 @@ func (g *gen) writeStatementAssign(b *buffer,
|
||||
}
|
||||
|
||||
func (g *gen) writeStatementIOBind(b *buffer, n *a.IOBind, depth uint32) error {
|
||||
inFields := n.InFields()
|
||||
if n.Keyword() == t.IDIOLimit {
|
||||
inFields = []*a.Node{n.IO().AsNode()}
|
||||
}
|
||||
|
||||
if g.currFunk.ioBinds > maxIOBinds || len(inFields) > maxIOBindInFields {
|
||||
if g.currFunk.ioBinds > maxIOBinds {
|
||||
return fmt.Errorf("too many temporary variables required")
|
||||
}
|
||||
ioBindNum := g.currFunk.ioBinds
|
||||
@@ -240,8 +235,8 @@ func (g *gen) writeStatementIOBind(b *buffer, n *a.IOBind, depth uint32) error {
|
||||
// instead of block-scoped (smaller scope) if the coro_susp_point
|
||||
// switch can jump past this initialization??
|
||||
b.writes("{\n")
|
||||
for i := 0; i < len(inFields); i++ {
|
||||
e := inFields[i].AsExpr()
|
||||
{
|
||||
e := n.IO()
|
||||
prefix := vPrefix
|
||||
if e.Operator() != 0 {
|
||||
prefix = aPrefix
|
||||
@@ -278,8 +273,8 @@ func (g *gen) writeStatementIOBind(b *buffer, n *a.IOBind, depth uint32) error {
|
||||
}
|
||||
}
|
||||
|
||||
for i := len(inFields) - 1; i >= 0; i-- {
|
||||
e := inFields[i].AsExpr()
|
||||
{
|
||||
e := n.IO()
|
||||
prefix := vPrefix
|
||||
if e.Operator() != 0 {
|
||||
prefix = aPrefix
|
||||
|
||||
Reference in new issue
Block a user