Skip to content

Commit 5af9844

Browse files
committed
Language specification reorganization.
---------------- NEW description (old description shown at end): This CL is now a reorganization, problem fixing, clarifying update to dartLangSpec.tex which was created as part of the work on the rules for call method extraction. That is, all the call method extraction specific elements have been _deleted_ from this CL (they will reappear as a separate CL later). This CL is now only performing "general clean-up work" which is needed in order to perform many kinds of updates (including call method extraction, but also anything else where the dynamic semantics depends on the static analysis & desugaring). ------------------------------------------------ OLD description Introduced rules for call method extraction. The previous update to dartLangSpec.tex dealt with invocations, but omitted the transformation whereby `e` becomes `e.call` when `e` has a type which is a class with a `call` method and the context expects a value of type `Function` or of a function type. This CL adds some rules dealing with that and introduces a concept for the transformation itself. One part is missing for the initial patch set: There are no rules specifying that call method extraction should be applied to actual arguments. The problem is that static checking of actual arguments to various invocations (function expression invocation, ordinary method invocation, super invocation, etc.etc.) seems to be "delegated" partially to section `Binding Actuals to Formals`, but that section never defines the syntax for the function which is being invoked and it is in general rather dynamic in nature. So I'm not quite sure that the references to static checking at the end of that section are located optimally. Some adjustments may therefor be needed before we can specify this particular feature for actual arguments. Change-Id: Ia2ab6f16cd50e10a3c467722035f0dc4adb50587 Reviewed-on: https://dart-review.googlesource.com/51323 Reviewed-by: Lasse R.H. Nielsen <[email protected]>
1 parent 2cb2ac4 commit 5af9844

File tree

2 files changed

+1761
-1112
lines changed

2 files changed

+1761
-1112
lines changed

docs/language/dart.sty

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
1-
\def\keyword#1{\textbf{#1}}
2-
\def\builtinId#1{\textbf{#1}}
31
\def\code#1{\textsf{#1}}
4-
\def\comment#1{\textit{#1}}
5-
\def\capt#1{\rmfamily \caption{#1}}
6-
\def\lt{\ensuremath{<}}
7-
\def\gt{\ensuremath{>}}
8-
\def\<{\ensuremath{\langle}}
9-
\def\>{\ensuremath{\rangle}}
2+
\def\builtinId#1{\code{\textbf{#1}}}
3+
\def\keyword#1{\code{\textbf{#1}}}
104
\def\metavar#1{\ensuremath{\mathit{#1}}}
115

126
\def\ABSTRACT{\builtinId{abstract}}
@@ -34,7 +28,6 @@
3428
\def\ASYNC{\keyword{async}}
3529
\def\AWAIT{\keyword{await}}
3630
\def\BREAK{\keyword{break}}
37-
\def\CALL{\keyword{call}}
3831
\def\CASE{\keyword{case}}
3932
\def\CATCH{\keyword{catch}}
4033
\def\CLASS{\keyword{class}}
@@ -73,6 +66,18 @@
7366
\def\WITH{\keyword{with}}
7467
\def\YIELD{\keyword{yield}}
7568

69+
% `call` has no special lexical status, so we just use \code{}.
70+
\def\CALL{\code{call}}
71+
72+
% Used in regular text to indicate that #1 consists of non-terminals.
73+
%% TODO(eernst): Update to use grammar font when we start using that;
74+
%% at this point we just make it "regular text" using \mbox.
75+
\newcommand{\NonTerminal}[1]{\mbox{#1}}
76+
77+
% Angle brackets used for operators in grammar context.
78+
\def\lt{\ensuremath{<}}
79+
\def\gt{\ensuremath{>}}
80+
7681
% A quoted comma as used in the grammar: needs spacing fix.
7782
\newcommand{\gcomma}{\mbox{`,\hspace{-0.1em}'}}
7883

@@ -88,6 +93,14 @@
8893
\newenvironment{rationale}[1]{{\it #1}}{}
8994
\newenvironment{commentary}[1]{{\sf #1}}{}
9095

96+
\newcommand{\flatten}[1]{\ensuremath{\mbox{\it flatten}({#1})}}
97+
98+
% Used as a mini-section marker, indicating visibly that a range of
99+
% text (usually just a couple of paragraphs) are concerned with one
100+
% specific topic in a list of similar topics (like many forms of
101+
% expressions of a similar nature).
102+
\newcommand{\Case}[1]{\textbf{Case }$\langle\hspace{0.1em}${#1}$\hspace{0.1em}\rangle$\textbf{.}}
103+
91104
\newenvironment{dartCode}[1][!ht] {
92105
% \begin{verbatim}[#1]
93106
\def\@programcr{\@addfield\strut}

0 commit comments

Comments
 (0)