mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-26 17:01:35 +01:00
Rename mark to set_mark, part 1 of N
This commit is contained in:
1 parent
4afd7de09f
commit
bd12c54ab5
9 files changed
+15
-13
No files matched your search
@@ -167,7 +167,7 @@ func (g *gen) writeExprOther(b *buffer, n *a.Expr, rp replacementPolicy, pp pare
|
|||||||
// TODO: update the bPrefix variables?
|
// TODO: update the bPrefix variables?
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
if isInSrc(g.tm, n, t.IDMark, 0) {
|
if isInSrc(g.tm, n, t.IDSetMark, 0) {
|
||||||
b.printf("wuffs_base__io_reader__mark(&%ssrc, %srptr_src)", aPrefix, bPrefix)
|
b.printf("wuffs_base__io_reader__mark(&%ssrc, %srptr_src)", aPrefix, bPrefix)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -178,7 +178,7 @@ func (g *gen) writeExprOther(b *buffer, n *a.Expr, rp replacementPolicy, pp pare
|
|||||||
aPrefix, bPrefix, aPrefix)
|
aPrefix, bPrefix, aPrefix)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
if isInDst(g.tm, n, t.IDMark, 0) {
|
if isInDst(g.tm, n, t.IDSetMark, 0) {
|
||||||
// TODO: is a private_impl.bounds[0] the right representation? What
|
// TODO: is a private_impl.bounds[0] the right representation? What
|
||||||
// if the function is passed a (ptr io_writer) instead of a
|
// if the function is passed a (ptr io_writer) instead of a
|
||||||
// (io_writer)? Do we still want to have that mark live outside of
|
// (io_writer)? Do we still want to have that mark live outside of
|
||||||
|
|||||||
@@ -875,7 +875,7 @@ func (g *gen) writeReadUXX(b *buffer, n *a.Expr, name string, size uint32, endia
|
|||||||
|
|
||||||
func isInSrc(tm *t.Map, n *a.Expr, methodName t.ID, nArgs int) bool {
|
func isInSrc(tm *t.Map, n *a.Expr, methodName t.ID, nArgs int) bool {
|
||||||
callSuspendible := methodName != t.IDSinceMark &&
|
callSuspendible := methodName != t.IDSinceMark &&
|
||||||
methodName != t.IDMark &&
|
methodName != t.IDSetMark &&
|
||||||
methodName != t.IDSetLimit
|
methodName != t.IDSetLimit
|
||||||
if n.Operator() != t.IDOpenParen || n.CallSuspendible() != callSuspendible || len(n.Args()) != nArgs {
|
if n.Operator() != t.IDOpenParen || n.CallSuspendible() != callSuspendible || len(n.Args()) != nArgs {
|
||||||
return false
|
return false
|
||||||
@@ -898,7 +898,7 @@ func isInDst(tm *t.Map, n *a.Expr, methodName t.ID, nArgs int) bool {
|
|||||||
methodName != t.IDCopyFromSlice32 &&
|
methodName != t.IDCopyFromSlice32 &&
|
||||||
methodName != t.IDCopyFromSlice &&
|
methodName != t.IDCopyFromSlice &&
|
||||||
methodName != t.IDSinceMark &&
|
methodName != t.IDSinceMark &&
|
||||||
methodName != t.IDMark
|
methodName != t.IDSetMark
|
||||||
// TODO: check that n.Args() is "(x:bar)".
|
// TODO: check that n.Args() is "(x:bar)".
|
||||||
if n.Operator() != t.IDOpenParen || n.CallSuspendible() != callSuspendible || len(n.Args()) != nArgs {
|
if n.Operator() != t.IDOpenParen || n.CallSuspendible() != callSuspendible || len(n.Args()) != nArgs {
|
||||||
return false
|
return false
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ var Funcs = []string{
|
|||||||
|
|
||||||
"io_reader.available()(ret u64)",
|
"io_reader.available()(ret u64)",
|
||||||
"io_reader.set_limit(l u64)()",
|
"io_reader.set_limit(l u64)()",
|
||||||
"io_reader.mark()()",
|
"io_reader.set_mark()()",
|
||||||
"io_reader.since_mark()(ret slice u8)",
|
"io_reader.since_mark()(ret slice u8)",
|
||||||
|
|
||||||
"io_reader.skip32?(n u32)()",
|
"io_reader.skip32?(n u32)()",
|
||||||
@@ -128,7 +128,7 @@ var Funcs = []string{
|
|||||||
|
|
||||||
"io_writer.available()(ret u64)",
|
"io_writer.available()(ret u64)",
|
||||||
"io_writer.set_limit(l u64)()",
|
"io_writer.set_limit(l u64)()",
|
||||||
"io_writer.mark()()",
|
"io_writer.set_mark()()",
|
||||||
"io_writer.since_mark()(ret slice u8)",
|
"io_writer.since_mark()(ret slice u8)",
|
||||||
|
|
||||||
"io_writer.copy_from_history32(distance u32, length u32)(ret u32)",
|
"io_writer.copy_from_history32(distance u32, length u32)(ret u32)",
|
||||||
|
|||||||
@@ -681,6 +681,9 @@ func (q *checker) tcheckDot(n *a.Expr, depth uint32) error {
|
|||||||
if s == nil {
|
if s == nil {
|
||||||
s = q.c.structs[lQID]
|
s = q.c.structs[lQID]
|
||||||
if s == nil {
|
if s == nil {
|
||||||
|
if lQID[0] == t.IDBase {
|
||||||
|
return fmt.Errorf("check: no built-in function %q found", qqid.Str(q.tm))
|
||||||
|
}
|
||||||
return fmt.Errorf("check: no struct type %q found for expression %q", lTyp.Str(q.tm), lhs.Str(q.tm))
|
return fmt.Errorf("check: no struct type %q found for expression %q", lTyp.Str(q.tm), lhs.Str(q.tm))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -461,7 +461,7 @@ const (
|
|||||||
IDLowBits = ID(0x20E)
|
IDLowBits = ID(0x20E)
|
||||||
IDHighBits = ID(0x20F)
|
IDHighBits = ID(0x20F)
|
||||||
IDUnroll = ID(0x210)
|
IDUnroll = ID(0x210)
|
||||||
IDMark = ID(0x211)
|
IDSetMark = ID(0x211)
|
||||||
IDSinceMark = ID(0x212)
|
IDSinceMark = ID(0x212)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -651,7 +651,7 @@ var builtInsByID = [nBuiltInIDs]string{
|
|||||||
IDLowBits: "low_bits",
|
IDLowBits: "low_bits",
|
||||||
IDHighBits: "high_bits",
|
IDHighBits: "high_bits",
|
||||||
IDUnroll: "unroll",
|
IDUnroll: "unroll",
|
||||||
IDMark: "mark",
|
IDSetMark: "set_mark",
|
||||||
IDSinceMark: "since_mark",
|
IDSinceMark: "since_mark",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ pub struct decoder?(
|
|||||||
|
|
||||||
pub func decoder.decode?(dst base.io_writer, src base.io_reader)() {
|
pub func decoder.decode?(dst base.io_writer, src base.io_reader)() {
|
||||||
while true {
|
while true {
|
||||||
in.dst.mark()
|
in.dst.set_mark()
|
||||||
var z base.status = try this.decode_blocks?(dst:in.dst, src:in.src)
|
var z base.status = try this.decode_blocks?(dst:in.dst, src:in.src)
|
||||||
if not z.is_suspension() {
|
if not z.is_suspension() {
|
||||||
return z
|
return z
|
||||||
|
|||||||
@@ -319,8 +319,7 @@ pri func decoder.decode_id?(dst base.io_writer, src base.io_reader)() {
|
|||||||
this.previous_lzw_decode_ended_abruptly = true
|
this.previous_lzw_decode_ended_abruptly = true
|
||||||
|
|
||||||
while true {
|
while true {
|
||||||
// TODO: should "mark" be "set_mark" or "set_mark_here"?
|
in.src.set_mark()
|
||||||
in.src.mark()
|
|
||||||
io_bind (in.src) {
|
io_bind (in.src) {
|
||||||
in.src.set_limit(l:block_size)
|
in.src.set_limit(l:block_size)
|
||||||
var z base.status = try this.lzw.decode?(dst:in.dst, src:in.src)
|
var z base.status = try this.lzw.decode?(dst:in.dst, src:in.src)
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ pub func decoder.decode?(dst base.io_writer, src base.io_reader)() {
|
|||||||
var checksum_got base.u32
|
var checksum_got base.u32
|
||||||
var decoded_length_got base.u32
|
var decoded_length_got base.u32
|
||||||
while true {
|
while true {
|
||||||
in.dst.mark()
|
in.dst.set_mark()
|
||||||
var z base.status = try this.flate.decode?(dst:in.dst, src:in.src)
|
var z base.status = try this.flate.decode?(dst:in.dst, src:in.src)
|
||||||
if not this.ignore_checksum {
|
if not this.ignore_checksum {
|
||||||
checksum_got = this.checksum.update(x:in.dst.since_mark())
|
checksum_got = this.checksum.update(x:in.dst.since_mark())
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ pub func decoder.decode?(dst base.io_writer, src base.io_reader)() {
|
|||||||
// Decode and checksum the DEFLATE-encoded payload.
|
// Decode and checksum the DEFLATE-encoded payload.
|
||||||
var checksum_got base.u32
|
var checksum_got base.u32
|
||||||
while true {
|
while true {
|
||||||
in.dst.mark()
|
in.dst.set_mark()
|
||||||
var z base.status = try this.flate.decode?(dst:in.dst, src:in.src)
|
var z base.status = try this.flate.decode?(dst:in.dst, src:in.src)
|
||||||
if not this.ignore_checksum {
|
if not this.ignore_checksum {
|
||||||
checksum_got = this.checksum.update(x:in.dst.since_mark())
|
checksum_got = this.checksum.update(x:in.dst.since_mark())
|
||||||
|
|||||||
Reference in new issue
Block a user