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

Fix symbolic pass for printing ListItem #2620

Merged
merged 7 commits into from
Mar 23, 2024

Conversation

kmr-srbh
Copy link
Contributor

fixes #2613

from lpython import i32

A: list[i32] = [1, 2, 4, 5]
print(A[0], A[1], A[2], "...", A[-3], A[-2], A[-1])
(base) saurabh-kumar@Awadh:~/Projects/System/lpython$ ./src/bin/lpython ./examples/example.py
1 2 4 ... 2 4 5

Copy link
Collaborator

@Shaikh-Ubaid Shaikh-Ubaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add an integration test for this with print and assert statements.

@Shaikh-Ubaid Shaikh-Ubaid marked this pull request as draft March 23, 2024 13:06
@kmr-srbh kmr-srbh marked this pull request as ready for review March 23, 2024 15:24
Copy link
Collaborator

@Shaikh-Ubaid Shaikh-Ubaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this! I shared few comments. It looks good overall.

src/libasr/pass/replace_symbolic.cpp Outdated Show resolved Hide resolved
integration_tests/test_list_item_mixed_print.py Outdated Show resolved Hide resolved
@Shaikh-Ubaid Shaikh-Ubaid marked this pull request as draft March 23, 2024 15:32
kmr-srbh and others added 2 commits March 23, 2024 21:10
Co-authored-by: Shaikh Ubaid <shaikhubaid769@gmail.com>
Co-authored-by: Shaikh Ubaid <shaikhubaid769@gmail.com>
@kmr-srbh kmr-srbh marked this pull request as ready for review March 23, 2024 16:03
Copy link
Collaborator

@Shaikh-Ubaid Shaikh-Ubaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good! Thanks! Great work!

@Shaikh-Ubaid Shaikh-Ubaid merged commit 4dbbf93 into lcompilers:main Mar 23, 2024
13 checks passed
@kmr-srbh kmr-srbh deleted the fix-list-item-symbolic-pass branch March 26, 2024 18:17
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.

Negative indices in list fails
2 participants