Skip to content

Commit

Permalink
(momo) Updated to RON with error locations
Browse files Browse the repository at this point in the history
  • Loading branch information
juntyr committed Dec 31, 2021
1 parent a2aef7a commit 42b4d91
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 19 deletions.
30 changes: 15 additions & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ with
```
Here, `args..` is a configuration string in [RON](https://github.com/ron-rs/ron) format, which can also directly be read from a configuration file:
```shell
> rustcoalescence <SUBCOMMAND> $(<config.ron)
> rustcoalescence <SUBCOMMAND> "$(<config.ron)"
```
Please refer to [docs/simulate.ron](docs/simulate.ron) and [docs/replay.ron](docs/replay.ron) for a detailed description of all configuration options. [./simulate.ron](simulate.ron) and [./replay.ron](replay.ron) also provide example configurations.

Expand Down
2 changes: 1 addition & 1 deletion rustcoalescence/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ structopt = "0.3"
anyhow = "1.0"
contracts = { git = "https://gitlab.com/MomoLangenstein/contracts", rev = "3a44375a" }
serde = { version = "1.0", features = ["derive"] }
ron = { git = "https://github.com/ron-rs/ron.git", rev = "521e639" }
ron = { git = "https://github.com/MomoLangenstein/ron.git", rev = "6ce56de", features = ["integer128"] }
log = { version = "0.4", features = ["std"] }
colored = "2.0"
thiserror = "1.0"
Expand Down
6 changes: 4 additions & 2 deletions rustcoalescence/src/args/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,16 @@ pub fn try_parse<'de, D: Deserialize<'de>>(subcommand: &str, ron_args: &'de str)
Ok(args) => Ok(args),
Err(err) => {
let path = track.path();
let err = de_ron.error(err);

Err(anyhow::anyhow!(
"{}{}{}{}: {}",
"{}{}{}{} @ ({}):\n{}",
subcommand,
if path.iter().count() >= 1 { "." } else { "" },
path,
if path.iter().count() >= 1 { "" } else { "*" },
err,
err.position,
err.code,
))
},
}
Expand Down

0 comments on commit 42b4d91

Please sign in to comment.