From cca06bafc51ac76b2c85a9b22bf7c493b5604a89 Mon Sep 17 00:00:00 2001 From: NikolajDanger Date: Mon, 20 Jun 2022 14:09:39 +0200 Subject: [PATCH] :sparkles: --- centvrion/ast_nodes.py | 2 ++ {tests => examples}/guessing.cent | 0 2 files changed, 2 insertions(+) rename {tests => examples}/guessing.cent (100%) diff --git a/centvrion/ast_nodes.py b/centvrion/ast_nodes.py index 1c80e4a..3613566 100644 --- a/centvrion/ast_nodes.py +++ b/centvrion/ast_nodes.py @@ -47,6 +47,8 @@ def single_num_to_int(i, m): def num_to_int(n, m): chars = re.findall(r"[IVXLCDM]_*", n) + if ''.join(chars) != n: + raise Exception("Invalid numeral", n) nums = [single_num_to_int(i, m) for i in chars] new_nums = nums.copy() for x, num in enumerate(nums[:-3]): diff --git a/tests/guessing.cent b/examples/guessing.cent similarity index 100% rename from tests/guessing.cent rename to examples/guessing.cent