Skip to content

Commit 016ef2f

Browse files
committed
Update pre-null-safety spec with null safety sections near the end of the spec
1 parent 5dd44e1 commit 016ef2f

File tree

2 files changed

+2987
-616
lines changed

2 files changed

+2987
-616
lines changed

specification/dart.sty

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,9 @@
124124
\newenvironment{commentary}[1]{{\color{commentaryColor}\sf{#1}}}{}
125125

126126
% Auxiliary functions.
127-
\newcommand{\flattenName}{\mbox{\it flatten}}
128-
\newcommand{\flatten}[1]{\ensuremath{\flattenName({#1})}}
129-
\newcommand{\futureOrBase}[1]{\ensuremath{\mbox{\it futureOrBase}({#1})}}
130-
\newcommand{\overrides}[1]{\ensuremath{\mbox{\it overrides}({#1})}}
131-
\newcommand{\inherited}[1]{\ensuremath{\mbox{\it inherited}({#1})}}
127+
\newcommand{\futureOrBase}[1]{\ensuremath{\metavar{futureOrBase}({#1})}}
128+
\newcommand{\overrides}[1]{\ensuremath{\metavar{overrides}({#1})}}
129+
\newcommand{\inherited}[1]{\ensuremath{\metavar{inherited}({#1})}}
132130

133131
% Used as a mini-section marker, indicating visibly that a range of
134132
% text (usually just a couple of paragraphs) are concerned with one
@@ -386,6 +384,16 @@
386384
\newcommand{\FunctionTypePositionalStdCr}[1]{%
387385
\FunctionTypePositional{#1}{\\}{X}{B}{s}{T}{n}{k}}
388386

387+
% Used to specify function type parameter lists with named optionals.
388+
% Arguments: Parameter type, number of required parameters,
389+
% name of optional parameters, number of optional parameters,
390+
% name of `required` symbol.
391+
\newcommand{\FunctionTypeNamedArguments}[5]{%
392+
\List{#1}{1}{#2},\ \{\TripleList{#5}{#1}{#3}{{#2}+1}{{#2}+{#4}}\}}
393+
394+
\newcommand{\FunctionTypeNamedArgumentsStd}{%
395+
\FunctionTypeNamedArguments{T}{n}{x}{k}{r}}
396+
389397
% Used to specify function types with named parameters:
390398
% Arguments: Return type, spacer, type parameter name, bound name,
391399
% number of type parameters, parameter type, number of required parameters,
@@ -402,7 +410,7 @@
402410

403411
% Same as \FunctionTypeNamed except suitable for inline usage, hence omitting
404412
% the spacer argument.
405-
\newcommand{\RawFunctionTypeNamed}[8]{%
413+
\newcommand{\RawFunctionTypeNamed}[9]{%
406414
\RawFunctionType{#1}{#2}{#3}{#4}{%
407415
\FunctionTypeNamedParameters{#5}{#6}{#7}{#8}{r}}}
408416

@@ -447,6 +455,9 @@
447455
\newcommand{\FunctionTypeAllRequiredStd}[1]{%
448456
\FunctionTypeAllRequired{#1}{ }{X}{B}{s}{T}{n}}
449457

458+
\newcommand{\FunctionTypeNamedStdArgCr}[1]{%
459+
\FunctionTypeNamedArgCr{#1}{ }{X}{B}{s}{T}{n}{x}{k}{r}}
460+
450461
% Same as \FunctionTypeAllRequiredStd except that it includes a newline, hence
451462
% suitable for function types that are too long to fit in one line.
452463
\newcommand{\FunctionTypeAllRequiredStdCr}[1]{%

0 commit comments

Comments
 (0)