mbeckerle commented on a change in pull request #343: WIP: Daf 2302 ext var
URL: https://github.com/apache/incubator-daffodil/pull/343#discussion_r400198854
 
 

 ##########
 File path: daffodil-cli/src/main/scala/org/apache/daffodil/Main.scala
 ##########
 @@ -686,17 +687,14 @@ object Main extends Logging {
   }
 
   def createProcessorFromSchema(schema: URI, rootNS: Option[RefQName], path: 
Option[String],
-    extVars: Seq[Binding],
     tunables: Map[String, String],
     mode: ValidationMode.Type) = {
-    val compiler = Compiler()
-
-    compiler.setExternalDFDLVariables(extVars)
-    compiler.setTunables(tunables)
-
-    rootNS match {
-      case None => // nothing
-      case Some(RefQName(_, root, ns)) => 
compiler.setDistinguishedRootNode(root, ns.toStringOrNullIfNoNS)
+    val compiler = {
+      val c = Compiler().withTunables(tunables)
+      rootNS match {
+        case None => c
+        case Some(RefQName(_, root, ns)) => c.withDistinguishedRootNode(root, 
ns.toStringOrNullIfNoNS)
 
 Review comment:
   The right thing is for compileSource to take an optional argument which is 
the root spec. If unspecified you get "infer from schema" behavior. 
   
   So yes I suppose we should ditch withDistinguishedRootNode entirely. It's 
purpose is actually to make converting setter-based code more straightforward. 
   
   val compiler = Compiler()
   compiler.setDistinguishedRootNode(...)
   
   just becomes
   
   var compiler = Compiler()
   compiler = compiler.withDistinguishedRootNode(...)
   
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to