mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-26 09:01:35 +01:00
Add a (table T).linearize method
This commit is contained in:
1 parent
f6cd4b2af2
commit
85256c7a45
13 files changed
+120
-2
No files matched your search
@@ -323,6 +323,15 @@ func (g *gen) writeBuiltinTable(b *buffer, recv *a.Expr, method t.ID, args []*a.
|
||||
field = "stride"
|
||||
case t.IDWidth:
|
||||
field = "width"
|
||||
|
||||
case t.IDLinearize:
|
||||
// TODO: don't assume that the table is a table of base.u8.
|
||||
b.writes("wuffs_base__table_u8__linearize(")
|
||||
if err := g.writeExpr(b, recv, rp, depth); err != nil {
|
||||
return err
|
||||
}
|
||||
b.writeb(')')
|
||||
return nil
|
||||
}
|
||||
|
||||
if field != "" {
|
||||
|
||||
Reference in new issue
Block a user