mbeckerle commented on code in PR #799:
URL: https://github.com/apache/daffodil/pull/799#discussion_r886159015


##########
daffodil-tdml-lib/src/main/scala/org/apache/daffodil/tdml/TDMLRunner.scala:
##########
@@ -2364,6 +2361,35 @@ sealed abstract class DocumentPart(part: Node, parent: 
Document) {
     }
   }.trim.toUpperCase()
 
+  /*
+  * Description: Compare ByteDocumentPart/BitsDocumentPart string to a string 
of valid characters.
+  *              If the string runs into non-valid characters, skip over them.
+  *              If the string runs into "//", any character following it will 
be skipped (including valid ones).
+  *              Characters on a new line will be considered again, unless 
they are found after a "//"
+  * Parameters: String containing the acceptable characters (0,1 for bits) 
(0-9,A-F,a-f for bytes)
+  * Return: ListBuffer[Char] of the accepted characters from the 
ByteDocumentPart/BitsDocumentPart element
+  */
+  def commentCompatibleFormat(validCharacters: String) : ListBuffer[Char] = {
+    val tempListBuffer = new ListBuffer[Char]()
+    var noCommentBool = true
+
+    for (i <- 0 to partRawContent.length()-1){

Review Comment:
   There are places where I know some non-whitespace separators are used for 
good effect E.g., things like
   
   01|01 0001 10|11 
   
   where the vertical bars are used to show where the byte boundaries or 
element boundaries are. So I think allowing whitespace and certain specific 
punctuation characters like brackets and parens in the mix is very useful. (at 
least '|()[].' are useful)
   
   There is a fair amount of investment in old-style comments where people have 
done 
   
   `<documentPart type="bits"> trackStability 011 <documentPart>
   `
   So I think quite a lot of impact if that feature is removed allowing (and 
ignoring) those letters. 
   
   Yes ultimately I would like to fix these, but many files (hundreds) of DFDL 
schema tests will have to be changed by users. 
   
   I think we would need an option on the tdml:testSuite level to change the 
default of this from allowed to deprecated to disallowed. 
   



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to