mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-26 01:01:35 +01:00
Add reader1.limitt and writer1.limitt methods.
The "limitt" typo will be renamed to "limit" once we remove the keyword named "limit".
This commit is contained in:
1 parent
b886e3a1ea
commit
a9ba7e85ac
10 files changed
+88
-20
No files matched your search
@@ -168,6 +168,14 @@ func (g *gen) writeExprOther(b *buffer, n *a.Expr, rp replacementPolicy, pp pare
|
||||
b.writes(")")
|
||||
return nil
|
||||
}
|
||||
if isInSrc(g.tm, n, t.KeyLimitt, 1) {
|
||||
b.printf("puffs_base__reader1__limit(&%ssrc,", aPrefix)
|
||||
if err := g.writeExpr(b, n.Args()[0].Arg().Value(), rp, parenthesesOptional, depth); err != nil {
|
||||
return err
|
||||
}
|
||||
b.writes(")")
|
||||
return nil
|
||||
}
|
||||
if isInSrc(g.tm, n, t.KeyMark, 0) {
|
||||
b.printf("puffs_base__reader1__mark(&%ssrc, %srptr_src)", aPrefix, bPrefix)
|
||||
return nil
|
||||
@@ -179,6 +187,14 @@ func (g *gen) writeExprOther(b *buffer, n *a.Expr, rp replacementPolicy, pp pare
|
||||
aPrefix, aPrefix, bPrefix, aPrefix)
|
||||
return nil
|
||||
}
|
||||
if isInDst(g.tm, n, t.KeyLimitt, 1) {
|
||||
b.printf("puffs_base__writer1__limit(&%sdst,", aPrefix)
|
||||
if err := g.writeExpr(b, n.Args()[0].Arg().Value(), rp, parenthesesOptional, depth); err != nil {
|
||||
return err
|
||||
}
|
||||
b.writes(")")
|
||||
return nil
|
||||
}
|
||||
if isInDst(g.tm, n, t.KeyMark, 0) {
|
||||
// TODO: is a private_impl.mark the right representation? What if
|
||||
// the function is passed a (ptr writer1) instead of a (writer1)?
|
||||
|
||||
Reference in new issue
Block a user