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, FormatterOptions, EndOfLine};
let formatter = Formatter::new(FormatterOptions {
end_of_line: Some(EndOfLine::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_
includes - Canonical casing lookup table for NSIS bundled include library macros.
- 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§
- Formatter
- An NSIS script formatter.
- Formatter
Options - Configuration for the formatter.
Enums§
- EndOf
Line - Line ending style for formatted output.