Add a writer1.slice method.

This commit is contained in:
Nigel Tao committed 2017-09-22 11:54:24 +10:00
1 parent 519ec373f2
commit 18e32d61e5
10 files changed
+115 -24

No files matched your search

+10
View File
@@ -134,6 +134,16 @@ func (g *gen) writeExprOther(b *buffer, n *a.Expr, rp replacementPolicy, pp pare
}
return nil
}
if isInDst(g.tm, n, t.KeySlice, 0) {
if pp == parenthesesMandatory {
b.writeb('(')
}
b.writes("(puffs_base_slice_u8){.ptr= a_dst.buf->ptr, .len=b_wptr_dst - a_dst.buf->ptr}")
if pp == parenthesesMandatory {
b.writeb(')')
}
return nil
}
// TODO.
case t.KeyOpenBracket: