Issue #748: Fix arithmetic for loops in bash mode#760
Issue #748: Fix arithmetic for loops in bash mode#760bhumikamittal7 wants to merge 6 commits intobinpash:mainfrom
Conversation
|
Thanks for the change, it looks good but I am not sure why the tests are failing. Could you take a look? |
|
Actually, let me take a look since I see that CI/CD is somewhat broken in general, I will let you know once I fix it. |
|
@bhumikamittal7 I have been refactoring the project a lot but now I have a good sense of what is failing or not with the tests. Could you rebase your commit over main? Also, instead of pushing the script that discovers the new tests that pass, you should instead just push a commit that uncomments all the new tests that pass :) When you do that ping me and I can merge the PR! |
|
@bhumikamittal7 Since your change was just one line of code you could also just remake the change in a new branch forking off main! |
|
Fixes #748 |
|
OS:ubuntu-24.04 |
|
OS:ubuntu-24.04 |
Signed-off-by: bhumikamittal7 <bhumika@amuselabs.com>
|
OS:ubuntu-24.04 |
Signed-off-by: bhumikamittal7 <bhumika@amuselabs.com>
Signed-off-by: bhumikamittal7 <bhumika@amuselabs.com>
|
OS:ubuntu-24.04 |
|
OS:ubuntu-24.04 |
Problem
When running bash scripts with arithmetic for loops through PaSh with
--bashflag, the following error occurred:Root Cause: The AST node type is
ArithForwhich gets lowercased toarithfor, but the preprocessor function was namedpreprocess_node_arith_for(with underscore). The dynamic dispatch inpreprocess_node()couldn't find a matching handler.Fix
Renamed
preprocess_node_arith_for→preprocess_node_arithforto match the naming convention.Testing
Before fix:
./pa.sh --bash script_with_arith_for.sh # KeyError: 'Could not find appropriate preprocessor for arithfor'After fix:
Discovery Results
Ran discovery on all 268 commented-out bash tests:
This fix enables 55 tests to be uncommented immediately and allows 163 more tests to at least compile and run (with minor output differences).
Remark: Script to find passing tests:
scripts/discover_passing_bash_tests.sh