-
Notifications
You must be signed in to change notification settings - Fork 2
/
example.tex
59 lines (46 loc) · 1.04 KB
/
example.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
\documentclass{article}
\usepackage{verbatim}
\input{mcorelisting}
\begin{document}
Line~\ref{l:magic} is where the magic happens. This is inline code
\mcoreinline{let f = lam x. x}.
\def \mcorefontsize {\tiny}
%
Setting \verb|\mcorefontsize| to \verb|\tiny| gives tiny code: \mcoreinline{let
f = lam x. x}.
%
\def \mcorefontsize {\normalsize}
\begin{figure}[h]
\begin{mcore-lines}
include "seq.mc"
let foo =
-- This is a comment
let s = "magic" in (*@\label{l:magic}@*)
let one = 1 in
lam x. x
let bar: Int -> (Int -> Int) =
lam i.
addi i
mexpr
utest 1 with 1 in ()
\end{mcore-lines}
\caption{With line numbers.}
\end{figure}
\begin{figure}[h]
\begin{mcore}
include "seq.mc"
let foo =
-- This is a comment
let s = "magic" in
let one = 1 in
lam x. x
let bar: Int -> (Int -> Int) =
lam i.
addi i
mexpr
utest 1 with 1 in ()
\end{mcore}
\caption{Without line numbers.}
\end{figure}
\lstinputlisting[language=MCore,caption={Included from file.}]{example.mc}
\end{document}