Add a (table T).linearize method

This commit is contained in:
Nigel Tao committed 2018-05-18 13:54:07 +10:00
1 parent f6cd4b2af2
commit 85256c7a45
13 files changed
+120 -2

No files matched your search

+9
View File
@@ -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 != "" {