Merge pull request #1787 from kianmeng/fix-typos

Fix typos
This commit is contained in:
Max Brunsfeld 2022-08-25 10:25:39 -07:00 committed by GitHub
commit 6b87326470
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 17 additions and 17 deletions

View file

@ -598,7 +598,7 @@ impl<'a> ParseTableBuilder<'a> {
.unwrap();
write!(&mut msg, "Possible interpretations:\n\n").unwrap();
let mut interpretions = conflicting_items
let mut interpretations = conflicting_items
.iter()
.map(|item| {
let mut line = String::new();
@ -652,13 +652,13 @@ impl<'a> ParseTableBuilder<'a> {
})
.collect::<Vec<_>>();
let max_interpretation_length = interpretions
let max_interpretation_length = interpretations
.iter()
.map(|i| i.0.chars().count())
.max()
.unwrap();
interpretions.sort_unstable();
for (i, (line, prec_suffix)) in interpretions.into_iter().enumerate() {
interpretations.sort_unstable();
for (i, (line, prec_suffix)) in interpretations.into_iter().enumerate() {
write!(&mut msg, " {}:", i + 1).unwrap();
msg += &line;
if let Some(prec_suffix) = prec_suffix {

View file

@ -70,7 +70,7 @@ pub(crate) enum Rule {
// Because tokens are represented as small (~400 max) unsigned integers,
// sets of tokens can be efficiently represented as bit vectors with each
// index correspoding to a token, and each value representing whether or not
// index corresponding to a token, and each value representing whether or not
// the token is present in the set.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub(crate) struct TokenSet {

View file

@ -511,7 +511,7 @@ fn test_parsing_after_detecting_error_in_the_middle_of_a_string_token() {
// Delete a suffix of the source code, starting in the middle of the string
// literal, after some whitespace. With this deletion, the remaining string
// content: "c, " looks like two valid python tokens: an identifier and a comma.
// When this edit is undone, in order correctly recover the orginal tree, the
// When this edit is undone, in order correctly recover the original tree, the
// parser needs to remember that before matching the `c` as an identifier, it
// lookahead ahead several bytes, trying to find the closing quotation mark in
// order to match the "string content" node.

View file

@ -2947,7 +2947,7 @@ fn test_query_captures_with_many_nested_results_with_fields() {
.unwrap();
// The outer expression does not match the pattern, but the consequence of the ternary
// is an object that *does* contain many occurences of the pattern.
// is an object that *does* contain many occurrences of the pattern.
let count = 50;
let mut source = "a ? {".to_owned();
for i in 0..count {