mbeckerle commented on a change in pull request #88: Daffodil 1919 separators
URL: https://github.com/apache/incubator-daffodil/pull/88#discussion_r206579597
##########
File path:
daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/parsers/ElementKindParsers.scala
##########
@@ -197,50 +152,50 @@ class ChoiceDispatchCombinatorParser(rd:
TermRuntimeData, dispatchKeyEv: ChoiceD
}
}
-class ArrayCombinatorParser(erd: ElementRuntimeData, bodyParser: Parser)
- extends CombinatorParser(erd) {
- override def nom = "Array"
- override lazy val childProcessors = Seq(bodyParser)
-
- override lazy val runtimeDependencies = Nil
-
- def parse(start: PState): Unit = {
-
- start.mpstate.arrayIndexStack.push(1L) // one-based indexing
- start.mpstate.occursBoundsStack.push(start.tunable.maxOccursBounds)
-
- bodyParser.parse1(start)
-
- val actualOccurs = start.mpstate.arrayIndexStack.pop()
- start.mpstate.occursBoundsStack.pop()
-
- if (start.processorStatus ne Success) return
-
- val shouldValidate =
- start.dataProc.isDefined && start.dataProc.value.getValidationMode !=
ValidationMode.Off
-
- if (shouldValidate && erd.minOccurs.isDefined && erd.maxOccurs.isDefined) {
- val minO = erd.minOccurs.get
- val maxO = erd.maxOccurs.get
- val isUnbounded = maxO == -1
- val occurrence = actualOccurs - 1
-
- if (isUnbounded && occurrence < minO)
- start.validationError("%s occurred '%s' times when it was expected to
be a " +
- "minimum of '%s' and a maximum of 'UNBOUNDED' times.",
erd.diagnosticDebugName,
- occurrence, minO)
- else if (!isUnbounded && (occurrence < minO || occurrence > maxO))
- start.validationError("%s occurred '%s' times when it was expected to
be a " +
- "minimum of '%s' and a maximum of '%s' times.",
erd.diagnosticDebugName,
- occurrence, minO, maxO)
- else {
- //ok
- }
- }
- }
-}
-
-// This follows the same behavior as Arrays for parsing
-class OptionalCombinatorParser(erd: ElementRuntimeData, bodyParser: Parser)
extends ArrayCombinatorParser(erd, bodyParser) {
- override def nom = "Optional"
-}
+//class ArrayCombinatorParser(erd: ElementRuntimeData, bodyParser: Parser)
Review comment:
delete
----------------------------------------------------------------
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