A rust based parser and library for the languages we study in COMP31311
All examples can be found in the /examples
directory, and can be run like so:
cargo run --example <example_name>
This example program highlights the occurances of variables at a certain depth.
comp31311_langs on main [?] is 📦 v0.1.0 via 🦀 v1.65.0 took 2s
➜ cargo run --example=latexify -- --term 'z\y.y\x.x\x.xyz' -c x:1:red -c x:2:blue -c z:0:brown -c y:1:orange --output
Finished dev [unoptimized + debuginfo] target(s) in 0.02s
Running `target/debug/examples/latexify --term 'z\y.y\x.x\x.xyz' -c 'x:1:red' -c 'x:2:blue' -c 'z:0:brown' -c 'y:1:orange' --output`
\textcolor{brown}{z}\lambda \textcolor{orange}{y}.\textcolor{orange}{y}\lambda \textcolor{red}{x}.\textcolor{red}{x}\lambda \textcolor{blue}{x}.\textcolor{blue}{x}\textcolor{orange}{y}\textcolor{brown}{z}
comp31311_langs on main [?] is 📦 v0.1.0 via 🦀 v1.65.0
➜ latexrun out.tex
comp31311_langs on main [?] is 📦 v0.1.0 via 🦀 v1.65.0
➜ z out.pdf
This results in the following when rendered with default latex
+ xcolor
: