-
Notifications
You must be signed in to change notification settings - Fork 123
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
Add Update here-string syntax RFC #343
base: master
Are you sure you want to change the base?
Conversation
The Language-WG met to discuss this on 8/10/23 and had the following observations and conclusions:
Specifics:
we look forward to your updates |
@JamesWTruher (and WG) thanks for the review. I have a few questions. First, regarding:
This is different from the current
What about empty lines like line2 here:
Should they also have that whitespace, or can they be left completely empty? Editors like VS code will not indent empty lines and some tools will auto remove trailing whitespace so I think the UX will suffer if we make the whitespace mandatory for empty lines. |
sorry, I've updated that - it should be the last non-whitespace token, any spaces which follow are ignored. As an aside, the current error message is curious, yes? > @" a
ParserError:
Line |
1 | @" a
| ~
| No characters are allowed after a here-string header but before the end of the line. strictly speaking " " is a character. In any event, we're not interested in introducing any differences with the starting token
wrt to empty strings - we didn't discuss it, but it's a good question. I expect the scanner should just ignore empty lines. We were more worried about the behavior of: $a = @"
line 1
line 2
line 3
"@ c# emits a syntax error in this case, and we didn't think that we should try to be different here. I'm not sure what c# does in the empty line case, we should probably follow that lead unless there's a good reason for us to be different. |
@JamesWTruher I've updated the RFC to remove the single line here-string references and to use the multiple quotes syntax rather than the |
No description provided.