mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-20 16:47:28 +01:00
Remove the writer1.length method.
This commit is contained in:
1 parent
5052b16f2d
commit
c0c023e1cf
3 files changed
+22
-24
No files matched your search
@@ -244,21 +244,11 @@ func (g *gen) writeExprOther(b *buffer, n *a.Expr, rp replacementPolicy, pp pare
|
||||
if pp == parenthesesMandatory {
|
||||
b.writeb('(')
|
||||
}
|
||||
|
||||
x := n.LHS().Expr().LHS().Expr()
|
||||
if typ := x.MType(); typ.Decorator() == 0 && typ.Name().Key() == t.KeyWriter1 {
|
||||
// TODO: don't hard-code dst.
|
||||
const wName = "dst"
|
||||
b.printf("(uint64_t)(%s%s.private_impl.mark ? (%swptr_%s - %s%s.private_impl.mark) : 0)",
|
||||
aPrefix, wName, bPrefix, wName, aPrefix, wName)
|
||||
} else {
|
||||
b.writes("(uint64_t)(")
|
||||
if err := g.writeExpr(b, x, rp, parenthesesMandatory, depth); err != nil {
|
||||
return err
|
||||
}
|
||||
b.writes(".len)")
|
||||
b.writes("(uint64_t)(")
|
||||
if err := g.writeExpr(b, n.LHS().Expr().LHS().Expr(), rp, parenthesesMandatory, depth); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
b.writes(".len)")
|
||||
if pp == parenthesesMandatory {
|
||||
b.writeb(')')
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user