| \def\builtinId#1{\textsf{\textbf{#1}}} |
| \def\keyword#1{\textsf{\textbf{#1}}} |
| \def\metavar#1{\ensuremath{\mathit{#1}}} |
| |
| \def\ABSTRACT{\builtinId{abstract}} |
| \def\AS{\builtinId{as}} |
| \def\COVARIANT{\builtinId{covariant}} |
| \def\DEFERRED{\builtinId{deferred}} |
| \def\DYNAMIC{\builtinId{dynamic}} |
| \def\EXPORT{\builtinId{export}} |
| \def\EXTERNAL{\builtinId{external}} |
| \def\FACTORY{\builtinId{factory}} |
| \def\FUNCTION{\builtinId{Function}} |
| \def\GET{\builtinId{get}} |
| \def\IMPLEMENTS{\builtinId{implements}} |
| \def\IMPORT{\builtinId{import}} |
| \def\INTERFACE{\builtinId{interface}} |
| \def\LIBRARY{\builtinId{library}} |
| \def\MIXIN{\builtinId{mixin}} |
| \def\OPERATOR{\builtinId{operator}} |
| \def\PART{\builtinId{part}} |
| \def\SET{\builtinId{set}} |
| \def\STATIC{\builtinId{static}} |
| \def\TYPEDEF{\builtinId{typedef}} |
| |
| \def\ASSERT{\keyword{assert}} |
| \def\ASYNC{\keyword{async}} |
| \def\AWAIT{\keyword{await}} |
| \def\BREAK{\keyword{break}} |
| \def\CASE{\keyword{case}} |
| \def\CATCH{\keyword{catch}} |
| \def\CLASS{\keyword{class}} |
| \def\CONST{\keyword{const}} |
| \def\CONTINUE{\keyword{continue}} |
| \def\DEFAULT{\keyword{default}} |
| \def\DO{\keyword{do}} |
| \def\ELSE{\keyword{else}} |
| \def\ENUM{\keyword{enum}} |
| \def\EXTENDS{\keyword{extends}} |
| \def\FALSE{\keyword{false}} |
| \def\FINAL{\keyword{final}} |
| \def\FINALLY{\keyword{finally}} |
| \def\FOR{\keyword{for}} |
| \def\HIDE{\keyword{hide}} |
| \def\IF{\keyword{if}} |
| \def\IN{\keyword{in}} |
| \def\IS{\keyword{is}} |
| \def\NEW{\keyword{new}} |
| \def\NULL{\keyword{null}} |
| \def\OF{\keyword{of}} |
| \def\ON{\keyword{on}} |
| \def\RETHROW{\keyword{rethrow}} |
| \def\RETURN{\keyword{return}} |
| \def\SHOW{\keyword{show}} |
| \def\SUPER{\keyword{super}} |
| \def\SWITCH{\keyword{switch}} |
| \def\SYNC{\keyword{sync}} |
| \def\THIS{\keyword{this}} |
| \def\THROW{\keyword{throw}} |
| \def\TRUE{\keyword{true}} |
| \def\TRY{\keyword{try}} |
| \def\VAR{\keyword{var}} |
| \def\VOID{\keyword{void}} |
| \def\WHILE{\keyword{while}} |
| \def\WITH{\keyword{with}} |
| \def\YIELD{\keyword{yield}} |
| |
| % Used for inline code snippets. |
| \def\code#1{\texttt{#1}} |
| |
| % `call` has no special lexical status, so we just use \code{}. |
| \def\CALL{\code{call}} |
| |
| % Define commands for `<<`, `>>`, `>>>` that avoid introducing guillemets. |
| \def\ltlt{<\mbox <} |
| \def\gtgt{>\mbox >} |
| \def\gtgtgt{>\mbox >\mbox >} |
| |
| % Used as line break in the right hand side of a grammar |
| % alternative, that is, when starting a "continuation line". |
| \newcommand{\gnewline}{\\\mbox{}\qquad{}} |
| |
| % Metavariables for argument lists. |
| \newcommand{\argumentList}[1]{\metavar{{#1}s}} |
| \newcommand{\parameterList}[1]{\metavar{{#1}s}} |
| |
| \newenvironment{Q}[1]{{\bf #1}}{} |
| \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] { |
| \def\@programcr{\@addfield\strut}% |
| \let\\=\@programcr% |
| \relax\@vobeyspaces\obeylines% |
| \ttfamily% |
| \vspace{1em} |
| }{\vspace{1em}} |
| |
| % Used for comments in a code context. |
| \def\comment#1{\textsf{#1}} |
| |
| % A commonly used name for an identifier |
| \newcommand{\id}{\metavar{id}} |
| |
| % ---------------------------------------------------------------------- |
| % Support for hash valued Location Markers |
| |
| % very small font, to enable 40 char hash values in the margin |
| \makeatletter |
| \ifcase \@ptsize \relax% 10pt |
| \newcommand{\miniscule}{\@setfontsize\miniscule{2}{3}}% \tiny: 5/6 |
| \or% 11pt |
| \newcommand{\miniscule}{\@setfontsize\miniscule{3}{4}}% \tiny: 6/7 |
| \or% 12pt |
| \newcommand{\miniscule}{\@setfontsize\miniscule{3}{4}}% \tiny: 6/7 |
| \fi |
| \makeatother |
| |
| % white: location markers should not create visual noise |
| \definecolor{LMdim}{gray}{1.0} |
| |
| % insert location marker showing hash value of following paragraph |
| \newcommand{\LMHash}[1]{% |
| \hspace{0pt}\marginpar{\raisebox{0.5ex}{\miniscule{\color{LMdim}#1}}}} |
| |
| % support convenient renewcommand |
| \let\OriginalLMHash\LMHash |
| |
| % define a label, and show the associated logical location marker |
| \newcommand{\LMLabel}[1]{% |
| \vspace{-\baselineskip}\hspace{0pt}\OriginalLMHash{\raisebox{10ex}{#1}}% |
| \label{#1}} |
| % ---------------------------------------------------------------------- |