about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/errors.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-02-26 12:04:59 +0100
committerGitHub <noreply@github.com>2023-02-26 12:04:59 +0100
commit786a75a65f54fbda9cf3a6c9e72a6de470549770 (patch)
tree6db855c50d9068c375e4067882aeef93536308d7 /compiler/rustc_parse/src/errors.rs
parent19b8685b061402a0b4b459a01eb224726a9a54ed (diff)
parent28501166367ac12ac11fcf4bb06261e2c8139988 (diff)
downloadrust-786a75a65f54fbda9cf3a6c9e72a6de470549770.tar.gz
rust-786a75a65f54fbda9cf3a6c9e72a6de470549770.zip
Rollup merge of #108418 - est31:parser_function_names, r=Nilstrieb
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`.
Diffstat (limited to 'compiler/rustc_parse/src/errors.rs')
0 files changed, 0 insertions, 0 deletions