You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by "mike-mcgann (via GitHub)" <gi...@apache.org> on 2023/02/17 18:54:43 UTC

[GitHub] [daffodil] mike-mcgann commented on a diff in pull request #966: Add Scalar type

mike-mcgann commented on code in PR #966:
URL: https://github.com/apache/daffodil/pull/966#discussion_r1110214463


##########
daffodil-runtime1/src/main/scala/org/apache/daffodil/runtime1/dpath/NodeInfo.scala:
##########
@@ -382,18 +380,28 @@ object NodeInfo extends Enum {
    * All complex types are represented by this one type object.
    */
   protected sealed trait ComplexKind extends AnyType.Kind
-  case object Complex extends TypeNode('Complex, AnyType) with ComplexKind {
+  case object Complex extends TypeNode('Complex, Scalar) with ComplexKind {
     type Kind = ComplexKind
   }
 
   /**
-   * For things like fn:exists, fn:empty, dfdl:contenLength
+   * For things like fn:exists, fn:empty
    */
   protected sealed trait ExistsKind extends AnyType.Kind
   case object Exists extends TypeNode('Exists, AnyType) with AnyTypeKind {
     type Kind = ExistsKind
   }
 
+  /**
+   * For things like dfdl:contentLength, dfdl:valueLength
+   */
+  protected sealed trait ScalarKind extends AnyType.Kind
+  case object Scalar
+    extends TypeNode('Scalar, AnyType, Seq(AnySimpleType, Complex))
+    with AnyTypeKind {
+    type Kind = ScalarKind
+  }

Review Comment:
   Changed back to Exists. I can go ahead and rename Exists to PathExpr in this PR if you think we should make that change now. 
   
   I found a isPathToOneWholeArray method in PathExpression which looks like it has the exact information needed here. 
   



-- 
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: commits-unsubscribe@daffodil.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org