Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update pre-null-safety spec with new null safety sections #2023

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 19 additions & 8 deletions specification/dart.sty
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,9 @@
\newenvironment{commentary}[1]{{\color{commentaryColor}\sf{#1}}}{}

% Auxiliary functions.
\newcommand{\flattenName}{\mbox{\it flatten}}
\newcommand{\flatten}[1]{\ensuremath{\flattenName({#1})}}
\newcommand{\futureOrBase}[1]{\ensuremath{\mbox{\it futureOrBase}({#1})}}
\newcommand{\overrides}[1]{\ensuremath{\mbox{\it overrides}({#1})}}
\newcommand{\inherited}[1]{\ensuremath{\mbox{\it inherited}({#1})}}
\newcommand{\futureOrBase}[1]{\ensuremath{\metavar{futureOrBase}({#1})}}
\newcommand{\overrides}[1]{\ensuremath{\metavar{overrides}({#1})}}
\newcommand{\inherited}[1]{\ensuremath{\metavar{inherited}({#1})}}

% Used as a mini-section marker, indicating visibly that a range of
% text (usually just a couple of paragraphs) are concerned with one
Expand Down Expand Up @@ -338,7 +336,7 @@
% "T1, .. Tn, {rn+1 Tn+1 xn+1, .. rn+k Tn+k xn+k}".
\newcommand{\FunctionTypeNamedParameters}[5]{%
\List{#1}{1}{#2},\ \{\TripleList{#5}{#1}{#3}{{#2}+1}{{#2}+{#4}}\}}

% Variant of \FunctionTypeNamedParameters that uses the standard symbols,
% that is, a list of function type parameter declarations with named
% parameters which uses the symbols that we prefer to use for that purpose
Expand Down Expand Up @@ -386,6 +384,16 @@
\newcommand{\FunctionTypePositionalStdCr}[1]{%
\FunctionTypePositional{#1}{\\}{X}{B}{s}{T}{n}{k}}

% Used to specify function type parameter lists with named optionals.
% Arguments: Parameter type, number of required parameters,
% name of optional parameters, number of optional parameters,
% name of `required` symbol.
\newcommand{\FunctionTypeNamedArguments}[5]{%
\List{#1}{1}{#2},\ \{\TripleList{#5}{#1}{#3}{{#2}+1}{{#2}+{#4}}\}}

\newcommand{\FunctionTypeNamedArgumentsStd}{%
\FunctionTypeNamedArguments{T}{n}{x}{k}{r}}

% Used to specify function types with named parameters:
% Arguments: Return type, spacer, type parameter name, bound name,
% number of type parameters, parameter type, number of required parameters,
Expand All @@ -402,9 +410,9 @@

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

% A variant of \FunctionTypeNamed that uses the standard symbols,
% that is, a function type with positional optional parameters which
Expand Down Expand Up @@ -447,6 +455,9 @@
\newcommand{\FunctionTypeAllRequiredStd}[1]{%
\FunctionTypeAllRequired{#1}{ }{X}{B}{s}{T}{n}}

\newcommand{\FunctionTypeNamedStdArgCr}[1]{%
\FunctionTypeNamedArgCr{#1}{ }{X}{B}{s}{T}{n}{x}{k}}

% Same as \FunctionTypeAllRequiredStd except that it includes a newline, hence
% suitable for function types that are too long to fit in one line.
\newcommand{\FunctionTypeAllRequiredStdCr}[1]{%
Expand Down