Skip to main content

Crate resrap_rs

Crate resrap_rs 

Source
Expand description

Resrap is a seedable, grammar-based code snippet generator.

Instead of parsing code, it generates code from formal ABNF-style grammars. This crate is a Rust port of the Go package github.com/osdc/resrap and aims to match its API and generation behaviour exactly, including deterministic output for a given seed.

Modules§

templates
Ready-to-use Resrap grammars for common languages.

Structs§

CodeChannel
A cloneable, blocking result channel. Multiple consumers may call recv; disconnected means shut_down_resrap has finished draining every result.
CodeGenRes
The result of one generation job.
Node
Describes either a directory or file entry in a codebase specification.
Resrap
Resrap is the main access point for single-threaded use. It is a collection of grammars which can be generated from a parsed grammar graph.
ResrapMT
The multithreaded version of crate::Resrap.

Enums§

FileType

Constants§

ERR_SHUT_DOWN

Traits§

GrammarLoader
Implemented by both Resrap and ResrapMT, allowing the built-in templates to load into either one.

Functions§

parse_dsl
Parses the directory DSL into a tree.