You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by GitBox <gi...@apache.org> on 2020/01/14 12:16:33 UTC

[GitHub] [incubator-daffodil] stevedlawrence commented on a change in pull request #314: Add support for textStandardBase

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


With regards,
Apache Git Services