mbeckerle commented on a change in pull request #56: Improved toString of 
grammar and parser/unparser objects.
URL: https://github.com/apache/incubator-daffodil/pull/56#discussion_r179222015
 
 

 ##########
 File path: 
daffodil-core/src/main/scala/org/apache/daffodil/grammar/primitives/PrimitivesElementKinds.scala
 ##########
 @@ -81,7 +82,14 @@ case class DelimiterStackCombinatorElement(e: ElementBase, 
body: Gram) extends T
   lazy val uInit = if (e.initiatorParseEv.isKnownNonEmpty) 
One(e.initiatorUnparseEv) else Nope
   lazy val uTerm = if (e.terminatorParseEv.isKnownNonEmpty) 
One(e.terminatorUnparseEv) else Nope
 
-  lazy val parser: DaffodilParser = new DelimiterStackParser((pInit.toList ++ 
pTerm.toList).toArray, e.termRuntimeData, body.parser)
+  lazy val delims = (pInit.toList ++ pTerm.toList)
+
+  override def toString() =
+    "<" + Misc.getNameFromClass(this) + " delims='" + delims.mkString(" ") + 
"'>" +
 
 Review comment:
   Yes, should escape these. 
   scala.xml.Utility.escape is insufficient however, as that (a) doesn't escape 
apostrophes because HTML doesn't have an &apos; entity (b) delims might be 
XML-illegal characters.
   
   So we have to remap all XML-illegal chars to XML-legal PUA chars, but leave 
CR and CRLF alone, remap C0 and C1 control characters appropriately to numeric 
entity refs. Remap whitespace chars to visible glyphs.
   
   We have all the pieces of this algorithm, just not in this particular 
combination.  

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to