Expand description
Rewrite source written for the pre-0.11 operator grammar.
The old grammar spelled ranges a to b (inclusive) and a to b exclusive,
placed range formation just above |>, and bound ?? tighter than +.
migrate_legacy_operators parses a file under
OperatorGrammar::LEGACY, rewrites every range to a..=b or a..b, and
inserts parentheses wherever the current grammar would group an operand
differently. It then parses the result under the current grammar and
refuses the rewrite unless both trees match, so a migrated file always
keeps its meaning. Interpolation holes are migrated in place.
Enums§
- Operator
Migration Error - Why a file could not be migrated.
Functions§
- migrate_
legacy_ operators - Migrate
source. ReturnsOk(None)when the file needs no change.