mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-13 00:56:14 +00:00
786a75a65f
Replace parse_[sth]_expr with parse_expr_[sth] function names This resolves an inconsistency in naming style for functions on the parser, where: * functions parsing specific kinds of items are named `parse_item_[sth]` and * functions parsing specific kinds of *expressions* are named `parse_[sth]_expr` favoring the style used by functions for items. There are multiple advantages of that style: * functions of both categories are collected in the same place in the [rustdoc output](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_parse/parser/struct.Parser.html). * it helps with autocompletion, as you can narrow down your search for a function to those about expressions. * it mirrors rust's path syntax where less specific things come first, then it gets more specific, i.e. `std::collections::hash_map::Entry`. The disadvantage is that it doesn't "read like a sentence" any more. But I think the advantages weigh more greatly. This change was mostly application of this command: ``` sed -i -E 's/(fn |\.)parse_([[:alnum:]_]+)_expr/\1parse_expr_\2/' compiler/rustc_parse/src/parser/*.rs ``` Plus very minor fixes outside of `rustc_parse`, and an invocation of `x fmt`. |
||
---|---|---|
.. | ||
locales | ||
src | ||
Cargo.toml |