stevedlawrence commented on a change in pull request #129: Cross Testing
Capability with IBM DFDL
URL: https://github.com/apache/incubator-daffodil/pull/129#discussion_r229673639
##########
File path:
daffodil-core/src/main/scala/org/apache/daffodil/dsom/RuntimePropertyMixins.scala
##########
@@ -381,6 +384,37 @@ trait ElementRuntimeValuedPropertiesMixin
res
}
+ protected final lazy val optionTextOutputMinLength =
findPropertyOption("textOutputMinLength")
+
+ /**
+ * We only use textOutputMinLength in a very narrow set of circumstances.
+ * Otherwise we assume 0.
+ */
+ lazy val textOutputMinLength: Long = {
+ val useTextOutputMinLength: Boolean = {
+ decl.isSimpleType &&
+ (decl.simpleType.primType ne PrimType.String) &&
+ (decl.simpleType.primType ne PrimType.HexBinary) &&
+ (decl.impliedRepresentation eq Representation.Text) &&
+ decl.optionTextPadKind.isDefined &&
+ (decl.textPadKind eq TextPadKind.PadChar) &&
+ {
+ import LengthKind._
+ decl.lengthKind match {
+ case Delimited | Prefixed | Pattern | EndOfParent => true
+ case Explicit if (!decl.lengthEv.isConstant) => true
+ case _ => false
+ }
+ }
+ }
+ val res: Long =
+ if (useTextOutputMinLength) {
+ val Found(value, _, _, _) = findProperty("textOutputMinLength")
+ value.toLong
+ } else 0
+ res
+ }
+
Review comment:
This change seems unrelated to this pull request. Can it be pulled out into
a separate PR with a separate bug? Would be easier to review just the
textOutputMinLength change.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services