Skip to content

Convert Rust-style enums into C-style tagged unions.

Notifications You must be signed in to change notification settings

mattnappo/tagmap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TagMap

A small program that converts Rust's ML-style sum types into C-style tagged unions.

Demonstration

The Rust enum on the left will be converted to the C code on the right.

demo

Usage

Pre-built binaries can be found in ./bin/.

Convert Rust enums to C tagged unions.

Usage: tagmap [OPTIONS] <INFILE>

Arguments:
  <INFILE>  A Rust source file containing an enum

Options:
  -o, --outfile <OUTFILE>  Path to the output file to write C code
  -f, --format             Format the outputted C code
  -h, --help               Print help
  -V, --version            Print version

Dependencies

For optional formatting of the generated C code, install indent and make sure it is visible in $PATH.

About

Convert Rust-style enums into C-style tagged unions.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages