Add support for category comments in Nix option collection
The nix module now parses `/* */` comments as categories and associates them with subsequent options. The output format has been updated to include the category prefix before the option path. The internal state is maintained during traversal to ensure correct category propagation through nested structures.
This commit is contained in:
@@ -17,8 +17,8 @@ fn main() {
|
||||
eprintln!();
|
||||
}
|
||||
|
||||
let options: Vec<(String, bool)> = nix::collect_nix_options_with_path(&ast.syntax(), "");
|
||||
for (path, value) in options {
|
||||
println!("{} = {};", path, value);
|
||||
let options: Vec<(String, String, bool)> = nix::collect_nix_options(&ast.syntax());
|
||||
for (category, path, value) in options {
|
||||
println!("{}: {} = {};", category, path, value);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user