mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 08:07:11 +00:00
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 <lrn@google.com>
This commit is contained in:
parent
2cb2ac401c
commit
5af9844382
2 changed files with 1788 additions and 1139 deletions
|
@ -1,12 +1,6 @@
|
|||
\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}}
|
||||
\def\lt{\ensuremath{<}}
|
||||
\def\gt{\ensuremath{>}}
|
||||
\def\<{\ensuremath{\langle}}
|
||||
\def\>{\ensuremath{\rangle}}
|
||||
\def\builtinId#1{\code{\textbf{#1}}}
|
||||
\def\keyword#1{\code{\textbf{#1}}}
|
||||
\def\metavar#1{\ensuremath{\mathit{#1}}}
|
||||
|
||||
\def\ABSTRACT{\builtinId{abstract}}
|
||||
|
@ -34,7 +28,6 @@
|
|||
\def\ASYNC{\keyword{async}}
|
||||
\def\AWAIT{\keyword{await}}
|
||||
\def\BREAK{\keyword{break}}
|
||||
\def\CALL{\keyword{call}}
|
||||
\def\CASE{\keyword{case}}
|
||||
\def\CATCH{\keyword{catch}}
|
||||
\def\CLASS{\keyword{class}}
|
||||
|
@ -73,6 +66,18 @@
|
|||
\def\WITH{\keyword{with}}
|
||||
\def\YIELD{\keyword{yield}}
|
||||
|
||||
% `call` has no special lexical status, so we just use \code{}.
|
||||
\def\CALL{\code{call}}
|
||||
|
||||
% Used in regular text to indicate that #1 consists of non-terminals.
|
||||
%% TODO(eernst): Update to use grammar font when we start using that;
|
||||
%% at this point we just make it "regular text" using \mbox.
|
||||
\newcommand{\NonTerminal}[1]{\mbox{#1}}
|
||||
|
||||
% Angle brackets used for operators in grammar context.
|
||||
\def\lt{\ensuremath{<}}
|
||||
\def\gt{\ensuremath{>}}
|
||||
|
||||
% A quoted comma as used in the grammar: needs spacing fix.
|
||||
\newcommand{\gcomma}{\mbox{`,\hspace{-0.1em}'}}
|
||||
|
||||
|
@ -88,6 +93,14 @@
|
|||
\newenvironment{rationale}[1]{{\it #1}}{}
|
||||
\newenvironment{commentary}[1]{{\sf #1}}{}
|
||||
|
||||
\newcommand{\flatten}[1]{\ensuremath{\mbox{\it flatten}({#1})}}
|
||||
|
||||
% Used as a mini-section marker, indicating visibly that a range of
|
||||
% text (usually just a couple of paragraphs) are concerned with one
|
||||
% specific topic in a list of similar topics (like many forms of
|
||||
% expressions of a similar nature).
|
||||
\newcommand{\Case}[1]{\textbf{Case }$\langle\hspace{0.1em}${#1}$\hspace{0.1em}\rangle$\textbf{.}}
|
||||
|
||||
\newenvironment{dartCode}[1][!ht] {
|
||||
% \begin{verbatim}[#1]
|
||||
\def\@programcr{\@addfield\strut}
|
||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue