From 204869bfedbcaec09465580654367da50ba7c5de Mon Sep 17 00:00:00 2001 From: Aki Van Ness Date: Fri, 29 Jul 2022 10:34:36 -0400 Subject: [PATCH] sby: core: config: updated the error messages for the new setctions to make them more descriptive --- sbysrc/sby_core.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sbysrc/sby_core.py b/sbysrc/sby_core.py index 7651f09..d5de81f 100644 --- a/sbysrc/sby_core.py +++ b/sbysrc/sby_core.py @@ -393,7 +393,7 @@ class SbyConfig: if mode == "setup": kvp = line.split() if kvp[0] not in ("cutpoint", "disable", "enable", "assume", "define"): - self.error(f"sby file syntax error: {line}") + self.error(f"sby file syntax error: found '{kvp[0]}' but expected one of 'cutpoint', 'disable', 'enable', 'assume', or 'define'") else: stmt = kvp[0] if stmt == 'define': @@ -401,9 +401,9 @@ class SbyConfig: self.setup['define'] = {} if len(kvp[1:]) < 2: - self.error(f"sby file syntax error: {line}") + self.error(f"sby file syntax error: 'define' statement takes 2 arguments, got {len(kvp[1:])}") elif kvp[1][0] != '@': - self.error(f"sby file syntax error: {line}") + self.error(f"sby file syntax error: 'define' statement expects an '@' prefixed name as the first parameter, got {line}") else: name = kvp[1][1:] self.setup['define'][name] = kvp[2:] @@ -427,9 +427,9 @@ class SbyConfig: stmt = kvp[0] if stmt == 'setsel': if len(kvp[1:]) < 2: - self.error(f"sby file syntax error: {line}") + self.error(f"sby file syntax error: 'setsel' statement takes 2 arguments, got {len(kvp[1:])}") elif kvp[1][0] != '@': - self.error(f"sby file syntax error: {line}") + self.error(f"sby file syntax error: 'setsel' statement expects an '@' prefixed name as the first parameter, got {line}") else: name = kvp[1][1:] self.stage[key][stmt] = {