mbeckerle commented on a change in pull request #257: Daffodil 2165 type calc
double functions
URL: https://github.com/apache/incubator-daffodil/pull/257#discussion_r299619320
##########
File path:
daffodil-core/src/main/scala/org/apache/daffodil/dpath/Expression.scala
##########
@@ -1706,6 +1754,43 @@ case class FunctionCallExpression(functionQNameString:
String, expressions: List
funcObj.setOOLAGContext(this)
funcObj
}
+
+ def lookupTypeCalculator(typeCalcName:Expression, requiresParse: Boolean,
requiresUnparse: Boolean):TypeCalculator[AnyRef, AnyRef]={
+ /*
+ * Every functions that currently uses this defines the type calculator
+ * as their first arguement.
+ * We still take the calculators name as an arguement to avoid relying on
this
+ * fact.
+ */
+ Assert.invariant(typeCalcName == expressions(0))
+ /*
+ * This lookup needs to occur before the main type-checker runs, because
it is
+ * used to determine the type of this expression.
+ * As a result, we must do some type checking manually
+ * Also, we insist that typeCalcName is a constant, which is not even
Review comment:
yeah.... you really do need to rename this argument. You can't even read
these comments without doing doubletakes. "How could the name be
non-constant...?" Oh it's the expression, not a name.
----------------------------------------------------------------
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]
With regards,
Apache Git Services