Skip to content

Commit 81bb524

Browse files
committed
Null shorting
1 parent 7b6b200 commit 81bb524

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}}}{}
@@ -131,22 +135,30 @@
131135
\newcommand{\Case}[1]{\textbf{Case }$\langle\hspace{0.1em}${#1}$\hspace{0.1em}\rangle$\textbf{.}}
132136
\newcommand{\EndCase}{\mbox{}\hfill$\scriptscriptstyle\Box$\xspace}
133137

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

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

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

0 commit comments

Comments
 (0)