X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=blobdiff_plain;f=rpl.py;h=f826fc4fd5fbe33eed919e8d0f5d80220047b73b;hb=d7eeacf1eab237bbbe67d3e44b90b57fd1445667;hp=8d31efe439c40b91cb80b7a8167f8f41ae31b9df;hpb=cd5e4647e105a10012d687169d49bec0343e274f;p=culture.git diff --git a/rpl.py b/rpl.py index 8d31efe..f826fc4 100755 --- a/rpl.py +++ b/rpl.py @@ -107,13 +107,17 @@ def decompose(seq): o = next_marker(seq, [""], start=k + 1) e = next_marker(seq, ["", ""], start=o) if o is None or e is None: - raise ValueError("Invalid input/output") + raise ValueError( + "Missing input/output markers (should be correct in the prompt)" + ) try: io.append( ([int(x) for x in seq[k + 1 : o]], [int(x) for x in seq[o + 1 : e]]) ) except ValueError: - raise ValueError("Invalid input/output") + raise ValueError( + "Invalid input/output value (should be correct in the prompt)" + ) k = e @@ -123,6 +127,9 @@ def decompose(seq): prog = [] else: prog = seq[k + 1 : e] + else: + raise ValueError("Missing (it should be in the prompt)") + return prog, io