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

ASR: Keep strings unescaped in AST, ASR #1762

Merged
merged 8 commits into from
May 7, 2023

Conversation

Shaikh-Ubaid
Copy link
Collaborator

fixes #1759.

@Shaikh-Ubaid Shaikh-Ubaid marked this pull request as draft May 6, 2023 07:59
@Shaikh-Ubaid Shaikh-Ubaid force-pushed the asr_unescaped_strings branch 2 times, most recently from c2a45f1 to 17fa37d Compare May 6, 2023 09:17
@Shaikh-Ubaid Shaikh-Ubaid force-pushed the asr_unescaped_strings branch 3 times, most recently from 8c4f55e to 30d0f8a Compare May 6, 2023 10:26
@Shaikh-Ubaid
Copy link
Collaborator Author

Example:

$ cat examples/expr2.py
def main0():
    print(r"\n\t\r\
            \n\t\
          hi")

    print('I said \'Wow\' ')
    print("I said \"hi\" ")
    print("I said \\\"hi\" ")
    print("abc \\ ")
    print("abc \\\ wow")
    print('I said \'\\\'hi\\''hey\' ')
    print('  ''hey\' ')
    print(" " " hey\" ")

main0()
$ python examples/expr2.py 
\n\t\r\
            \n\t\
          hi
I said 'Wow' 
I said "hi" 
I said \"hi" 
abc \ 
abc \\ wow
I said '\'hi\hey' 
  hey' 
  hey" 
$ lpython examples/expr2.py
\n\t\r\
            \n\t\
          hi
I said 'Wow' 
I said "hi" 
I said \"hi" 
abc \ 
abc \\ wow
I said '\'hi\hey' 
  hey' 
  hey" 

@Shaikh-Ubaid Shaikh-Ubaid marked this pull request as ready for review May 6, 2023 10:35
@Shaikh-Ubaid Shaikh-Ubaid requested a review from certik May 6, 2023 10:35
Copy link
Contributor

@certik certik 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 fixing this!

@Shaikh-Ubaid Shaikh-Ubaid merged commit bf59fb4 into lcompilers:main May 7, 2023
@Shaikh-Ubaid Shaikh-Ubaid deleted the asr_unescaped_strings branch May 7, 2023 02:19
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.

ASR must keep strings unescaped
2 participants