Skip to content

Commit 3b29daa

Browse files
committed
fix more cspell warnings
1 parent b81ae9b commit 3b29daa

File tree

8 files changed

+150
-143
lines changed

8 files changed

+150
-143
lines changed

.cspell.dict/cpython.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,25 @@ HIGHRES
2525
IMMUTABLETYPE
2626
kwonlyarg
2727
kwonlyargs
28+
lasti
2829
linearise
2930
maxdepth
3031
mult
3132
nkwargs
33+
noraise
3234
numer
3335
orelse
3436
pathconfig
3537
patma
3638
posonlyarg
3739
posonlyargs
3840
prec
41+
preinitialized
3942
PYTHREAD_NAME
4043
SA_ONSTACK
4144
stackdepth
45+
stringlib
46+
structseq
4247
tok_oldval
4348
unaryop
4449
unparse

.cspell.dict/python-more.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ baserepl
1616
basicsize
1717
bdfl
1818
bigcharset
19+
bignum
1920
breakpointhook
2021
cformat
2122
chunksize

compiler/codegen/src/compile.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2143,16 +2143,16 @@ impl Compiler<'_> {
21432143
attrs: &[Identifier],
21442144
_patterns: &[Pattern],
21452145
) -> CompileResult<()> {
2146-
let nattrs = attrs.len();
2147-
for i in 0..nattrs {
2146+
let n_attrs = attrs.len();
2147+
for i in 0..n_attrs {
21482148
let attr = attrs[i].as_str();
21492149
// Check if the attribute name is forbidden in a Store context.
21502150
if self.forbidden_name(attr, NameUsage::Store)? {
21512151
// Return an error if the name is forbidden.
21522152
return Err(self.compile_error_forbidden_name(attr));
21532153
}
21542154
// Check for duplicates: compare with every subsequent attribute.
2155-
for ident in attrs.iter().take(nattrs).skip(i + 1) {
2155+
for ident in attrs.iter().take(n_attrs).skip(i + 1) {
21562156
let other = ident.as_str();
21572157
if attr == other {
21582158
todo!();
@@ -2184,20 +2184,20 @@ impl Compiler<'_> {
21842184
}
21852185

21862186
let nargs = patterns.len();
2187-
let nattrs = kwd_attrs.len();
2187+
let n_attrs = kwd_attrs.len();
21882188
let nkwd_patterns = kwd_patterns.len();
21892189

21902190
// Validate that keyword attribute names and patterns match in length.
2191-
if nattrs != nkwd_patterns {
2191+
if n_attrs != nkwd_patterns {
21922192
let msg = format!(
21932193
"kwd_attrs ({}) / kwd_patterns ({}) length mismatch in class pattern",
2194-
nattrs, nkwd_patterns
2194+
n_attrs, nkwd_patterns
21952195
);
21962196
unreachable!("{}", msg);
21972197
}
21982198

21992199
// Check for too many sub-patterns.
2200-
if nargs > u32::MAX as usize || (nargs + nattrs).saturating_sub(1) > i32::MAX as usize {
2200+
if nargs > u32::MAX as usize || (nargs + n_attrs).saturating_sub(1) > i32::MAX as usize {
22012201
let msg = format!(
22022202
"too many sub-patterns in class pattern {:?}",
22032203
match_class.cls
@@ -2207,7 +2207,7 @@ impl Compiler<'_> {
22072207
}
22082208

22092209
// Validate keyword attributes if any.
2210-
if nattrs != 0 {
2210+
if n_attrs != 0 {
22112211
self.validate_kwd_attrs(&kwd_attrs, &kwd_patterns)?;
22122212
}
22132213

@@ -2237,12 +2237,12 @@ impl Compiler<'_> {
22372237
// 5. Compare with IS_OP 1.
22382238
emit!(self, Instruction::IsOperation(true));
22392239

2240-
// At this point the TOS is a tuple of (nargs + nattrs) attributes (or None).
2240+
// At this point the TOS is a tuple of (nargs + n_attrs) attributes (or None).
22412241
pc.on_top += 1;
22422242
self.jump_to_fail_pop(pc, JumpOp::PopJumpIfFalse)?;
22432243

2244-
// Unpack the tuple into (nargs + nattrs) items.
2245-
let total = nargs + nattrs;
2244+
// Unpack the tuple into (nargs + n_attrs) items.
2245+
let total = nargs + n_attrs;
22462246
emit!(
22472247
self,
22482248
Instruction::UnpackSequence {
@@ -2280,12 +2280,12 @@ impl Compiler<'_> {
22802280
// let keys = &mapping.keys;
22812281
// let patterns = &mapping.patterns;
22822282
// let size = keys.len();
2283-
// let npatterns = patterns.len();
2283+
// let n_patterns = patterns.len();
22842284

2285-
// if size != npatterns {
2286-
// panic!("keys ({}) / patterns ({}) length mismatch in mapping pattern", size, npatterns);
2285+
// if size != n_patterns {
2286+
// panic!("keys ({}) / patterns ({}) length mismatch in mapping pattern", size, n_patterns);
22872287
// // return self.compiler_error(
2288-
// // &format!("keys ({}) / patterns ({}) length mismatch in mapping pattern", size, npatterns)
2288+
// // &format!("keys ({}) / patterns ({}) length mismatch in mapping pattern", size, n_patterns)
22892289
// // );
22902290
// }
22912291

src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,14 +233,14 @@ fn write_profile(settings: &Settings) -> Result<(), Box<dyn std::error::Error>>
233233
enum ProfileFormat {
234234
Html,
235235
Text,
236-
SpeedScore,
236+
SpeedScope,
237237
}
238238
let profile_output = settings.profile_output.as_deref();
239239
let profile_format = match settings.profile_format.as_deref() {
240240
Some("html") => ProfileFormat::Html,
241241
Some("text") => ProfileFormat::Text,
242242
None if profile_output == Some("-".as_ref()) => ProfileFormat::Text,
243-
Some("speedscope") | None => ProfileFormat::SpeedScore,
243+
Some("speedscope") | None => ProfileFormat::SpeedScope,
244244
Some(other) => {
245245
error!("Unknown profile format {}", other);
246246
// TODO: Need to change to ExitCode or Termination
@@ -251,7 +251,7 @@ fn write_profile(settings: &Settings) -> Result<(), Box<dyn std::error::Error>>
251251
let profile_output = profile_output.unwrap_or_else(|| match profile_format {
252252
ProfileFormat::Html => "flame-graph.html".as_ref(),
253253
ProfileFormat::Text => "flame.txt".as_ref(),
254-
ProfileFormat::SpeedScore => "flamescope.json".as_ref(),
254+
ProfileFormat::SpeedScope => "flamescope.json".as_ref(),
255255
});
256256

257257
let profile_output: Box<dyn io::Write> = if profile_output == "-" {
@@ -265,7 +265,7 @@ fn write_profile(settings: &Settings) -> Result<(), Box<dyn std::error::Error>>
265265
match profile_format {
266266
ProfileFormat::Html => flame::dump_html(profile_output)?,
267267
ProfileFormat::Text => flame::dump_text_to_writer(profile_output)?,
268-
ProfileFormat::SpeedScore => flamescope::dump(profile_output)?,
268+
ProfileFormat::SpeedScope => flamescope::dump(profile_output)?,
269269
}
270270

271271
Ok(())

0 commit comments

Comments
 (0)