mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-02 11:22:19 +00:00
Feedback: add doc comments, verbiage changes, capitalize Roc, remove a resolved TODO
This commit is contained in:
parent
413de7f72e
commit
df915b936d
6 changed files with 93 additions and 12 deletions
|
@ -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() {
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue