Fix typos in comments and exception message (#122147)

This commit is contained in:
Xie Yanbo 2024-07-23 17:04:14 +08:00 committed by GitHub
parent 47847aa8ef
commit 2a5d1eb707
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 3 deletions

View File

@ -1594,7 +1594,7 @@ _PyPegen_concatenate_strings(Parser *p, asdl_expr_seq *strings,
for (i = 0; i < n_flattened_elements; i++) { for (i = 0; i < n_flattened_elements; i++) {
expr_ty elem = asdl_seq_GET(flattened, i); expr_ty elem = asdl_seq_GET(flattened, i);
/* The concatenation of a FormattedValue and an empty Contant should /* The concatenation of a FormattedValue and an empty Constant should
lead to the FormattedValue itself. Thus, we will not take any empty lead to the FormattedValue itself. Thus, we will not take any empty
constants into account, just as in `_PyPegen_joined_str` */ constants into account, just as in `_PyPegen_joined_str` */
if (f_string_found && elem->kind == Constant_kind && if (f_string_found && elem->kind == Constant_kind &&

View File

@ -131,7 +131,7 @@ class EmitVisitor(asdl.VisitorBase):
def metadata(self): def metadata(self):
if self._metadata is None: if self._metadata is None:
raise ValueError( raise ValueError(
"%s was expecting to be annnotated with metadata" "%s was expecting to be annotated with metadata"
% type(self).__name__ % type(self).__name__
) )
return self._metadata return self._metadata

View File

@ -155,7 +155,7 @@ _Pypegen_raise_decode_error(Parser *p)
static int static int
_PyPegen_tokenize_full_source_to_check_for_errors(Parser *p) { _PyPegen_tokenize_full_source_to_check_for_errors(Parser *p) {
// Tokenize the whole input to see if there are any tokenization // Tokenize the whole input to see if there are any tokenization
// errors such as mistmatching parentheses. These will get priority // errors such as mismatching parentheses. These will get priority
// over generic syntax errors only if the line number of the error is // over generic syntax errors only if the line number of the error is
// before the one that we had for the generic error. // before the one that we had for the generic error.