You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
strings are implicitly concatenated to form a single string literal.
2834
-
%, and so are adjacent multiline strings, but the two forms may not be mixed.
2832
+
Adjacent strings are implicitly concatenated to form a single string literal.
2835
2833
2836
2834
2837
2835
\commentary{Here is an example}
@@ -2851,7 +2849,7 @@ \subsection{Strings}
2851
2849
\end{dartCode}
2852
2850
2853
2851
\rationale{ which this prints 'A simple sum: 2 + 2 = 22' rather than 'A simple sum: 2 + 2 = 4'.
2854
-
However, the use the concatenation operation is still discouraged for efficiency reasons. Instead, the recommended Dart idiom is to use string interpolation.
2852
+
However, the use of the concatenation operation is still discouraged for efficiency reasons. Instead, the recommended Dart idiom is to use string interpolation.
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 the whitespace characters defined by the production {\em WHITESPACE} \ref{lexicalRules}), possibly prefixed by $\backslash$, then that line is ignored, including the new line at its end.
2905
-
2902
+
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 the whitespace characters defined by the production {\em WHITESPACE} \ref{lexicalRules}), possibly prefixed by $\backslash$, then that line is ignored, including the line break at its end.
2906
2903
2907
-
\rationale{
2908
-
The idea is to ignore whitespace, where whitespace is defined as tabs, spaces and newlines. These can be represented directly, but since for most characters prefixing by backslash is an identity, we allow those forms as well.
2909
-
}
2904
+
\rationale{
2905
+
The idea is to ignore a whitespace-only first line of a multiline string, where whitespace is defined as tabs, spaces and the final line break. These can be represented directly, but since for most characters prefixing by backslash is an identity in a non-raw string, we allow those forms as well.
2906
+
}
2910
2907
2911
2908
% could be clearer. Is the first line in """\t
2912
2909
% """ ignored not. It depends if we mean whitespace before escapes are interpreted,
@@ -2915,7 +2912,7 @@ \subsection{Strings}
2915
2912
\LMHash{}
2916
2913
Strings support escape sequences for special characters. The escapes are:
2917
2914
\begin{itemize}
2918
-
\item$\backslash$n for newline, equivalent to $\backslash$x0A.
2915
+
\item$\backslash$n for newline, equivalent to $\backslash$x0A.
2919
2916
\item$\backslash$r for carriage return, equivalent to $\backslash$x0D.
2920
2917
\item$\backslash$f for form feed, equivalent to $\backslash$x0C.
2921
2918
\item$\backslash$b for backspace, equivalent to $\backslash$x08.
@@ -2933,6 +2930,10 @@ \subsection{Strings}
2933
2930
\LMHash{}
2934
2931
Any string may be prefixed with the character `r', indicating that it is a {\em raw string}, in which case no escapes or interpolations are recognized.
2935
2932
2933
+
\LMHash{}
2934
+
Line breaks in a multiline string are represented by the {\em NEWLINE} production.
2935
+
A line break introduces a single newline character into the string value.
2936
+
2936
2937
\LMHash{}
2937
2938
It is a compile-time error if a non-raw string literal contains a character sequence of the form $\backslash$x that is not followed by a sequence of two hexadecimal digits. It is a compile-time error if a non-raw string literal contains a character sequence of the form $\backslash$u that is not followed by either a sequence of four hexadecimal digits, or by curly brace delimited sequence of hexadecimal digits.
0 commit comments