Skip to content

A rust based parser for a simple untyped lambda calculus from one of my classes at university.

Notifications You must be signed in to change notification settings

tritoke/comp31311_langs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

COMP31311 langs

A rust based parser and library for the languages we study in COMP31311

Examples

All examples can be found in the /examples directory, and can be run like so:

cargo run --example <example_name>

Latexify example

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:

A lambda calculus expression where the variables at different levels have been coloured.

About

A rust based parser for a simple untyped lambda calculus from one of my classes at university.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages