-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement
reptr parse <file>
CLI command
- Loading branch information
Showing
4 changed files
with
22 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
pub mod parse_file; | ||
pub mod scan_dir; | ||
|
||
pub use parse_file::parse_file; | ||
pub use scan_dir::scan_dir; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
use std::{io, path::PathBuf}; | ||
|
||
use crate::common::try_load; | ||
|
||
pub fn parse_file(file_path: PathBuf) -> io::Result<()> { | ||
let source = try_load(&file_path)?; | ||
match dart_parser::parse(&source) { | ||
Ok(ast) => { | ||
println!("{ast:#?}"); | ||
} | ||
Err(e) => { | ||
println!("Error parsing file at path {file_path:?}\n\n{e}"); | ||
} | ||
} | ||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters