-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
meson format
incorrectly converts triple quotes to single quotes when there are unescaped single quotes in the string
#13564
Labels
Comments
I may try to look at this later, but I ran into it when I was trying to write a |
dcbaker
added a commit
to dcbaker/meson
that referenced
this issue
Aug 19, 2024
The following is valid meson: ```meson a = '''This string can't be simplified''' ``` which cannot be simplified because of the `'` in it, as ```meson a = 'This string can't be simplified' ``` Is invalid. Potentially we could convert that with escapes, but it seems reasonable to me to leave this, since it may be desirable to not have lots of escapes in a string. `'''I can't believe it's her's!'''` is much more readable than `'I can\'t believe it\'s her\'s!'`, for example. Closes: mesonbuild#13564
dcbaker
added a commit
to dcbaker/meson
that referenced
this issue
Aug 20, 2024
The following is valid meson: ```meson a = '''This string can't be simplified''' ``` which cannot be simplified because of the `'` in it, as ```meson a = 'This string can't be simplified' ``` Is invalid. Potentially we could convert that with escapes, but it seems reasonable to me to leave this, since it may be desirable to not have lots of escapes in a string. `'''I can't believe it's her's!'''` is much more readable than `'I can\'t believe it\'s her\'s!'`, for example. Closes: mesonbuild#13564
eli-schwartz
pushed a commit
that referenced
this issue
Sep 16, 2024
The following is valid meson: ```meson a = '''This string can't be simplified''' ``` which cannot be simplified because of the `'` in it, as ```meson a = 'This string can't be simplified' ``` Is invalid. Potentially we could convert that with escapes, but it seems reasonable to me to leave this, since it may be desirable to not have lots of escapes in a string. `'''I can't believe it's her's!'''` is much more readable than `'I can\'t believe it\'s her\'s!'`, for example. Closes: #13564 (cherry picked from commit df70680)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To Reproduce
Run
meson format
on the following snippet:This reproduces with both the 1.5.0 release, and with meson master (cdf646f)
Expected behavior
meson format
should either 1) keep the triple quotes, or 2) escape the'
inside the string as\'
The text was updated successfully, but these errors were encountered: