← 输入框|github.com|刷新
Skip to content

Escape sequences should be treated as single characters. #1695

Open

Description

@faze-geek

Realized this while working on #1589
Escape sequences are treated as 2 characters of a string in Lpython unlike in python. Although it is a small block and the if condition can be modified accordingly for the pull request, it should be corrected.

A minimal example is this -

def f():
    print(len("\t"))        # Single character for tab space
    print(len("\n"))        # Single character for new line
    print(len("\0"))        # Single character for null
    
f()

(lp) C:\Users\kunni\lpython>python try.py
1
1
1

(lp) C:\Users\kunni\lpython>src\bin\lpython try.py
2
2
2


Activity

  1. harshitmathur2000 commented on Apr 11, 2023

    @harshitmathur2000
    Contributor

    @certik I want to work on this issue. I am new, so, can you guide which file to look for to handle this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions