Collapses every run of whitespace (spaces, tabs, newlines) to a single
space and trims the result. Used to compare code that dart format may
have re-indented or wrapped across multiple physical lines, so matching
stays stable regardless of formatting.
Merges physical source lines into logical statements so that line-based
scanning is immune to how dart format wraps code. dart format may
split one statement across several physical lines (e.g. a long
field = json['key']; becomes field = + json['key'];). This joins
the continuation lines back together — accumulating until the buffered
text ends with ;, { or } — so callers see each statement whole,
with its tokens on a single logical line, regardless of formatting.
ratingStar, rating_star and rating-star all become RATING_STAR.
Callers build SCREAMING_SNAKE_CASE constant names from user input, which
a plain toUpperCase() mangles for camelCase arguments (RATINGSTAR).