Fixed many whitespace issues in dartLangSpec.tex
In dartLangSpec.tex there used to be many white space anomalies, e.g.,
double spaces between words with no apparent justification
or multiple empty lines
or lines starting with indentation that wasn't justified by any
consistent rule that I could spot.
This CL fixes that.
It also adjusts the grammar rules to be formatted in a systematic way
which will be helpful for an update to use something else than
bnf.sty (that we can't distribute due to license problems).
In particular, when a right hand side is too long for one line it used
to flow into the next line just like text (so non-terminals would have
`-` inserted at locations where a natural language algorithm thought
the "word" could be split in two, and the indentation on the next line
was nonsensical). So now it uses `\gnewline{}` ("grammar newline") to
switch to a new line and indent somewhat. It also uses `\gcomma{}` to
produce a quoted comma (which otherwise looks funny, because the `,'
becomes more like `, ' because the comma has a sort of built-in space
after it).
The command `\cd{...}` is gone and `\code{...}` is used everywhere.
Every sentence is now terminated by a newline. This doesn't mean that
every line is <80 chars, but it is at least much more readable (in
an editor whose window is really big), and it's consistent with the
more radical changes that we have made whenever we have made bigger
changes to a paragraph.
Finally, all comments on interface injection and all comments on
spread and rest arguments have been deleted. These comments contained
considerations about said features, but they did not contribute to
the discussions that we have had about the same or similar topics
(in particular because the comments relied on assumptions that do
not hold any more).
So it's a big diff, but a huge portion of it is white space fixes,
and the rest is very systematic. So it should be bearable, and we
would surely need to do the same things over time, otherwise.
Change-Id: Ia5922c22cb496792d394e76ce8c7bca7df1b4cc8
Reviewed-on: https://dart-review.googlesource.com/25000
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
\def\keyword#1{\textbf{#1}}
|
||||
\def\builtinId#1{\textbf{#1}}
|
||||
\def\code#1{\textsf{#1}}
|
||||
\def\comment#1{\textit{#1}}
|
||||
\def\capt#1{\rmfamily \caption{#1}}
|
||||
\newcommand{\cd}[1]{\textsf{#1}}
|
||||
\def\lt{\ensuremath{<}}
|
||||
\def\gt{\ensuremath{>}}
|
||||
\def\<{\ensuremath{\langle}}
|
||||
@@ -70,6 +70,13 @@
|
||||
\def\WITH{\keyword{with}}
|
||||
\def\YIELD{\keyword{yield}}
|
||||
|
||||
% A quoted comma as used in the grammar: needs spacing fix.
|
||||
\newcommand{\gcomma}{\mbox{`,\hspace{-0.1em}'}}
|
||||
|
||||
% Used as line break in the right hand side of a grammar
|
||||
% alternative, that is, when starting a "continuation line".
|
||||
\newcommand{\gnewline}{\\\mbox{}\qquad{}}
|
||||
|
||||
\newenvironment{Q}[1]{{\bf #1}}{}
|
||||
\newenvironment{rationale}[1]{{\it #1}}{}
|
||||
\newenvironment{commentary}[1]{{\sf #1}}{}
|
||||
|
||||
+2791
-2143
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user