stevedlawrence commented on a change in pull request #314: Add support for 
textStandardBase
URL: https://github.com/apache/incubator-daffodil/pull/314#discussion_r366305787
 
 

 ##########
 File path: 
daffodil-core/src/main/scala/org/apache/daffodil/grammar/ElementBaseGrammarMixin.scala
 ##########
 @@ -625,6 +630,16 @@ trait ElementBaseGrammarMixin
     }
   }
 
+  private lazy val textStandardNonBaseTenConverter = {
+    primType match {
+      case PrimType.Double | PrimType.Float | PrimType.Decimal =>
+        SDE("dfdl:textStandardBase=\"%s\" cannot be used with %s", 
textStandardBaseDefaulted, primType.globalQName)
+      case _: NodeInfo.Numeric.Kind => ConvertNonBaseTenTextNumberPrim(this)
+      case PrimType.HexBinary | PrimType.Boolean | PrimType.Date | 
PrimType.Time | PrimType.DateTime | PrimType.AnyURI | PrimType.String =>
 
 Review comment:
   Yeah, that's probably the right thing to do in this case. I usually like to 
list everything because scala will warn you if the match/case isn't exhaustive. 
So it sort of forces you to think about every case. And if we add a new type 
(e.g. like we did recently for blobs) this will error and we'll be forced to 
think about how this new type applies to this match. But in this case I'm not 
sure if it's worth it.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to