Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flow control: skip dollar commands if parser is skipping blocks #1333

Merged
merged 1 commit into from
Sep 26, 2024

Conversation

dymk
Copy link
Collaborator

@dymk dymk commented Sep 25, 2024

Fixes a bug where dollar commands such as $Alarm/Send=1 would be executed in conditionals even if the conditional was false. Adds a test fixture.

All fixtures pass with ./fixture_tests/run_fixture /dev/cu.usbserial-31320 fixture_tests/fixtures/.

Tested with the following:

(print, start)
o100 repeat [0]
(print, fail repeat 0)
o100 endrepeat

#<count> = 0
o200 repeat [3]
#<count> = [#<count> + 1]
o200 endrepeat
(print, pass, count=%d#<count>)

o300 if [#<count> EQ 3]
(print, pass if)
o300 else
(print, fail if)
o300 endif

which produces the following output:

$LocalFS/Run=repeat.nc
ok
[MSG:INFO: PRINT, start]
[MSG:INFO: PRINT, pass, count=3]
[MSG:INFO: PRINT, pass if]
[MSG:DBG: /repeat.nc job sent]

@dymk dymk merged commit 83787c3 into main Sep 26, 2024
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants