Skip to content

Commit

Permalink
Handle none text in verilog evaluation:
Browse files Browse the repository at this point in the history
- check is not None before any
  • Loading branch information
LudwigCRON committed Aug 7, 2020
1 parent 09d77f5 commit b28ed16
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion common/verilog.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ def evaluate(text: str):
otherwise a text
"""
# cannot be a verilog number if
if any([c in text for c in "*+/()GHIJKLMNOPQRSTUVXYZghijklmnopqrstuvxyz"]):
if text is None or any(
[c in text for c in "*+/()GHIJKLMNOPQRSTUVXYZghijklmnopqrstuvxyz"]
):
return text
# otherwise try to parse it
PATTERN_NUM = "(?:(?P<size>\d+)?'(?P<base>h|d|b))?(?P<value>[0-9A-Fa-f_]+)"
Expand Down

0 comments on commit b28ed16

Please sign in to comment.