Skip to main content

Crate ardent

Crate ardent 

Source
Expand description

Opinionated formatter for NSIS scripts.

Ardent parses NSIS scripts into a concrete syntax tree, then pretty-prints them with canonical casing, consistent indentation, and normalized parameters.

§Examples

use ardent::{Formatter, DentOptions, EndOfLines};

let formatter = Formatter::new(DentOptions {
    end_of_lines: Some(EndOfLines::Lf),
    ..Default::default()
}).unwrap();

let input = "section \"Hello World\"\ndetailprint \"hi\"\nsectionend\n";
let output = formatter.format(input).unwrap();
assert_eq!(output, "Section \"Hello World\"\n\tDetailPrint \"hi\"\nSectionEnd\n");

For CLI usage, see the repository.

Modules§

canonical_casing
Canonical casing lookup table for NSIS instructions.
canonical_parameters
Canonical parameter lookup tables for NSIS instructions.
parser
PEG-based parser that produces a concrete syntax tree from NSIS source.
printer
Pretty-printer that renders a CST back to formatted NSIS source.
rules
Block-structure rules defining which keywords open, close, or continue blocks.

Structs§

DentOptions
Configuration for the formatter.
Formatter
An NSIS script formatter.

Enums§

EndOfLines
Line ending style for formatted output.