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