Skip to content

Commit 0c63467

Browse files
committed
Null shorting
1 parent 55dd0dd commit 0c63467

File tree

2 files changed

+413
-154
lines changed

2 files changed

+413
-154
lines changed

specification/dart.sty

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@
6868
\def\WITH{\keyword{with}}
6969
\def\YIELD{\keyword{yield}}
7070

71+
% Used for inline code snippets.
72+
\newcommand{\code}[1]{\texttt{#1}}
73+
7174
% Used to specify syntactic sugar.
7275
\def\LET{\keyword{let}}
7376
\newcommand{\Let}[3]{\code{\LET\,\,{#1}\,=\,{#2}\ \IN\ {#3}}}
@@ -78,8 +81,8 @@
7881
\newcommand{\LetMany}[5]{%
7982
\code{\LET\,\,{#1}\,=\,{#2},\ $\cdots$,\ {#3}\,=\,{#4}\ \IN\ {#5}}}
8083

81-
% Used for inline code snippets.
82-
\def\code#1{\texttt{#1}}
84+
% Used for inline meta-code snippets
85+
\newcommand{\metaCode}[1]{{\color{metaColor}\texttt{#1}}}
8386

8487
% `call` has no special lexical status, so we just use \code{}.
8588
\def\CALL{\code{call}}
@@ -112,6 +115,7 @@
112115
\definecolor{normativeColor}{rgb}{0,0,0}
113116
\definecolor{commentaryColor}{rgb}{0.5,0.5,0.5}
114117
\definecolor{rationaleColor}{rgb}{0.5,0.5,0.5}
118+
\definecolor{metaColor}{rgb}{0,0,1}
115119

116120
% Environments for different kinds of text.
117121
\newenvironment{Q}[1]{{\bf{}Upcoming: {#1}}}{}
@@ -132,22 +136,30 @@
132136
\newcommand{\Case}[1]{\textbf{Case }$\langle\hspace{0.1em}${#1}$\hspace{0.1em}\rangle$\textbf{.}}
133137
\newcommand{\EndCase}{\mbox{}\hfill$\scriptscriptstyle\Box$\xspace}
134138

135-
\newenvironment{dartCode}[1][!ht] {%
139+
\newenvironment{dartCode}[1][!ht]{%
136140
\def\@programcr{\@addfield\strut}%
137141
\let\\=\@programcr%
138142
\relax\@vobeyspaces\obeylines%
139143
\ttfamily\color{commentaryColor}%
140144
\vspace{1em}%
141145
}{\normalcolor\vspace{1em}}
142146

143-
\newenvironment{normativeDartCode}[1][!ht] {%
147+
\newenvironment{normativeDartCode}[1][!ht]{%
144148
\def\@programcr{\@addfield\strut}%
145149
\let\\=\@programcr%
146150
\relax\@vobeyspaces\obeylines%
147151
\ttfamily\color{normativeColor}%
148152
\vspace{1em}%
149153
}{\normalcolor\vspace{1em}}
150154

155+
\newenvironment{metaLevelCode}[1][!ht]{%
156+
\def\@programcr{\@addfield\strut}%
157+
\let\\=\@programcr%
158+
\relax\@vobeyspaces\obeylines%
159+
\ttfamily\color{metaColor}%
160+
\vspace{1em}%
161+
}{\normalcolor\vspace{1em}}
162+
151163
% Used for comments in a code context.
152164
\def\comment#1{\textsf{#1}}
153165

0 commit comments

Comments
 (0)