@@ -9639,7 +9639,8 @@ \subsection{Strings}
96399639\end{grammar}
96409640
96419641\LMHash{}%
9642- A string can be a sequence of single line strings and multiline strings.
9642+ A string literal can be a sequence of single line strings
9643+ and multiline strings.
96439644
96449645\begin{grammar}
96459646<singleLineString> ::= <RAW\_SINGLE\_LINE\_STRING>
@@ -9691,24 +9692,25 @@ \subsection{Strings}
96919692\end{grammar}
96929693
96939694\LMHash{}%
9694- A single line string is delimited by
9695+ A single line string literal is delimited by
96959696either matching single quotes or matching double quotes.
96969697
96979698\commentary{%
9698- Hence, \code{'abc'} and \code{"abc"} are both legal strings ,
9699+ Hence, \code{'abc'} and \code{"abc"} are both legal string literals ,
96999700 as are \code{'He said "To be or not to be" did he not?'} and
97009701 \code{"He said 'To be or not to be' didn't he?"}.
9701- However, \code{"This'} is not a valid string, nor is \code{'this"}.%
9702+ However, \code{"This'} is not a valid string literal , nor is \code{'this"}.%
97029703}
97039704
97049705\commentary{%
9705- The grammar ensures that a single line string cannot span more than
9706+ The grammar ensures that a single line string literal cannot span more than
97069707 one line of source code,
97079708 unless it includes an interpolated expression that spans multiple lines.%
97089709}
97099710
97109711\LMHash{}%
9711- Adjacent strings are implicitly concatenated to form a single string literal.
9712+ Adjacent string literals are implicitly concatenated
9713+ to form a single string literal.
97129714
97139715\commentary{%
97149716 Here is an example:%
@@ -9721,7 +9723,7 @@ \subsection{Strings}
97219723\rationale{%
97229724 Dart also supports the operator + for string concatenation.
97239725
9724- The + operator on Strings requires a String argument.
9726+ The + operator on \code{String}s requires a \code{ String} argument.
97259727 It does not coerce its argument into a string.
97269728 This helps avoid puzzlers such as%
97279729}
@@ -9746,17 +9748,17 @@ \subsection{Strings}
97469748 String interpolation works well for most cases.
97479749 The main situation where it is not fully satisfactory
97489750 is for string literals that are too large to fit on a line.
9749- Multiline strings can be useful, but in some cases,
9751+ Multiline string literals can be useful, but in some cases,
97509752 we want to visually align the code.
97519753 This can be expressed by writing
9752- smaller strings separated by whitespace, as shown here:%
9754+ smaller string literals separated by whitespace, as shown here:%
97539755}
97549756
97559757\begin{dartCode}
97569758'Imagine this is a very long string that does not fit on a line. What shall we do? '
97579759'Oh what shall we do? '
97589760'We shall split it into pieces '
9759- 'like so'.
9761+ 'like so.'
97609762\end{dartCode}
97619763
97629764\LMHash{}%
@@ -9841,22 +9843,23 @@ \subsection{Strings}
98419843\end{grammar}
98429844
98439845\LMHash{}%
9844- Multiline strings are delimited by either
9846+ Multiline string literals are delimited by either
98459847matching triples of single quotes or
98469848matching triples of double quotes.
9847- If the first line of a multiline string consists solely of
9849+ If the first line of a multiline string literal consists solely of
98489850the whitespace characters defined by the production \synt{WHITESPACE}
98499851(\ref{lexicalRules}),
98509852possibly prefixed by \syntax{`\\'},
98519853then that line is ignored,
98529854including the line break at its end.
98539855
98549856\rationale{%
9855- The idea is to ignore a whitespace-only first line of a multiline string,
9857+ The idea is to ignore a whitespace-only first line of
9858+ a multiline string literal,
98569859 where whitespace is defined as tabs, spaces and the final line break.
98579860 These can be represented directly,
98589861 but since for most characters prefixing by backslash is
9859- an identity in a non-raw string,
9862+ an identity in a non-raw string literal ,
98609863 we allow those forms as well.%
98619864}
98629865
@@ -9874,7 +9877,7 @@ \subsection{Strings}
98749877}
98759878
98769879\LMHash{}%
9877- Strings support escape sequences for special characters.
9880+ String literals support escape sequences for special characters.
98789881The escapes are:
98799882
98809883\begin{itemize}
@@ -9921,12 +9924,12 @@ \subsection{Strings}
99219924\end{itemize}
99229925
99239926\LMHash{}%
9924- Any string may be prefixed with the character \lit{r},
9925- indicating that it is a \Index{raw string},
9927+ Any string literal may be prefixed with the character \lit{r},
9928+ indicating that it is a \Index{raw string literal },
99269929in which case no escapes or interpolations are recognized.
99279930
99289931\LMHash{}%
9929- Line breaks in a multiline string are represented by
9932+ Line breaks in a multiline string literal are represented by
99309933the \synt{LINE\_BREAK} production.
99319934A line break introduces a single newline character (U+000A)
99329935into the string value.
@@ -9975,12 +9978,12 @@ \subsubsection{String Interpolation}
99759978
99769979\commentary{%
99779980 The reader will note that the expression inside the interpolation
9978- could itself include strings ,
9981+ could itself include string literals ,
99799982 which could again be interpolated recursively.%
99809983}
99819984
99829985\LMHash{}%
9983- An unescaped \lit{\$} character in a string signifies
9986+ An unescaped \lit{\$} character in a string literal signifies
99849987the beginning of an interpolated expression.
99859988The \lit{\$} sign may be followed by either:
99869989
0 commit comments