olabusayoT commented on code in PR #1604:
URL: https://github.com/apache/daffodil/pull/1604#discussion_r2669999170


##########
daffodil-core/src/main/scala/org/apache/daffodil/core/grammar/AlignedMixin.scala:
##########
@@ -321,23 +476,24 @@ trait AlignedMixin extends GrammarMixin { self: Term =>
           case LengthKind.Delimited => encodingLengthApprox
           case LengthKind.Pattern => encodingLengthApprox
           case LengthKind.EndOfParent => LengthMultipleOf(1) // NYI
-          case LengthKind.Prefixed => LengthMultipleOf(1) // NYI
+          case LengthKind.Prefixed => {
+            val prefixElem = eb.prefixedLengthElementDecl
+            if (prefixElem.lengthKind == Explicit) {
+              LengthExact(
+                prefixElem.elementLengthInBitsEv.optConstant.get.get
+              ) + prefixLengthElementLength
+            } else {
+              getEncodingLengthApprox(prefixElem)

Review Comment:
   If they are binary numbers, wouldn't the isKnownEncoding condition be false, 
and result in the value being LengthMultipleOf(8)?



-- 
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]

Reply via email to