Skip to content

Commit ba8c397

Browse files
Merge pull request #22 from effekt-community/update_flake_lock_action
flake.lock: Update
2 parents 5a00525 + e9148ed commit ba8c397

4 files changed

Lines changed: 17 additions & 17 deletions

File tree

flake.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/utils/huffman.effekt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ record ContentsData(table: AsciiDictionary[String], content: ByteArray)
2929
/// Read chunk of the stream and make a character-frequency map (dictionary)
3030
/// from it. Return the map, read chunk and its length.
3131
///
32-
def characterCompressionReader(): (AsciiDictionary[Int], Int, ByteArray) / read[Byte] = {
32+
def characterCompressionReader(): (AsciiDictionary[Int], Int, ByteArray) / next[Byte] = {
3333
var dict = emptyDict[Int]()
3434

3535
val chunkSize = 4096
3636
val buffer = bytearray::allocate(chunkSize)
3737
var offset = 0
3838

3939
def go(): Unit = try {
40-
val readByte = do read[Byte]()
40+
val readByte = do next[Byte]()
4141

4242
buffer.set(offset, readByte)
4343
offset = offset + 1

src/utils/lzss.effekt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ import bytearray
2323
/// The offset is the starting position of a match. It is the number of bytes one needs to go back in the search buffer.
2424
/// The length is the number of bytes to copy from the search buffer.
2525

26-
def chunkReader(): (Int, ByteArray) / read[Byte] = {
26+
def chunkReader(): (Int, ByteArray) / next[Byte] = {
2727
val chunkSize = 2 * 4096
2828
val buffer = bytearray::allocate(chunkSize)
2929
var offset = 0
3030

3131
def go(): Unit = try {
32-
val readByte = do read[Byte]()
32+
val readByte = do next[Byte]()
3333

3434
buffer.set(offset, readByte)
3535
offset = offset + 1
@@ -182,7 +182,7 @@ def count_tokens(buffer: ByteArray, byteCount: Int): Int = {
182182

183183
/// Compress the data chunk (block) into the output stream.
184184
/// Count the tokens first and then compress the data chunk.
185-
def writeCompressedBlockStream(buffer: ByteArray, byteCount: Int): Unit / { emit[Byte], read[Byte]} = {
185+
def writeCompressedBlockStream(buffer: ByteArray, byteCount: Int): Unit / { emit[Byte], next[Byte]} = {
186186
with streamWriter
187187
with on[OutOfBounds].report
188188

src/utils/stream_io.effekt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,13 @@ def numberToBitsStream(number: Int, bitsToWrite: Int) = {
128128

129129
/// Object representing bit/byte reading operations
130130
interface StreamReader {
131-
def readBit(): Bool / read[Byte]
132-
def readByte(): Byte / read[Byte]
131+
def readBit(): Bool / next[Byte]
132+
def readByte(): Byte / next[Byte]
133133
}
134134

135135
/// Handler for StreamReader interface.
136136
/// Keeps an internal buffer for reading bits and bytes, so no data is lost.
137-
def streamReader { prog: => Unit / StreamReader }: Unit / {read[Byte], stop} = {
137+
def streamReader { prog: => Unit / StreamReader }: Unit / {next[Byte], stop} = {
138138
var buffer = 0
139139
var curBit = 0
140140
var readBits = 0
@@ -145,7 +145,7 @@ def streamReader { prog: => Unit / StreamReader }: Unit / {read[Byte], stop} = {
145145
def readBit() = {
146146
resume {
147147
if (curBit <= 0) {
148-
val readByte = do read[Byte]
148+
val readByte = do next[Byte]
149149
buffer = readByte.toInt
150150
curBit = 128
151151
readBits = 0
@@ -166,9 +166,9 @@ def streamReader { prog: => Unit / StreamReader }: Unit / {read[Byte], stop} = {
166166
def readByte() = {
167167
resume {
168168
if (readBits == 0) {
169-
do read[Byte]
169+
do next[Byte]
170170
} else {
171-
val readByte = do read[Byte]
171+
val readByte = do next[Byte]
172172

173173
val newBuffer = readByte.toInt
174174
val unreadBits = 8 - readBits

0 commit comments

Comments
 (0)