diff --git a/node.go b/node.go index f97a902..d4d23e3 100644 --- a/node.go +++ b/node.go @@ -245,7 +245,7 @@ func convert(n_ node.Node) (string, error) { return "", parseErr{n, err} } - if len(n.Init) != 1 { + if len(n.Cond) != 1 { return "", parseErr{n, fmt.Errorf("for loop can only have 1 cond clause, found %d", len(n.Cond))} } fcond, err := convert(n.Cond[0]) @@ -253,7 +253,7 @@ func convert(n_ node.Node) (string, error) { return "", parseErr{n, err} } - if len(n.Init) != 1 { + if len(n.Loop) != 1 { return "", parseErr{n, fmt.Errorf("for loop can only have 1 loop clause, found %d", len(n.Loop))} } loopStmt := n.Loop[0]