masm-formatter

Crates.iomasm-formatter
lib.rsmasm-formatter
version0.3.3
created_at2024-06-21 22:54:29.521267+00
updated_at2025-08-13 20:41:49.733171+00
descriptionA formatter for Miden Assembly (.masm) files
homepagehttps://github.com/partylikeits1983/masm-formatter
repositoryhttps://github.com/partylikeits1983/masm-formatter
max_upload_size
id1280013
size207,001
Alexander John Lee (partylikeits1983)

documentation

README

Miden Assembly Code Formatter

Basic Miden Assembly code formatter.

The following keywords affect indentation rules in Miden Assembly: begin, proc, export, if, else, repeat, while, end.

Basic Rules this formatter follows:

  1. Adds correct indentation following the code formatting rules seen in the miden-base repository.
  2. Removes trailing spaces.
  3. Removes empty lines.

That's pretty much it.

Would be cool to auto format comments, and maybe some other things.

This code formatter has been tested extensively, however, there may be edge cases where it fails.

Testing

Installing binary from crates

cargo install masm-formatter

Installing binary from repo:

cargo install --path .

Formatting all files in a directory:

cargo masm-fmt "src/**/*.masm"

Formatting a single file in a directory:

cargo masm-fmt "src/asm/example3.masm"
Commit count: 30

cargo fmt