mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-22 16:47:28 +01:00
Add io_writer.history_position
This commit is contained in:
1 parent
f7b1b87c70
commit
b60a2cacd9
3 files changed
+33
-26
No files matched your search
@@ -358,6 +358,10 @@ func (g *gen) writeBuiltinIOWriter(b *buffer, recv *a.Expr, method t.ID, args []
|
|||||||
b.printf("((uint64_t)(%s%s - %s%s))", iopPrefix, recvName, io0Prefix, recvName)
|
b.printf("((uint64_t)(%s%s - %s%s))", iopPrefix, recvName, io0Prefix, recvName)
|
||||||
return nil
|
return nil
|
||||||
|
|
||||||
|
case t.IDHistoryPosition:
|
||||||
|
b.printf("(%s ? %s->meta.pos : 0)", recvName, recvName)
|
||||||
|
return nil
|
||||||
|
|
||||||
case t.IDPosition:
|
case t.IDPosition:
|
||||||
b.printf("wuffs_base__u64__sat_add(%s->meta.pos, ((uint64_t)(%s%s - %s%s)))",
|
b.printf("wuffs_base__u64__sat_add(%s->meta.pos, ((uint64_t)(%s%s - %s%s)))",
|
||||||
recvName, iopPrefix, recvName, io0Prefix, recvName)
|
recvName, iopPrefix, recvName, io0Prefix, recvName)
|
||||||
|
|||||||
@@ -528,6 +528,7 @@ var funcsOther = [...]string{
|
|||||||
|
|
||||||
"io_writer.count_since(mark: u64) u64",
|
"io_writer.count_since(mark: u64) u64",
|
||||||
"io_writer.history_length() u64",
|
"io_writer.history_length() u64",
|
||||||
|
"io_writer.history_position() u64",
|
||||||
"io_writer.length() u64",
|
"io_writer.length() u64",
|
||||||
"io_writer.mark() u64",
|
"io_writer.mark() u64",
|
||||||
"io_writer.position() u64",
|
"io_writer.position() u64",
|
||||||
|
|||||||
+28
-26
@@ -490,19 +490,20 @@ const (
|
|||||||
|
|
||||||
IDDecodeFrameOptions = ID(0x158)
|
IDDecodeFrameOptions = ID(0x158)
|
||||||
|
|
||||||
IDCanUndoByte = ID(0x160)
|
IDCanUndoByte = ID(0x160)
|
||||||
IDCountSince = ID(0x161)
|
IDCountSince = ID(0x161)
|
||||||
IDHistoryLength = ID(0x162)
|
IDHistoryLength = ID(0x162)
|
||||||
IDIsClosed = ID(0x163)
|
IDHistoryPosition = ID(0x163)
|
||||||
IDMark = ID(0x164)
|
IDIsClosed = ID(0x164)
|
||||||
IDMatch15 = ID(0x165)
|
IDMark = ID(0x165)
|
||||||
IDMatch31 = ID(0x166)
|
IDMatch15 = ID(0x166)
|
||||||
IDMatch7 = ID(0x167)
|
IDMatch31 = ID(0x167)
|
||||||
IDPosition = ID(0x168)
|
IDMatch7 = ID(0x168)
|
||||||
IDSince = ID(0x169)
|
IDPosition = ID(0x169)
|
||||||
IDSkip = ID(0x16A)
|
IDSince = ID(0x16A)
|
||||||
IDSkipU32 = ID(0x16B)
|
IDSkip = ID(0x16B)
|
||||||
IDSkipU32Fast = ID(0x16C)
|
IDSkipU32 = ID(0x16C)
|
||||||
|
IDSkipU32Fast = ID(0x16D)
|
||||||
|
|
||||||
IDCopyFromSlice = ID(0x170)
|
IDCopyFromSlice = ID(0x170)
|
||||||
IDLimitedCopyU32FromHistory = ID(0x171)
|
IDLimitedCopyU32FromHistory = ID(0x171)
|
||||||
@@ -917,19 +918,20 @@ var builtInsByID = [nBuiltInIDs]string{
|
|||||||
|
|
||||||
IDDecodeFrameOptions: "decode_frame_options",
|
IDDecodeFrameOptions: "decode_frame_options",
|
||||||
|
|
||||||
IDCanUndoByte: "can_undo_byte",
|
IDCanUndoByte: "can_undo_byte",
|
||||||
IDCountSince: "count_since",
|
IDCountSince: "count_since",
|
||||||
IDHistoryLength: "history_length",
|
IDHistoryLength: "history_length",
|
||||||
IDIsClosed: "is_closed",
|
IDHistoryPosition: "history_position",
|
||||||
IDMark: "mark",
|
IDIsClosed: "is_closed",
|
||||||
IDMatch15: "match15",
|
IDMark: "mark",
|
||||||
IDMatch31: "match31",
|
IDMatch15: "match15",
|
||||||
IDMatch7: "match7",
|
IDMatch31: "match31",
|
||||||
IDPosition: "position",
|
IDMatch7: "match7",
|
||||||
IDSince: "since",
|
IDPosition: "position",
|
||||||
IDSkip: "skip",
|
IDSince: "since",
|
||||||
IDSkipU32: "skip_u32",
|
IDSkip: "skip",
|
||||||
IDSkipU32Fast: "skip_u32_fast",
|
IDSkipU32: "skip_u32",
|
||||||
|
IDSkipU32Fast: "skip_u32_fast",
|
||||||
|
|
||||||
IDCopyFromSlice: "copy_from_slice",
|
IDCopyFromSlice: "copy_from_slice",
|
||||||
IDLimitedCopyU32FromHistory: "limited_copy_u32_from_history",
|
IDLimitedCopyU32FromHistory: "limited_copy_u32_from_history",
|
||||||
|
|||||||
Reference in new issue
Block a user