Skip to content

Commit

Permalink
chore: update readme and examples (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
KennedyTedesco committed Jan 23, 2023
1 parent 4c55576 commit dfa107b
Showing 1 changed file with 16 additions and 19 deletions.
35 changes: 16 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,31 +25,28 @@ ara_parser = "0.6.1"

```rust
use ara_parser::parser;
use ara_reporting::builder::Charset;
use ara_reporting::builder::CharSet;
use ara_reporting::builder::ColorChoice;
use ara_reporting::builder::ReportBuilder;
use ara_reporting::error::Error;
use ara_source::loader::load_directories;

fn main() -> Result<(), Error> {

let source_map = load_directories("/path/to/project", vec![
"src/"
]).unwrap();

match parser::parse_map(&source_map) {
Ok(tree_map) => tree_map.trees.iter().for_each(|tree| {
println!("{:#?}", tree.definitions);
}),
Err(report) => {
ReportBuilder::new(&source_map, report)
.with_charset(Charset::Unicode)
.with_colors(ColorChoice::Always)
.print()?;
}
}

Ok(())
let source_map = load_directories("/path/to/project", vec!["src/"]).unwrap();

match parser::parse_map(&source_map) {
Ok(tree_map) => tree_map.trees.iter().for_each(|tree| {
println!("{:#?}", tree.definitions);
}),
Err(report) => {
ReportBuilder::new(&source_map)
.with_charset(CharSet::Unicode)
.with_colors(ColorChoice::Always)
.print(report.as_ref())?;
}
}

Ok(())
}
```

Expand Down

0 comments on commit dfa107b

Please sign in to comment.