Skip to content

Commit 79fbb67

Browse files
authored
Fix typos across the tree (#1133)
* Fix typos across the tree They were found thanks to the typos[1] tool. [1] https://github.com/crate-ci/typos * Add a typos.toml file This one instructs typos to ignore the false positives found in this repository.
1 parent 11f45aa commit 79fbb67

File tree

8 files changed

+22
-15
lines changed

8 files changed

+22
-15
lines changed

generator/src/docs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use pest::iterators::Pairs;
44
use pest_meta::parser::Rule;
55
use std::collections::HashMap;
66

7-
/// Abstraction for the grammer and rule doc.
7+
/// Abstraction for the grammar and rule doc.
88
#[derive(Debug)]
99
pub struct DocComment {
1010
/// The grammar documentation is defined at the beginning of a file with //!.

grammars/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ mod tests {
294294
)),
295295
sql::Rule::CreateUser => Some(String::from("Expected user creation.")),
296296
sql::Rule::SingleQuotedString => {
297-
Some(String::from("Add a string in single qoutes."))
297+
Some(String::from("Add a string in single quotes."))
298298
}
299299
sql::Rule::Query => Some(String::from("DML query expected.")),
300300
sql::Rule::Expr => Some(String::from("Expected expression.")),
@@ -334,10 +334,10 @@ mod tests {
334334
.join("\n")
335335
);
336336

337-
let user_creation_password_without_single_qoutes = r#"create user
337+
let user_creation_password_without_single_quotes = r#"create user
338338
Bob password "wrong""#;
339339
assert_eq!(
340-
retrieve_parse_attempts_error_string(user_creation_password_without_single_qoutes),
340+
retrieve_parse_attempts_error_string(user_creation_password_without_single_quotes),
341341
[
342342
" --> 2:81",
343343
" |",
@@ -347,7 +347,7 @@ mod tests {
347347
" = error: parsing error occurred.",
348348
" note: expected one of tokens: WHITESPACE, `''`, `'`",
349349
" help: Expected user creation.",
350-
" - Add a string in single qoutes.",
350+
" - Add a string in single quotes.",
351351
]
352352
.join("\n")
353353
);

meta/src/ast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ pub enum RuleType {
5454
/// There may be non-breaking changes to the meta-grammar
5555
/// between minor versions. Those non-breaking changes, however,
5656
/// may translate into semver-breaking changes due to the additional variants
57-
/// propaged from the `Rule` enum. This is a known issue and will be fixed in the
57+
/// propagated from the `Rule` enum. This is a known issue and will be fixed in the
5858
/// future (e.g. by increasing MSRV and non_exhaustive annotations).
5959
#[derive(Clone, Debug, Eq, PartialEq)]
6060
pub enum Expr {

meta/src/optimizer/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ mod concatenator;
2424
mod factorizer;
2525
mod lister;
2626
mod restorer;
27-
mod rotater;
27+
mod rotator;
2828
mod skipper;
2929
mod unroller;
3030

@@ -33,7 +33,7 @@ pub fn optimize(rules: Vec<Rule>) -> Vec<OptimizedRule> {
3333
let map = to_hash_map(&rules);
3434
let optimized: Vec<OptimizedRule> = rules
3535
.into_iter()
36-
.map(rotater::rotate)
36+
.map(rotator::rotate)
3737
.map(|rule| skipper::skip(rule, &map))
3838
.map(unroller::unroll)
3939
.map(concatenator::concatenate)
@@ -120,7 +120,7 @@ pub struct OptimizedRule {
120120
/// There may be non-breaking changes to the meta-grammar
121121
/// between minor versions. Those non-breaking changes, however,
122122
/// may translate into semver-breaking changes due to the additional variants
123-
/// propaged from the `Rule` enum. This is a known issue and will be fixed in the
123+
/// propagated from the `Rule` enum. This is a known issue and will be fixed in the
124124
/// future (e.g. by increasing MSRV and non_exhaustive annotations).
125125
#[derive(Clone, Debug, Eq, PartialEq)]
126126
pub enum OptimizedExpr {

meta/src/validator.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ fn validate_tag_silent_rules<'a, 'i: 'a>(rules: &'a [ParserRule<'i>]) -> Vec<Err
325325
///
326326
/// # Assumptions
327327
/// - In `ParserExpr::RepMinMax(inner,min,max)`, `min<=max`
328-
/// - All rules identiers have a matching definition
328+
/// - All rules identifiers have a matching definition
329329
/// - There is no left-recursion (if only this one is broken returns false)
330330
/// - Every expression is being checked
331331
fn is_non_progressing<'i>(
@@ -421,7 +421,7 @@ fn is_non_progressing<'i>(
421421
/// # Assumptions
422422
/// - In `ParserExpr::RepMinMax(inner,min,max)`, `min<=max`
423423
/// - In `ParserExpr::PeekSlice(max,Some(min))`, `max>=min`
424-
/// - All rules identiers have a matching definition
424+
/// - All rules identifiers have a matching definition
425425
/// - There is no left-recursion
426426
/// - All rules are being checked
427427
fn is_non_failing<'i>(
@@ -459,7 +459,7 @@ fn is_non_failing<'i>(
459459
} else {
460460
// referring to another rule R that was already seen
461461
// WARNING: this might mean there is a circular non-failing path
462-
// it's not obvious wether this can happen without left-recursion
462+
// it's not obvious whether this can happen without left-recursion
463463
// and thus breaking the assumption. Until there is answer to
464464
// this, to avoid changing behaviour we return:
465465
false

pest/src/parser_state.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ impl<R: RuleType> ParseAttempts<R> {
428428
}
429429

430430
/// Reset state in case we've successfully parsed some token in
431-
/// `match_string` or `match_insensetive`.
431+
/// `match_string` or `match_insensitive`.
432432
fn nullify_expected_tokens(&mut self, new_max_position: usize) {
433433
self.call_stacks.clear();
434434
self.expected_tokens.clear();
@@ -701,7 +701,7 @@ impl<'i, R: RuleType> ParserState<'i, R> {
701701

702702
let mut try_add_rule_to_stack = |new_state: &mut Box<ParserState<'_, R>>| {
703703
if new_state.parse_attempts.max_position > remember_max_position {
704-
// It means that one of `match_string` or e.g. `match_insensetive` function calls
704+
// It means that one of `match_string` or e.g. `match_insensitive` function calls
705705
// have already erased `self.parse_attempts.call_stacks` and that previously
706706
// remembered values are not valid anymore.
707707
remember_call_stacks_number = 0;
@@ -1016,7 +1016,7 @@ impl<'i, R: RuleType> ParserState<'i, R> {
10161016
token: ParsingToken,
10171017
parse_succeeded: bool,
10181018
) {
1019-
// New position after tracked parsed element for case of `parse_succeded` is true.
1019+
// New position after tracked parsed element for case of `parse_succeeded` is true.
10201020
// Position of parsing failure otherwise.
10211021
let current_pos = self.position.pos();
10221022

typos.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[files]
2+
extend-exclude = ["grammars/benches/requests.http", "grammars/benches/main.i18n.json"]
3+
4+
[default.extend-words]
5+
ba = "ba"
6+
tham = "tham"
7+
vai = "vai"

0 commit comments

Comments
 (0)