Esempio n. 1
0
 def task(self, items, meta):
     d = {"noninput_decls": []}
     for item in items:
         if isinstance(item, dict):
             for k, v in item.items():
                 if k == "noninput_decl":
                     d["noninput_decls"].append(v)
                 elif k in d:
                     raise Err.MultipleDefinitions(
                         sp(self.filename, meta),
                         "redundant sections in task")
                 else:
                     d[k] = v
         else:
             assert isinstance(item, str)
             assert "name" not in d
             d["name"] = item.value
     _check_keyword(sp(self.filename, meta), d["name"])
     return D.Task(
         sp(self.filename, meta),
         d["name"],
         d.get("inputs", None),
         d["noninput_decls"],
         d["command"],
         d.get("outputs", []),
         d.get("parameter_meta", {}),
         d.get("runtime", {}),
         d.get("meta", {}),
     )
Esempio n. 2
0
 def task(self, items, meta):
     d = {}
     for item in items:
         if isinstance(item, dict):
             for k, v in item.items():
                 if k in d:
                     raise Err.MultipleDefinitions(
                         sp(self.filename, meta), "redundant sections in task"
                     )
                 d[k] = v
         else:
             assert isinstance(item, str)
             assert "name" not in d
             d["name"] = item.value
     return D.Task(
         sp(self.filename, meta),
         d["name"],
         d.get("inputs", []),
         d.get("decls", []),
         d["command"],
         d.get("outputs", []),
         d.get("parameter_meta", {}),
         d.get("runtime", {}),
         d.get("meta", {}),
     )