Skip to content

Commit

Permalink
fixup!
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh Adams committed Jan 13, 2025
1 parent 0ce22ea commit 8be44b2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class SeqComp private (context: SchemaComponent, children: Seq[Gram])
else
new SeqCompParser(
context.runtimeData,
parserChildren.toVector,
parserChildren.toVector
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,14 @@ import org.apache.daffodil.core.dsom.Term
trait HasStatementsGrammarMixin extends GrammarMixin { self: Term =>

// Includes assert/discriminator statements that are not testKind="pattern"
private lazy val assertDiscrimExpressionStatementGrams = assertDiscrimExpressionStatements.map { _.gram(self) }
private lazy val assertDiscrimExpressionStatementGrams =
assertDiscrimExpressionStatements.map { _.gram(self) }

final lazy val dfdlAssertDiscrimExpressionStatementEvaluations =
prod("dfdlAssertDiscrimExpressionStatementEvaluations", assertDiscrimExpressionStatementGrams.length > 0) {
prod(
"dfdlAssertDiscrimExpressionStatementEvaluations",
assertDiscrimExpressionStatementGrams.length > 0
) {
assertDiscrimExpressionStatementGrams.fold(mt) { _ ~ _ }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,14 +229,16 @@ abstract class CombinatorParser(override val context: RuntimeData)

final class SeqCompParser(
context: RuntimeData,
val childParsers: Vector[Parser],
val childParsers: Vector[Parser]
) extends CombinatorParser(context) {
override lazy val runtimeDependencies = Vector()
override def childProcessors = childParsers

override def nom = "seq"

val optDiscrimParser = childParsers.collectFirst { case ae: AssertExpressionEvaluationParser if (ae.discrim) => ae }
val optDiscrimParser = childParsers.collectFirst {
case ae: AssertExpressionEvaluationParser if (ae.discrim) => ae
}
val nonDiscrimChildren = childParsers.diff(optDiscrimParser.toSeq)

def parse(pstate: PState): Unit = {
Expand All @@ -245,8 +247,8 @@ final class SeqCompParser(

// Handle all non discriminator child parsers first
while ((i < numNonDiscrimChildren) && (pstate.processorStatus eq Success)) {
nonDiscrimChildren(i).parse1(pstate)
i += 1
nonDiscrimChildren(i).parse1(pstate)
i += 1
}

if (optDiscrimParser.isDefined) {
Expand Down

0 comments on commit 8be44b2

Please sign in to comment.