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


##########
daffodil-tdml-lib/src/main/scala/org/apache/daffodil/tdml/TDMLRunner.scala:
##########
@@ -2358,30 +2358,48 @@ sealed abstract class DocumentPart(part: Node, parent: 
Document) {
     }
   }.trim.toUpperCase()
 
+  private lazy val doubleForwardPattern = "//.*".r
+  private lazy val openClosePattern = "/[*](.|\n)*?[*]/".r
+
+  //Accessor for doubleForwardPattern regex
+  def getDoubleForwardPattern() : scala.util.matching.Regex = {
+    return doubleForwardPattern
+  }
+
+  //Accessor for openClosePattern regex
+  def getOpenClosePattern() : scala.util.matching.Regex = {
+    return openClosePattern
+  }
+
   /*
   * Allow "//" and "/* */" (inline) to act as comments.
-  * Any characters not explicitly allowed are also considered comments and are 
removed.
+  * Any valid XML characters not explicitly allowed are also considered 
comments and are removed.
   */
-  def removeComments(validCharactersSet : String, userData : String ) : String 
= {
-    lazy val doubleForwardPattern = "//.*".r
-    lazy val openClosePattern = "/[*].*[*]/".r
+  def canonicalizeData(validCharactersSet : String, userData : String) : 
String = {
+    val noWarnCharsSet = "|()[]."

Review Comment:
   In test testMIL2045_47001D_Page70_TableB_I, we make extensive use of x and X 
to illustrate bits of a byte copying exactly the way this is done in a 
particular spec document.
   
   I think that X and x should be added here. 
   
   I also think you should create a new version of 
testMIL2045_47001D_Page70_TableB_I which uses the new comment syntax. (The 
existing test should generate warnings but still work)
   
   Suggest you do two such rewrites. One with /*... */ comments, which can be 
wrapped around the early field name part of each documentPart line, the other 
would flip and put the bits part first, and use the "//" comments and move the 
field name comments to after the bits. 
   
   
   



##########
daffodil-tdml-lib/src/main/scala/org/apache/daffodil/tdml/TDMLRunner.scala:
##########
@@ -2358,30 +2358,48 @@ sealed abstract class DocumentPart(part: Node, parent: 
Document) {
     }
   }.trim.toUpperCase()
 
+  private lazy val doubleForwardPattern = "//.*".r
+  private lazy val openClosePattern = "/[*](.|\n)*?[*]/".r
+
+  //Accessor for doubleForwardPattern regex

Review Comment:
   Scala we don't bother with these getters. Your lazy vals are fine as is. 



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