|
68 | 68 | \def\WITH{\keyword{with}}
|
69 | 69 | \def\YIELD{\keyword{yield}}
|
70 | 70 |
|
| 71 | +% Used for inline code snippets. |
| 72 | +\newcommand{\code}[1]{\texttt{#1}} |
| 73 | + |
71 | 74 | % Used to specify syntactic sugar.
|
72 | 75 | \def\LET{\keyword{let}}
|
73 | 76 | \newcommand{\Let}[3]{\code{\LET\,\,{#1}\,=\,{#2}\ \IN\ {#3}}}
|
|
78 | 81 | \newcommand{\LetMany}[5]{%
|
79 | 82 | \code{\LET\,\,{#1}\,=\,{#2},\ $\cdots$,\ {#3}\,=\,{#4}\ \IN\ {#5}}}
|
80 | 83 |
|
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}}} |
83 | 86 |
|
84 | 87 | % `call` has no special lexical status, so we just use \code{}.
|
85 | 88 | \def\CALL{\code{call}}
|
|
112 | 115 | \definecolor{normativeColor}{rgb}{0,0,0}
|
113 | 116 | \definecolor{commentaryColor}{rgb}{0.5,0.5,0.5}
|
114 | 117 | \definecolor{rationaleColor}{rgb}{0.5,0.5,0.5}
|
| 118 | +\definecolor{metaColor}{rgb}{0,0,1} |
115 | 119 |
|
116 | 120 | % Environments for different kinds of text.
|
117 | 121 | \newenvironment{Q}[1]{{\bf{}Upcoming: {#1}}}{}
|
|
131 | 135 | \newcommand{\Case}[1]{\textbf{Case }$\langle\hspace{0.1em}${#1}$\hspace{0.1em}\rangle$\textbf{.}}
|
132 | 136 | \newcommand{\EndCase}{\mbox{}\hfill$\scriptscriptstyle\Box$\xspace}
|
133 | 137 |
|
134 |
| -\newenvironment{dartCode}[1][!ht] {% |
| 138 | +\newenvironment{dartCode}[1][!ht]{% |
135 | 139 | \def\@programcr{\@addfield\strut}%
|
136 | 140 | \let\\=\@programcr%
|
137 | 141 | \relax\@vobeyspaces\obeylines%
|
138 | 142 | \ttfamily\color{commentaryColor}%
|
139 | 143 | \vspace{1em}%
|
140 | 144 | }{\normalcolor\vspace{1em}}
|
141 | 145 |
|
142 |
| -\newenvironment{normativeDartCode}[1][!ht] {% |
| 146 | +\newenvironment{normativeDartCode}[1][!ht]{% |
143 | 147 | \def\@programcr{\@addfield\strut}%
|
144 | 148 | \let\\=\@programcr%
|
145 | 149 | \relax\@vobeyspaces\obeylines%
|
146 | 150 | \ttfamily\color{normativeColor}%
|
147 | 151 | \vspace{1em}%
|
148 | 152 | }{\normalcolor\vspace{1em}}
|
149 | 153 |
|
| 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 | + |
150 | 162 | % Used for comments in a code context.
|
151 | 163 | \def\comment#1{\textsf{#1}}
|
152 | 164 |
|
|
0 commit comments