-
Notifications
You must be signed in to change notification settings - Fork 1.7k
What is a line in Dart source? #14073
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
Comments
(1) I am happy to adapt the specification to deal with WIndows. Added Accepted label. |
We should add the '\r\n' option, but leave the lone '\r' as well. |
We don't need to support \r, if you're trying to build Dart on Mac OS 9, you have bigger problems than having to convert line endings. |
If we start accepting non-ASCII line terminators, we should accept any single Unicode line terminator or line-terminating control character as well as the '\r\n' sequence. That would include a single '\r'. |
Upon further consideration, I agree with Ivan and Lasse: we should keep \r. |
Now say that NEWLINE is one of CR, LF or CR+LF, and that all of these contribute a single LF to the string value. Fixes issue #14073 BUG= http://dartbug.com/14073 [email protected], [email protected] Review-Url: https://codereview.chromium.org/2665613003 .
The spec has been updated to say that lines end in line-terminator sequences which are CR+LF, CR or LF, and that a line terminator only supplies one LF character to a multi-line string. |
The specification says: "Multiline strings are delimited by either matching triples of single quotes or matching triples of double quotes. If the first line of a multiline string consists solely of whitespace characters then that line is ignored, including the new line at its end."
This brings up the question of what is a line, and the "new line at its end"?
The specification includes the following grammar productions:
NEWLINE: \n | \r ;
WHITESPACE: ('\t' | ' ' | NEWLINE)+;
I see at least two problems with this definition:
NEWLINE: '\n' | '\r\n' ;
The text was updated successfully, but these errors were encountered: