Closed tanay-man closed 2 months ago
@tanay-man I think this should also fix #1475. Could you please verify it?
Please make the changes to handle subscripts also.
@tanay-man I think this should also fix #1475. Could you please verify it?
It does fix the issue.
It does fix the issue.
Great! Please link the PR to close that too.
Please make the changes to handle subscripts also.
The same solution doesn't work for the subscripts. It produces asr but it cannot be converted to llvm further. I'll have to look into it for further analysis.
Please make the changes to handle subscripts also.
The same solution doesn't work for the subscripts. It produces asr but it cannot be converted to llvm further. I'll have to look into it for further analysis.
I tested the changes locally. They work for both subscripts of strings and lists.
from lpython import i32
i: i32
my_list: list[i32] = [1, 2, 3, 4, 5]
for i in my_list[1:3]:
print(i)
(base) saurabh-kumar@Awadh:~/Projects/System/lpython$ ./src/bin/lpython ./examples/example.py
2
3
c: str
s: str = "abcde"
for c in s[1:3]:
print(c)
(base) saurabh-kumar@Awadh:~/Projects/System/lpython$ ./src/bin/lpython ./examples/example.py
b
c
Issue #2608 , Issue #1475.
@tanay-man you can change this to 'fixes #2608, fixes #1475' to link this PR to the issues. :+1:
fixes #2608 , fixes #1475.