From 17b46862606629fb8697dd6c722732ba3f87911f Mon Sep 17 00:00:00 2001 From: David Mak Date: Tue, 5 Sep 2023 09:38:50 +0800 Subject: [PATCH] standalone: Adapt loop example to output loop variable --- nac3standalone/demo/src/loop.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/nac3standalone/demo/src/loop.py b/nac3standalone/demo/src/loop.py index 41293652..8f383fea 100644 --- a/nac3standalone/demo/src/loop.py +++ b/nac3standalone/demo/src/loop.py @@ -1,9 +1,12 @@ +# For Loop using an increasing range() expression as its iterable + @extern def output_int32(x: int32): ... def run() -> int32: - for _ in range(10): - output_int32(_) - _ = 0 + i = 0 + for i in range(10): + output_int32(i) + output_int32(i) return 0