I am trying to fix #157, and I found this bug there
This happens when there are double quotes, line breaks, whitespace, etc. at the beginning and end of a string.
Strings are trimmed of leading and trailing whitespace, etc.
Reproducible code
>>> a = " hi "
>>> a
hi
# The following two are reproducible once #157 is fixed
>>> b = "\" hi \""
>>> b
hi
>>> c = "\n hi \n"
>>> c
hi # Personally, I feel that this is a different bug than this itself
Expected behavior
>>> a = " hi "
>>> a
' hi ' # For convenience, `'`s are used to express this.
Additional context
Properly compiled when surrounded by characters
>>> c = "a \" \n b"
>>> c
a "
b
After a little debugging, I found the following code to be converted.
Describe the bug
I am trying to fix #157, and I found this bug there
This happens when there are double quotes, line breaks, whitespace, etc. at the beginning and end of a string.
Strings are trimmed of leading and trailing whitespace, etc.
Reproducible code
Expected behavior
Additional context
Properly compiled when surrounded by characters
After a little debugging, I found the following code to be converted.
https://github.com/erg-lang/erg/blob/19428a417f0ec0ec6f26b3aaefe08fa7d9c7671a/compiler/erg_parser/token.rs#L351-L359