stevedlawrence commented on a change in pull request #75: Daffodil 1738 zoned
decimal
URL: https://github.com/apache/incubator-daffodil/pull/75#discussion_r196397384
##########
File path:
daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/parsers/PrimitivesTextNumber1.scala
##########
@@ -582,17 +581,18 @@ class NumberFormatFactoryStatic[S](context: ThrowsSDE,
getGroupingSep(gse, context)
}
- val expRep = {
- Assert.invariant(exponentRepExpEv.isConstant)
- getExponentRep(exponentRepExpEv.maybeConstant.get, context)
- }
+ val expRep =
+ if (exponentRepExpEv.isEmpty) Nope else One {
+ Assert.invariant(exponentRepExpEv.get.isConstant)
+ getExponentRep(exponentRepExpEv.get.maybeConstant.get, context)
+ }
Review comment:
This is a really weird way to write this (I think I wrote the stuff this is
based on). I guess it's best to be consistent with the already existing code
that does something similar, but we should avoid this in the future.
----------------------------------------------------------------
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