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

 ##########
 File path: 
daffodil-core/src/main/scala/org/apache/daffodil/grammar/ElementBaseGrammarMixin.scala
 ##########
 @@ -605,7 +605,12 @@ trait ElementBaseGrammarMixin
   }
 
   private lazy val textStandardNumber = prod("textStandardNumber", 
textNumberRep == TextNumberRep.Standard) {
-    ConvertTextCombinator(this, stringValue, textConverter)
+    val converter = textStandardBaseDefaulted match {
+      case 10 => textConverter
+      case 2 | 8 | 16 =>  textStandardNonBaseTenConverter
 
 Review comment:
   The DFDL spec is clear on what valid values are for textStandardBase, and 
they are only 2, 8, 10, 16.  I would want a compelling reason to deviate from 
this.
   
   Base 256 sounds more like binary encoding; I'm not sure we gain much by 
allowing it as a textStandardBase as well. Eg. when the string "0" means 48, I 
do not think you are working with text.

----------------------------------------------------------------
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