You've already forked pokecrystal-board
mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2025-04-09 05:44:44 -07:00
convert a macro_translator assert in preprocessor
AssertionError -> PreprocessorException
This commit is contained in:
@@ -534,9 +534,15 @@ def macro_translator(macro, token, line):
|
|||||||
else:
|
else:
|
||||||
allowed_lengths = [allowed_length]
|
allowed_lengths = [allowed_length]
|
||||||
|
|
||||||
assert len(params) in allowed_lengths, \
|
if len(params) not in allowed_lengths:
|
||||||
"mismatched number of parameters on this line: " + \
|
raise PreprocessorException(
|
||||||
original_line
|
"mismatched number of parameters ({count}, instead of any of {allowed}) on this line: {line}"
|
||||||
|
.format(
|
||||||
|
count=len(params),
|
||||||
|
allowed=allowed_lengths,
|
||||||
|
line=original_line,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
# --- end of ridiculously long sanity check ---
|
# --- end of ridiculously long sanity check ---
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user