Skip to content

Commit 21afc19

Browse files
committed
Update cspell for compiler
1 parent e800af7 commit 21afc19

File tree

35 files changed

+356
-356
lines changed

35 files changed

+356
-356
lines changed

.cspell.json

Lines changed: 120 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -26,121 +26,171 @@
2626
"words": [
2727
// Rust
2828
"ahash",
29-
"bitflags",
3029
"bindgen",
31-
"cstring",
30+
"bitflags",
3231
"chrono",
32+
"cstring",
3333
"flate2",
34+
"hasher",
35+
"indexmap",
3436
"insta",
35-
"peekable",
37+
"keccak",
3638
"lalrpop",
37-
"memmap",
3839
"Manually",
40+
"memmap",
41+
"peekable",
42+
"prepended",
3943
"rustc",
44+
"rustfmt",
4045
"splitn",
41-
"unistd",
4246
"unic",
47+
"unistd",
4348
// Python
49+
"abstractmethods",
50+
"aiter",
51+
"anext",
52+
"basicsize",
4453
"cformat",
54+
"classcell",
4555
"cpython",
46-
"fspath",
47-
"kwarg",
48-
"kwargs",
49-
"vararg",
50-
"varargs",
51-
"metaclass",
52-
"metaclasses",
53-
"fstring",
54-
"fstrings",
56+
"defaultaction",
57+
"descr",
58+
"dictcomp",
5559
"docstring",
5660
"docstrings",
61+
"dunder",
62+
"eventmask",
63+
"fdel",
5764
"fileencoding",
65+
"finallyhandler",
66+
"fspath",
67+
"fstring",
68+
"fstrings",
69+
"genexpr",
70+
"getattro",
71+
"getweakrefcount",
72+
"getweakrefs",
73+
"idiv",
74+
"impls",
75+
"instanceof",
76+
"itemsize",
77+
"iternext",
78+
"kwarg",
79+
"kwargs",
5880
"linearization",
5981
"linearize",
82+
"listcomp",
83+
"mappingproxy",
84+
"maxsplit",
85+
"MemoryView",
86+
"metaclass",
87+
"metaclasses",
88+
"metatype",
89+
"ndim",
90+
"nonbytes",
91+
"origname",
6092
"PYTHONDEBUG",
93+
"PYTHONHOME",
6194
"PYTHONINSPECT",
95+
"PYTHONOPTIMIZE",
6296
"PYTHONPATH",
63-
"PYTHONHOME",
6497
"PYTHONPATH",
6598
"PYTHONVERBOSE",
66-
"PYTHONOPTIMIZE",
6799
"PYTHONWARNINGS",
68-
"basicsize",
69-
"itemsize",
70-
"origname",
71-
"getattro",
72-
"setattro",
73-
"iternext",
74-
"maxsplit",
75-
"fdel",
76-
"subclasscheck",
77100
"qualname",
78-
"eventmask",
79-
"instanceof",
80-
"abstractmethods",
81-
"aiter",
82-
"anext",
83101
"rdiv",
84-
"idiv",
85-
"ndim",
102+
"setattro",
103+
"setcomp",
104+
"stacklevel",
105+
"subclasscheck",
86106
"unionable",
107+
"unraisablehook",
108+
"vararg",
109+
"varargs",
87110
"varnames",
88-
"getweakrefs",
89-
"getweakrefcount",
90-
"stacklevel",
91-
"MemoryView",
92-
"metatype",
93111
"warningregistry",
94-
"defaultaction",
95-
"unraisablehook",
96-
"descr",
97-
"xopts",
98112
"warnopts",
99113
"weakproxy",
100-
"mappingproxy",
114+
"xopts",
101115
// RustPython
102-
"RustPython",
116+
"Bytecode",
117+
"codegen",
118+
"dedentations",
119+
"dedents",
120+
"deduped",
121+
"dumpable",
122+
"GetSet",
123+
"makeunicodedata",
124+
"miri",
125+
"pyarg",
103126
"pyarg",
104127
"pyargs",
105-
"pygetset",
106-
"pyobj",
107-
"pystr",
128+
"PyAttr",
108129
"pyc",
109-
"pyref",
110-
"pyslot",
111-
"PyFunction",
112-
"PyMethod",
113-
"PyClassMethod",
114-
"PyStaticMethod",
115-
"PyProperty",
116130
"PyClass",
131+
"PyClassMethod",
132+
"PyException",
133+
"PyFunction",
134+
"pygetset",
117135
"pyimpl",
118-
"pyarg",
136+
"PyMethod",
119137
"PyModule",
120-
"PyAttr",
121-
"PyResult",
138+
"pyobj",
122139
"PyObject",
123-
"PyException",
124-
"GetSet",
125-
"zelf",
126-
"wasi",
127-
"Bytecode",
140+
"PyProperty",
141+
"pyref",
142+
"PyResult",
143+
"pyslot",
144+
"PyStaticMethod",
145+
"pystr",
128146
"richcompare",
129-
"makeunicodedata",
130-
"unhashable",
131-
"unraisable",
147+
"RustPython",
148+
"tracebacks",
132149
"typealiases",
133150
"Unconstructible",
134-
"posonlyargs",
135-
"kwonlyargs",
151+
"unhashable",
136152
"uninit",
137-
"miri",
138-
"tracebacks",
153+
"unraisable",
154+
"wasi",
155+
"zelf",
139156
// cpython
140-
"linearise",
157+
"argtypes",
158+
"asdl",
159+
"asname",
160+
"augassign",
161+
"boolop",
162+
"bxor",
163+
"cellarg",
164+
"cellvar",
165+
"cellvars",
166+
"cmpop",
141167
"dictoffset",
168+
"elts",
169+
"excepthandler",
170+
"finalbody",
171+
"freevar",
172+
"freevars",
173+
"fromlist",
142174
"heaptype",
143-
"IMMUTABLETYPE"
175+
"IMMUTABLETYPE",
176+
"kwonlyarg",
177+
"kwonlyargs",
178+
"linearise",
179+
"maxdepth",
180+
"mult",
181+
"nkwargs",
182+
"orelse",
183+
"patma",
184+
"posonlyarg",
185+
"posonlyargs",
186+
"prec",
187+
"stackdepth",
188+
"unaryop",
189+
"unparse",
190+
"unparser",
191+
"VARKEYWORDS",
192+
"varkwarg",
193+
"withitem"
144194
],
145195
// flagWords - list of words to be always considered incorrect
146196
"flagWords": [

compiler/ast/src/unparse.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ impl<'a> Unparser<'a> {
4848
}
4949

5050
fn unparse_expr<U>(&mut self, ast: &Expr<U>, level: u8) -> fmt::Result {
51-
macro_rules! opprec {
52-
($opty:ident, $x:expr, $enu:path, $($var:ident($op:literal, $prec:ident)),*$(,)?) => {
51+
macro_rules! op_prec {
52+
($op_ty:ident, $x:expr, $enu:path, $($var:ident($op:literal, $prec:ident)),*$(,)?) => {
5353
match $x {
54-
$(<$enu>::$var => (opprec!(@space $opty, $op), precedence::$prec),)*
54+
$(<$enu>::$var => (op_prec!(@space $op_ty, $op), precedence::$prec),)*
5555
}
5656
};
5757
(@space bin, $op:literal) => {
@@ -72,7 +72,7 @@ impl<'a> Unparser<'a> {
7272
}
7373
match &ast.node {
7474
ExprKind::BoolOp { op, values } => {
75-
let (op, prec) = opprec!(bin, op, Boolop, And("and", AND), Or("or", OR));
75+
let (op, prec) = op_prec!(bin, op, Boolop, And("and", AND), Or("or", OR));
7676
group_if!(prec, {
7777
let mut first = true;
7878
for val in values {
@@ -89,8 +89,8 @@ impl<'a> Unparser<'a> {
8989
})
9090
}
9191
ExprKind::BinOp { left, op, right } => {
92-
let rassoc = matches!(op, Operator::Pow);
93-
let (op, prec) = opprec!(
92+
let right_associative = matches!(op, Operator::Pow);
93+
let (op, prec) = op_prec!(
9494
bin,
9595
op,
9696
Operator,
@@ -109,13 +109,13 @@ impl<'a> Unparser<'a> {
109109
FloorDiv("//", TERM),
110110
);
111111
group_if!(prec, {
112-
self.unparse_expr(left, prec + rassoc as u8)?;
112+
self.unparse_expr(left, prec + right_associative as u8)?;
113113
self.p(op)?;
114-
self.unparse_expr(right, prec + !rassoc as u8)?;
114+
self.unparse_expr(right, prec + !right_associative as u8)?;
115115
})
116116
}
117117
ExprKind::UnaryOp { op, operand } => {
118-
let (op, prec) = opprec!(
118+
let (op, prec) = op_prec!(
119119
un,
120120
op,
121121
crate::Unaryop,
@@ -131,8 +131,8 @@ impl<'a> Unparser<'a> {
131131
}
132132
ExprKind::Lambda { args, body } => {
133133
group_if!(precedence::TEST, {
134-
let npos = args.args.len() + args.posonlyargs.len();
135-
self.p(if npos > 0 { "lambda " } else { "lambda" })?;
134+
let pos = args.args.len() + args.posonlyargs.len();
135+
self.p(if pos > 0 { "lambda " } else { "lambda" })?;
136136
self.unparse_args(args)?;
137137
write!(self, ": {}", **body)?;
138138
})
@@ -260,7 +260,7 @@ impl<'a> Unparser<'a> {
260260
[],
261261
) = (&**args, &**keywords)
262262
{
263-
// make sure a single genexp doesn't get double parens
263+
// make sure a single genexpr doesn't get double parens
264264
self.unparse_expr(elt, precedence::TEST)?;
265265
self.unparse_comp(generators)?;
266266
} else {
@@ -287,7 +287,7 @@ impl<'a> Unparser<'a> {
287287
conversion,
288288
format_spec,
289289
} => self.unparse_formatted(value, *conversion, format_spec.as_deref())?,
290-
ExprKind::JoinedStr { values } => self.unparse_joinedstr(values, false)?,
290+
ExprKind::JoinedStr { values } => self.unparse_joined_str(values, false)?,
291291
ExprKind::Constant { value, kind } => {
292292
if let Some(kind) = kind {
293293
self.p(kind)?;
@@ -490,7 +490,7 @@ impl<'a> Unparser<'a> {
490490
unreachable!()
491491
}
492492
}
493-
ExprKind::JoinedStr { values } => self.unparse_joinedstr(values, is_spec),
493+
ExprKind::JoinedStr { values } => self.unparse_joined_str(values, is_spec),
494494
ExprKind::FormattedValue {
495495
value,
496496
conversion,
@@ -505,7 +505,7 @@ impl<'a> Unparser<'a> {
505505
self.p(&s)
506506
}
507507

508-
fn unparse_joinedstr<U>(&mut self, values: &[Expr<U>], is_spec: bool) -> fmt::Result {
508+
fn unparse_joined_str<U>(&mut self, values: &[Expr<U>], is_spec: bool) -> fmt::Result {
509509
if is_spec {
510510
self.unparse_fstring_body(values, is_spec)
511511
} else {

0 commit comments

Comments
 (0)