diff options
| author | Miquel Sabaté Solà <mikisabate@gmail.com> | 2025-01-09 16:32:34 +0100 |
|---|---|---|
| committer | Miquel Sabaté Solà <mikisabate@gmail.com> | 2025-01-09 16:32:34 +0100 |
| commit | a4a68fdb178722e23e007b1f6bf72474caae4e97 (patch) | |
| tree | f014b783d301c9ceb878c783ba2b7b2054772cfe /lib/xixanta/src/parser.rs | |
| parent | 92092ccc245269e0c3a864d06f7e382a5bb9d8b0 (diff) | |
| download | tools.nes-a4a68fdb178722e23e007b1f6bf72474caae4e97.tar.gz tools.nes-a4a68fdb178722e23e007b1f6bf72474caae4e97.zip | |
Rename SourceInfo::working_directory to directory
Also documented the struct as it is exported.
Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
Diffstat (limited to 'lib/xixanta/src/parser.rs')
| -rw-r--r-- | lib/xixanta/src/parser.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/xixanta/src/parser.rs b/lib/xixanta/src/parser.rs index 6ea23f4..2e938d3 100644 --- a/lib/xixanta/src/parser.rs +++ b/lib/xixanta/src/parser.rs @@ -59,8 +59,7 @@ impl Parser { // be initialized by the caller already). The `current_source` is simply // the one we push upon initialization. self.sources.push(SourceInfo { - working_directory: path::absolute(&source.working_directory) - .unwrap_or(source.working_directory), + directory: path::absolute(&source.directory).unwrap_or(source.directory), name: source.name, }); self.current_source = self.sources.len() - 1; @@ -631,7 +630,7 @@ impl Parser { let Some(current_source) = self.sources.get(self.current_source) else { panic!("mismatch between the number of sources and the current one"); }; - let abs_file = current_source.working_directory.join(file_path); + let abs_file = current_source.directory.join(file_path); // Validate that this is really a path that points to a file. let path = std::path::Path::new(&abs_file); @@ -680,7 +679,7 @@ impl Parser { parser.parse( file, SourceInfo { - working_directory: parent.to_path_buf(), + directory: parent.to_path_buf(), name: path.file_name().unwrap().to_str().unwrap().to_string(), }, )?; |
