Feedback: add doc comments, verbiage changes, capitalize Roc, remove a resolved TODO

This commit is contained in:
Joshua Warner 2024-07-28 12:01:20 -07:00
parent 413de7f72e
commit df915b936d
No known key found for this signature in database
GPG key ID: 89AD497003F93FDD
6 changed files with 93 additions and 12 deletions

View file

@ -1,3 +1,15 @@
//! Generate a minimized version of a given input, by removing parts of it.
//! This is useful for debugging, when you have a large input that causes a failure,
//! and you want to find the smallest input that still causes the failure.
//!
//! Typical usage:
//! `cargo run --release --bin minimize -- full <file_that_triggers_parsing_bug>`
//!
//! This tool will churn on that for a while, and eventually print out a minimized version
//! of the input that still triggers the bug.
//!
//! Note that `--release` is important, as this tool is very slow in debug mode.
use test_syntax::{minimize::print_minimizations, test_helpers::InputKind};
fn main() {

View file

@ -1,3 +1,10 @@
//! Generate a minimized version of a given input, by removing parts of it.
//! This is useful for debugging, when you have a large input that causes a failure,
//! and you want to find the smallest input that still causes the failure.
//!
//! Most users will want to use the binary instead of this module directly.
//! e.g. `cargo run --release --bin minimize -- full <file_that_triggers_parsing_bug>`
use crate::test_helpers::{Input, InputKind};
use bumpalo::Bump;
use roc_parse::{ast::Malformed, remove_spaces::RemoveSpaces};
@ -79,7 +86,7 @@ fn round_trip_once(input: Input<'_>) -> Option<String> {
"Initial parse failed: {:?}",
e.remove_spaces(&arena)
))
} // todo: strip pos info, use the error
}
};
if actual.is_malformed() {