mirror of
https://github.com/littlefs-project/littlefs.git
synced 2025-12-01 12:20:02 +00:00
scripts: codemap[d3].py: Added -e/--error-on-recursion
Might as well, since we already need to find this to calculate stack info. I've been considering adding -z/--depth to these scripts as well, but that would require quite a bit more work. It's probably not worth the added complexity/headache. Depth termination would need to happen on the javascript side, and we'd still need cycle detection anyways. But an error code is easy to add.
This commit is contained in:
@ -1247,6 +1247,10 @@ def main_(f, paths, *,
|
||||
line = canvas.draw(row)
|
||||
f.writeln(line)
|
||||
|
||||
if (args.get('error_on_recursion')
|
||||
and mt.isinf(totals.get('stack', 0))):
|
||||
sys.exit(2)
|
||||
|
||||
|
||||
def main(paths, *,
|
||||
height=None,
|
||||
@ -1496,6 +1500,10 @@ if __name__ == "__main__":
|
||||
'--no-label',
|
||||
action='store_true',
|
||||
help="Don't render any labels.")
|
||||
parser.add_argument(
|
||||
'-e', '--error-on-recursion',
|
||||
action='store_true',
|
||||
help="Error if any functions are recursive.")
|
||||
parser.add_argument(
|
||||
'--code-path',
|
||||
type=lambda x: x.split(),
|
||||
|
||||
Reference in New Issue
Block a user