Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
M

macro_railroad

> 编程语言
Open source

A library to generate syntax diagrams for Rust macros.

567 stars0 likes0 views
WebsiteGitHub

About

A library to generate syntax diagrams for Rust macros.

Live demo (code)

A browser add-on for Firefox, Chrome and Edge

A library to generate syntax ("railroad") diagrams for Rust's macro_rules!().

Diagrams are generated as Scalable Vector Graphics, with layout-details controlled by customizable CSS.

As an example, given the definition of nom's method

…

... the library generates an SVG which renders (using default CSS) as


To generate the examples shown here, run

cargo run --example various

which will output some html-files to /examples; Feel free to hack on the demos in /examples/various.rs.

Examples

  • Live demo (code)
  • The macros from nom-4.1.1 as diagrams
  • Some of the macros from the standard library as diagrams
  • The macros from syn-0.14 as diagrams
  • Some macros from various crates, including bitflags, quickcheck and cfg-if, as diagrams

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Rustrust

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言