mbeckerle commented on a change in pull request #83: Adding value of 'bcd' to 
binaryCalendarRep
URL: https://github.com/apache/incubator-daffodil/pull/83#discussion_r203408658
 
 

 ##########
 File path: 
daffodil-core/src/main/scala/org/apache/daffodil/grammar/primitives/PrimitivesDateTime.scala
 ##########
 @@ -186,9 +200,27 @@ case class ConvertTextDateTimePrim(e: ElementBase) 
extends ConvertTextCalendarPr
   protected override val validFormatCharacters = 
"adDeEFGhHkKmMsSuwWvVyXxYzZ".toSeq
 }
 
-abstract class ConvertBinaryCalendarPrimBase(e: ElementBase, guard: Boolean, 
lengthInBits: Long)
-  extends ConvertCalendarPrimBase(e, guard) {
+abstract class BinaryPackedDecimalCalendarPrimBase(e: ElementBase, guard: 
Boolean)
+  extends ConvertCalendarPrimBase(e, guard)
+  with CalendarPrimBase {
 
+  lazy val pattern: String = {
+    val p = e.calendarPatternKind match {
+      case CalendarPatternKind.Explicit => e.calendarPattern
+      case _ => Assert.impossibleCase
+    }
+
+    p.toSeq.foreach(char =>
+      if (!validFormatCharacters.contains(char)) {
 
 Review comment:
   If this code appears here, why is it duplicated above? This test need only 
be done in one place right?

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