mbeckerle commented on a change in pull request #471:
URL: https://github.com/apache/incubator-daffodil/pull/471#discussion_r562248050
##########
File path:
daffodil-runtime2/src/main/scala/org/apache/daffodil/runtime2/generators/BinaryIntegerKnownLengthCodeGenerator.scala
##########
@@ -18,70 +18,52 @@
package org.apache.daffodil.runtime2.generators
import org.apache.daffodil.grammar.primitives.BinaryIntegerKnownLength
+import org.apache.daffodil.schema.annotation.props.gen.OccursCountKind
import org.apache.daffodil.schema.annotation.props.gen.{ BitOrder, ByteOrder }
trait BinaryIntegerKnownLengthCodeGenerator {
def binaryIntegerKnownLengthGenerateCode(g: BinaryIntegerKnownLength,
cgState: CodeGeneratorState): Unit = {
// For the time being this is a very limited back end.
- // So there are numerous restrictions to enforce.
+ // So there are some restrictions to enforce.
val e = g.e
- val fieldName = e.namedQName.local
val lengthInBits: Long = {
e.schemaDefinitionUnless(e.elementLengthInBitsEv.isConstant, "Runtime
dfdl:length expressions not supported.")
val len = e.elementLengthInBitsEv.constValue.get
len
}
-
+ if (e.bitOrder ne BitOrder.MostSignificantBitFirst)
+ e.SDE("Only dfdl:bitOrder 'mostSignificantBitFirst' is supported.")
Review comment:
If you want to get rid of this codecov annotation about this line, you
can use
e.schemaDefinitionWhen(....)
That embeds the predicate into the same line of code, so the predicate gets
executed, which will satisfy codecov.
We need a shorter alias though, should be SDEWhen(predicate, msgTemplate,
args*)
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]