stevedlawrence commented on code in PR #1121:
URL: https://github.com/apache/daffodil/pull/1121#discussion_r1399882186
##########
daffodil-codegen-c/src/main/scala/org/apache/daffodil/codegen/c/DaffodilCCodeGenerator.scala:
##########
@@ -275,6 +276,7 @@ object DaffodilCCodeGenerator
case g: ElementParseAndUnspecifiedLength =>
elementParseAndUnspecifiedLengthGenerateCode(g, cgState)
case g: ElementUnused => noop(g)
+ case g: Gram if g eq EmptyGram => noop(g)
Review Comment:
It might better to add this as the first case instead:
```scala
case g: Gram if g.isEmpty => noop(g)
```
This will still noop `EmptyGram`'s like you have, but also noop
non-`EmptyGram` grammars that determine that they are empty. I'm not sure if
it's possible for codgen-c to walk into those or if you'll only ever see empty
grammars that are `EmptyGram`, but it wouldn't hurt.
--
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]