From 7d014933cea167043b0347e8d49f0fa36762c45a Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Thu, 22 Aug 2019 12:15:44 -0400 Subject: command: Allow count parameter of DECL_ENUMERATION_RANGE() to be an expression Signed-off-by: Kevin O'Connor --- scripts/buildcommands.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'scripts/buildcommands.py') diff --git a/scripts/buildcommands.py b/scripts/buildcommands.py index 87bc297d..956554b2 100644 --- a/scripts/buildcommands.py +++ b/scripts/buildcommands.py @@ -86,12 +86,9 @@ class HandleEnumerations: enum, name, value = req.split()[1:] self.add_enumeration(enum, name, decode_integer(value)) def decl_enumeration_range(self, req): - enum, name, count, value = req.split()[1:] - try: - count = int(count, 0) - except ValueError as e: - error("Invalid enumeration count in '%s'" % (req,)) - self.add_enumeration(enum, name, (decode_integer(value), count)) + enum, name, value, count = req.split()[1:] + vc = (decode_integer(value), decode_integer(count)) + self.add_enumeration(enum, name, vc) def decl_static_str(self, req): msg = req.split(None, 1)[1] if msg not in self.static_strings: -- cgit v1.2.3-70-g09d2