Skip to content

Commit 8fc47af

Browse files
committed
Corrected many occurrences of "string" to "string literal"
1 parent ec51ed1 commit 8fc47af

File tree

1 file changed

+23
-20
lines changed

1 file changed

+23
-20
lines changed

specification/dartLangSpec.tex

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9616,7 +9616,8 @@ \subsection{Strings}
96169616
\end{grammar}
96179617

96189618
\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.
96209621

96219622
\begin{grammar}
96229623
<singleLineString> ::= <RAW\_SINGLE\_LINE\_STRING>
@@ -9668,24 +9669,25 @@ \subsection{Strings}
96689669
\end{grammar}
96699670

96709671
\LMHash{}%
9671-
A single line string is delimited by
9672+
A single line string literal is delimited by
96729673
either matching single quotes or matching double quotes.
96739674

96749675
\commentary{%
9675-
Hence, \code{'abc'} and \code{"abc"} are both legal strings,
9676+
Hence, \code{'abc'} and \code{"abc"} are both legal string literals,
96769677
as are \code{'He said "To be or not to be" did he not?'} and
96779678
\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"}.%
96799680
}
96809681

96819682
\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
96839684
one line of source code,
96849685
unless it includes an interpolated expression that spans multiple lines.%
96859686
}
96869687

96879688
\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.
96899691

96909692
\commentary{%
96919693
Here is an example:%
@@ -9698,7 +9700,7 @@ \subsection{Strings}
96989700
\rationale{%
96999701
Dart also supports the operator + for string concatenation.
97009702

9701-
The + operator on Strings requires a String argument.
9703+
The + operator on \code{String}s requires a \code{String} argument.
97029704
It does not coerce its argument into a string.
97039705
This helps avoid puzzlers such as%
97049706
}
@@ -9723,17 +9725,17 @@ \subsection{Strings}
97239725
String interpolation works well for most cases.
97249726
The main situation where it is not fully satisfactory
97259727
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,
97279729
we want to visually align the code.
97289730
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:%
97309732
}
97319733

97329734
\begin{dartCode}
97339735
'Imagine this is a very long string that does not fit on a line. What shall we do? '
97349736
'Oh what shall we do? '
97359737
'We shall split it into pieces '
9736-
'like so'.
9738+
'like so.'
97379739
\end{dartCode}
97389740

97399741
\LMHash{}%
@@ -9818,22 +9820,23 @@ \subsection{Strings}
98189820
\end{grammar}
98199821

98209822
\LMHash{}%
9821-
Multiline strings are delimited by either
9823+
Multiline string literals are delimited by either
98229824
matching triples of single quotes or
98239825
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
98259827
the whitespace characters defined by the production \synt{WHITESPACE}
98269828
(\ref{lexicalRules}),
98279829
possibly prefixed by \syntax{`\\'},
98289830
then that line is ignored,
98299831
including the line break at its end.
98309832

98319833
\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,
98339836
where whitespace is defined as tabs, spaces and the final line break.
98349837
These can be represented directly,
98359838
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,
98379840
we allow those forms as well.%
98389841
}
98399842

@@ -9851,7 +9854,7 @@ \subsection{Strings}
98519854
}
98529855

98539856
\LMHash{}%
9854-
Strings support escape sequences for special characters.
9857+
String literals support escape sequences for special characters.
98559858
The escapes are:
98569859

98579860
\begin{itemize}
@@ -9898,12 +9901,12 @@ \subsection{Strings}
98989901
\end{itemize}
98999902

99009903
\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},
99039906
in which case no escapes or interpolations are recognized.
99049907

99059908
\LMHash{}%
9906-
Line breaks in a multiline string are represented by
9909+
Line breaks in a multiline string literal are represented by
99079910
the \synt{LINE\_BREAK} production.
99089911
A line break introduces a single newline character (U+000A)
99099912
into the string value.
@@ -9952,12 +9955,12 @@ \subsubsection{String Interpolation}
99529955

99539956
\commentary{%
99549957
The reader will note that the expression inside the interpolation
9955-
could itself include strings,
9958+
could itself include string literals,
99569959
which could again be interpolated recursively.%
99579960
}
99589961

99599962
\LMHash{}%
9960-
An unescaped \lit{\$} character in a string signifies
9963+
An unescaped \lit{\$} character in a string literal signifies
99619964
the beginning of an interpolated expression.
99629965
The \lit{\$} sign may be followed by either:
99639966

0 commit comments

Comments
 (0)