mike-mcgann commented on code in PR #988:
URL: https://github.com/apache/daffodil/pull/988#discussion_r1142409489
##########
daffodil-runtime1/src/main/scala/org/apache/daffodil/runtime1/processors/parsers/BlobLengthParsers.scala:
##########
@@ -54,14 +53,7 @@ trait ByteChunkWriter { self: PrimParser =>
writeChunk(array, bytesToPut.toInt)
remainingBitsToGet -= bitsToGet
} else {
- val remainingBits =
- if (dis.remainingBits.isDefined) {
- val totalBitsRead = nBits - remainingBitsToGet
- MaybeULong(dis.remainingBits.get + totalBitsRead)
- } else {
- MaybeULong.Nope
- }
- self.PENotEnoughBits(start, nBits, remainingBits)
+ self.PENotEnoughBits(start, nBits, dis)
Review Comment:
The `currentLocation` member in `PState` has `bitPos1b` but not `bitPos0b`.
I ended up storing the value of `bitPos0b` at the beginning of the parse and
then using that in the error message if need be. The chunk writer now returns
the number of bits actually written instead of handling the error there and the
caller creates the error if the expectation isn't met.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]