@@ -9533,7 +9533,8 @@ \subsection{Strings}
9533
9533
\end{grammar}
9534
9534
9535
9535
\LMHash{}%
9536
- A string can be a sequence of single line strings and multiline strings.
9536
+ A string literal can be a sequence of single line strings
9537
+ and multiline strings.
9537
9538
9538
9539
\begin{grammar}
9539
9540
<singleLineString> ::= <RAW\_SINGLE\_LINE\_STRING>
@@ -9585,24 +9586,25 @@ \subsection{Strings}
9585
9586
\end{grammar}
9586
9587
9587
9588
\LMHash{}%
9588
- A single line string is delimited by
9589
+ A single line string literal is delimited by
9589
9590
either matching single quotes or matching double quotes.
9590
9591
9591
9592
\commentary{%
9592
- Hence, \code{'abc'} and \code{"abc"} are both legal strings ,
9593
+ Hence, \code{'abc'} and \code{"abc"} are both legal string literals ,
9593
9594
as are \code{'He said "To be or not to be" did he not?'} and
9594
9595
\code{"He said 'To be or not to be' didn't he?"}.
9595
- However, \code{"This'} is not a valid string, nor is \code{'this"}.%
9596
+ However, \code{"This'} is not a valid string literal , nor is \code{'this"}.%
9596
9597
}
9597
9598
9598
9599
\commentary{%
9599
- The grammar ensures that a single line string cannot span more than
9600
+ The grammar ensures that a single line string literal cannot span more than
9600
9601
one line of source code,
9601
9602
unless it includes an interpolated expression that spans multiple lines.%
9602
9603
}
9603
9604
9604
9605
\LMHash{}%
9605
- Adjacent strings are implicitly concatenated to form a single string literal.
9606
+ Adjacent string literals are implicitly concatenated
9607
+ to form a single string literal.
9606
9608
9607
9609
\commentary{%
9608
9610
Here is an example:%
@@ -9615,7 +9617,7 @@ \subsection{Strings}
9615
9617
\rationale{%
9616
9618
Dart also supports the operator + for string concatenation.
9617
9619
9618
- The + operator on Strings requires a String argument.
9620
+ The + operator on \code{String}s requires a \code{ String} argument.
9619
9621
It does not coerce its argument into a string.
9620
9622
This helps avoid puzzlers such as%
9621
9623
}
@@ -9640,17 +9642,17 @@ \subsection{Strings}
9640
9642
String interpolation works well for most cases.
9641
9643
The main situation where it is not fully satisfactory
9642
9644
is for string literals that are too large to fit on a line.
9643
- Multiline strings can be useful, but in some cases,
9645
+ Multiline string literals can be useful, but in some cases,
9644
9646
we want to visually align the code.
9645
9647
This can be expressed by writing
9646
- smaller strings separated by whitespace, as shown here:%
9648
+ smaller string literals separated by whitespace, as shown here:%
9647
9649
}
9648
9650
9649
9651
\begin{dartCode}
9650
9652
'Imagine this is a very long string that does not fit on a line. What shall we do? '
9651
9653
'Oh what shall we do? '
9652
9654
'We shall split it into pieces '
9653
- 'like so'.
9655
+ 'like so.'
9654
9656
\end{dartCode}
9655
9657
9656
9658
\LMHash{}%
@@ -9735,22 +9737,23 @@ \subsection{Strings}
9735
9737
\end{grammar}
9736
9738
9737
9739
\LMHash{}%
9738
- Multiline strings are delimited by either
9740
+ Multiline string literals are delimited by either
9739
9741
matching triples of single quotes or
9740
9742
matching triples of double quotes.
9741
- If the first line of a multiline string consists solely of
9743
+ If the first line of a multiline string literal consists solely of
9742
9744
the whitespace characters defined by the production \synt{WHITESPACE}
9743
9745
(\ref{lexicalRules}),
9744
9746
possibly prefixed by \syntax{`\\'},
9745
9747
then that line is ignored,
9746
9748
including the line break at its end.
9747
9749
9748
9750
\rationale{%
9749
- The idea is to ignore a whitespace-only first line of a multiline string,
9751
+ The idea is to ignore a whitespace-only first line of
9752
+ a multiline string literal,
9750
9753
where whitespace is defined as tabs, spaces and the final line break.
9751
9754
These can be represented directly,
9752
9755
but since for most characters prefixing by backslash is
9753
- an identity in a non-raw string,
9756
+ an identity in a non-raw string literal ,
9754
9757
we allow those forms as well.%
9755
9758
}
9756
9759
@@ -9768,7 +9771,7 @@ \subsection{Strings}
9768
9771
}
9769
9772
9770
9773
\LMHash{}%
9771
- Strings support escape sequences for special characters.
9774
+ String literals support escape sequences for special characters.
9772
9775
The escapes are:
9773
9776
\begin{itemize}
9774
9777
\item
@@ -9814,12 +9817,12 @@ \subsection{Strings}
9814
9817
\end{itemize}
9815
9818
9816
9819
\LMHash{}%
9817
- Any string may be prefixed with the character \lit{r},
9818
- indicating that it is a \Index{raw string},
9820
+ Any string literal may be prefixed with the character \lit{r},
9821
+ indicating that it is a \Index{raw string literal },
9819
9822
in which case no escapes or interpolations are recognized.
9820
9823
9821
9824
\LMHash{}%
9822
- Line breaks in a multiline string are represented by
9825
+ Line breaks in a multiline string literal are represented by
9823
9826
the \synt{LINE\_BREAK} production.
9824
9827
A line break introduces a single newline character (U+000A)
9825
9828
into the string value.
@@ -9868,12 +9871,12 @@ \subsubsection{String Interpolation}
9868
9871
9869
9872
\commentary{%
9870
9873
The reader will note that the expression inside the interpolation
9871
- could itself include strings ,
9874
+ could itself include string literals ,
9872
9875
which could again be interpolated recursively.%
9873
9876
}
9874
9877
9875
9878
\LMHash{}%
9876
- An unescaped \lit{\$} character in a string signifies
9879
+ An unescaped \lit{\$} character in a string literal signifies
9877
9880
the beginning of an interpolated expression.
9878
9881
The \lit{\$} sign may be followed by either:
9879
9882
\begin{itemize}
0 commit comments