mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-19 08:38:14 +01:00
Generate C code for "a[i] = x".
This commit is contained in:
1 parent
f5af981f15
commit
587bc2a55d
5 files changed
+69
-7
No files matched your search
+10
-2
@@ -997,8 +997,16 @@ func (g *gen) writeExprOther(n *a.Expr, rp replacementPolicy, depth uint32) erro
|
||||
// TODO.
|
||||
|
||||
case t.KeyOpenBracket:
|
||||
// n is an index.
|
||||
// TODO.
|
||||
// n is an index.
|
||||
if err := g.writeExpr(n.LHS().Expr(), rp, parenthesesMandatory, depth); err != nil {
|
||||
return err
|
||||
}
|
||||
g.writeb('[')
|
||||
if err := g.writeExpr(n.RHS().Expr(), rp, parenthesesOptional, depth); err != nil {
|
||||
return err
|
||||
}
|
||||
g.writeb(']')
|
||||
return nil
|
||||
|
||||
case t.KeyColon:
|
||||
// n is a slice.
|
||||
|
||||
Reference in new issue
Block a user