Skip to content

Commit

Permalink
Merge 592a21b into caed147
Browse files Browse the repository at this point in the history
  • Loading branch information
mlin committed Mar 19, 2019
2 parents caed147 + 592a21b commit 25d26d3
Show file tree
Hide file tree
Showing 13 changed files with 1,057 additions and 312 deletions.
14 changes: 3 additions & 11 deletions WDL/CLI.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,18 +165,10 @@ def descend(dobj=None, first_descent=first_descent):
descend(decl)
# call
elif isinstance(obj, WDL.Call):
if obj.name != obj.callee_id.name:
print(
"{}call {} as {}".format(
s, ".".join(obj.callee_id.namespace + [obj.callee_id.name]), obj.name
),
file=file,
)
if obj.name != obj.callee_id[-1]:
print("{}call {} as {}".format(s, ".".join(obj.callee_id), obj.name), file=file)
else:
print(
"{}call {}".format(s, ".".join(obj.callee_id.namespace + [obj.callee_id.name])),
file=file,
)
print("{}call {}".format(s, ".".join(obj.callee_id)), file=file)
# scatter
elif isinstance(obj, WDL.Scatter):
print("{}scatter {}".format(s, obj.variable), file=file)
Expand Down
15 changes: 9 additions & 6 deletions WDL/Error.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ def __init__(self, node: Union[SourceNode, SourcePosition], message: str) -> Non
super().__init__(node, message)


class NoSuchTask(ValidationError):
def __init__(self, node: SourceNode, name: str) -> None:
super().__init__(node, "No such task/workflow: " + name)


class NoSuchFunction(ValidationError):
def __init__(self, node: SourceNode, name: str) -> None:
super().__init__(node, "No such function: " + name)
Expand All @@ -123,9 +128,9 @@ def __init__(self, node: SourceNode) -> None:
super().__init__(node, "Not an array")


class NotAPair(ValidationError):
def __init__(self, node: SourceNode) -> None:
super().__init__(node, "Not a pair (taking left or right)")
class NoSuchMember(ValidationError):
def __init__(self, node: SourceNode, member: str) -> None:
super().__init__(node, "No such member '{}'".format(member))


class StaticTypeMismatch(ValidationError):
Expand Down Expand Up @@ -159,9 +164,7 @@ class UnknownIdentifier(ValidationError):
def __init__(self, node: SourceNode) -> None:
# avoiding circular dep:
# assert isinstance(node, WDL.Expr.Ident)
namespace: List[str] = getattr(node, "namespace")
name: str = getattr(node, "name")
super().__init__(node, "Unknown identifier " + ".".join(namespace + [name]))
super().__init__(node, "Unknown identifier " + ".".join(getattr(node, "_ident")))


class NoSuchInput(ValidationError):
Expand Down
Loading

0 comments on commit 25d26d3

Please sign in to comment.