myd

Crates.iomyd
lib.rsmyd
version0.1.1
sourcesrc
created_at2023-04-02 10:31:54.430444
updated_at2023-04-04 09:19:15.377261
descriptionAn implementation of the rust module system
homepage
repositoryhttps://gitlab.com/john_t/myd
max_upload_size
id827966
size97,214
John Toohey (greenfierydragon)

documentation

README

Myd

Pronounced /mi:d/, like mead

Myd is a rust library to create a representation of the rust module tree as a usable datatype, and to resolve imports. It is designed to be used by tools working with rust source code to be less naïve about the module system.

Examples

Parse a package:

// Expensive operation: may take a few seconds
let mi = myd::parse::parse("./Cargo.toml");

Work out where something is imported from:

let my_path: syn::Path = syn::parse_str("std::collections::HashMap");
let hashmap = mi.path(my_node, my_path)

See the examples for more.

Commit count: 23

cargo fmt