stevedlawrence commented on code in PR #1338:
URL: https://github.com/apache/daffodil/pull/1338#discussion_r1842641968
##########
daffodil-core/src/main/scala/org/apache/daffodil/core/grammar/ElementBaseGrammarMixin.scala:
##########
@@ -1387,14 +1381,15 @@ trait ElementBaseGrammarMixin
}
case LengthKind.Implicit if isSimpleType && primType == PrimType.String
=>
new SpecifiedLengthImplicitCharacters(this, body,
this.maxLength.longValue)
-
- case LengthKind.Implicit if isSimpleType && primType ==
PrimType.HexBinary =>
- new SpecifiedLengthImplicit(this, body, this.maxLength.longValue *
bitsMultiplier)
case LengthKind.Implicit
- if isSimpleType && impliedRepresentation == Representation.Binary =>
+ if isSimpleType &&
+ impliedRepresentation == Representation.Binary &&
+ primType != PrimType.HexBinary =>
new SpecifiedLengthImplicit(this, body, implicitBinaryLengthInBits)
Review Comment:
I think that means we only need the SpecifiedLengthImplicit when we are
trying to parse the nillable part of a number. For example, the way things
currently work is we have something like a `SimpleNilOrValueParser` and that
has two children parsers, one is the nil parser (which sounds like it requires
SpecifiedLengthImplicit) and the other is the binary paser (which probably does
not need SpecifiedLenghtImplicit).
I wonder if captureLengthRegion needs a new paramater (e.g. `forNilContent:
Boolean`) which is passed into `specifiedLength`. This way `specifiedLength`
can do different things depending on if it's trying to represent nil content or
non-nil content.
--
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]