@@ -9612,7 +9612,8 @@ \subsection{Strings}
9612
9612
\end{grammar}
9613
9613
9614
9614
\LMHash{}%
9615
- A string can be a sequence of single line strings and multiline strings.
9615
+ A string literal can be a sequence of single line strings
9616
+ and multiline strings.
9616
9617
9617
9618
\begin{grammar}
9618
9619
<singleLineString> ::= <RAW\_SINGLE\_LINE\_STRING>
@@ -9664,24 +9665,25 @@ \subsection{Strings}
9664
9665
\end{grammar}
9665
9666
9666
9667
\LMHash{}%
9667
- A single line string is delimited by
9668
+ A single line string literal is delimited by
9668
9669
either matching single quotes or matching double quotes.
9669
9670
9670
9671
\commentary{%
9671
- Hence, \code{'abc'} and \code{"abc"} are both legal strings ,
9672
+ Hence, \code{'abc'} and \code{"abc"} are both legal string literals ,
9672
9673
as are \code{'He said "To be or not to be" did he not?'} and
9673
9674
\code{"He said 'To be or not to be' didn't he?"}.
9674
- However, \code{"This'} is not a valid string, nor is \code{'this"}.%
9675
+ However, \code{"This'} is not a valid string literal , nor is \code{'this"}.%
9675
9676
}
9676
9677
9677
9678
\commentary{%
9678
- The grammar ensures that a single line string cannot span more than
9679
+ The grammar ensures that a single line string literal cannot span more than
9679
9680
one line of source code,
9680
9681
unless it includes an interpolated expression that spans multiple lines.%
9681
9682
}
9682
9683
9683
9684
\LMHash{}%
9684
- Adjacent strings are implicitly concatenated to form a single string literal.
9685
+ Adjacent string literals are implicitly concatenated
9686
+ to form a single string literal.
9685
9687
9686
9688
\commentary{%
9687
9689
Here is an example:%
@@ -9694,7 +9696,7 @@ \subsection{Strings}
9694
9696
\rationale{%
9695
9697
Dart also supports the operator + for string concatenation.
9696
9698
9697
- The + operator on Strings requires a String argument.
9699
+ The + operator on \code{String}s requires a \code{ String} argument.
9698
9700
It does not coerce its argument into a string.
9699
9701
This helps avoid puzzlers such as%
9700
9702
}
@@ -9719,17 +9721,17 @@ \subsection{Strings}
9719
9721
String interpolation works well for most cases.
9720
9722
The main situation where it is not fully satisfactory
9721
9723
is for string literals that are too large to fit on a line.
9722
- Multiline strings can be useful, but in some cases,
9724
+ Multiline string literals can be useful, but in some cases,
9723
9725
we want to visually align the code.
9724
9726
This can be expressed by writing
9725
- smaller strings separated by whitespace, as shown here:%
9727
+ smaller string literals separated by whitespace, as shown here:%
9726
9728
}
9727
9729
9728
9730
\begin{dartCode}
9729
9731
'Imagine this is a very long string that does not fit on a line. What shall we do? '
9730
9732
'Oh what shall we do? '
9731
9733
'We shall split it into pieces '
9732
- 'like so'.
9734
+ 'like so.'
9733
9735
\end{dartCode}
9734
9736
9735
9737
\LMHash{}%
@@ -9814,22 +9816,23 @@ \subsection{Strings}
9814
9816
\end{grammar}
9815
9817
9816
9818
\LMHash{}%
9817
- Multiline strings are delimited by either
9819
+ Multiline string literals are delimited by either
9818
9820
matching triples of single quotes or
9819
9821
matching triples of double quotes.
9820
- If the first line of a multiline string consists solely of
9822
+ If the first line of a multiline string literal consists solely of
9821
9823
the whitespace characters defined by the production \synt{WHITESPACE}
9822
9824
(\ref{lexicalRules}),
9823
9825
possibly prefixed by \syntax{`\\'},
9824
9826
then that line is ignored,
9825
9827
including the line break at its end.
9826
9828
9827
9829
\rationale{%
9828
- The idea is to ignore a whitespace-only first line of a multiline string,
9830
+ The idea is to ignore a whitespace-only first line of
9831
+ a multiline string literal,
9829
9832
where whitespace is defined as tabs, spaces and the final line break.
9830
9833
These can be represented directly,
9831
9834
but since for most characters prefixing by backslash is
9832
- an identity in a non-raw string,
9835
+ an identity in a non-raw string literal ,
9833
9836
we allow those forms as well.%
9834
9837
}
9835
9838
@@ -9847,7 +9850,7 @@ \subsection{Strings}
9847
9850
}
9848
9851
9849
9852
\LMHash{}%
9850
- Strings support escape sequences for special characters.
9853
+ String literals support escape sequences for special characters.
9851
9854
The escapes are:
9852
9855
9853
9856
\begin{itemize}
@@ -9894,12 +9897,12 @@ \subsection{Strings}
9894
9897
\end{itemize}
9895
9898
9896
9899
\LMHash{}%
9897
- Any string may be prefixed with the character \lit{r},
9898
- indicating that it is a \Index{raw string},
9900
+ Any string literal may be prefixed with the character \lit{r},
9901
+ indicating that it is a \Index{raw string literal },
9899
9902
in which case no escapes or interpolations are recognized.
9900
9903
9901
9904
\LMHash{}%
9902
- Line breaks in a multiline string are represented by
9905
+ Line breaks in a multiline string literal are represented by
9903
9906
the \synt{LINE\_BREAK} production.
9904
9907
A line break introduces a single newline character (U+000A)
9905
9908
into the string value.
@@ -9948,12 +9951,12 @@ \subsubsection{String Interpolation}
9948
9951
9949
9952
\commentary{%
9950
9953
The reader will note that the expression inside the interpolation
9951
- could itself include strings ,
9954
+ could itself include string literals ,
9952
9955
which could again be interpolated recursively.%
9953
9956
}
9954
9957
9955
9958
\LMHash{}%
9956
- An unescaped \lit{\$} character in a string signifies
9959
+ An unescaped \lit{\$} character in a string literal signifies
9957
9960
the beginning of an interpolated expression.
9958
9961
The \lit{\$} sign may be followed by either:
9959
9962
0 commit comments