Skip to content

Update cspell #4698

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
215 changes: 146 additions & 69 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,120 +26,197 @@
"words": [
// Rust
"ahash",
"bitflags",
"bindgen",
"cstring",
"bitflags",
"chrono",
"cstring",
"flate2",
"hasher",
"idents",
"indexmap",
"insta",
"peekable",
"keccak",
"lalrpop",
"memmap",
"libc",
"Manually",
"maplit",
"memmap",
"metas",
"peekable",
"prepended",
"punct",
"rustc",
"rustfmt",
"splitn",
"unistd",
"trai",
"unic",
"unistd",
// Python
"abstractmethods",
"aiter",
"anext",
"basicsize",
"cformat",
"classcell",
"codepoint",
"cpython",
"fspath",
"kwarg",
"kwargs",
"vararg",
"varargs",
"metaclass",
"metaclasses",
"fstring",
"fstrings",
"defaultaction",
"descr",
"dictcomp",
"docstring",
"docstrings",
"dunder",
"eventmask",
"fdel",
"fileencoding",
"finallyhandler",
"fspath",
"fstring",
"fstrings",
"genexpr",
"getattro",
"getformat",
"getnewargs",
"getweakrefcount",
"getweakrefs",
"idiv",
"impls",
"instancecheck",
"instanceof",
"itemsize",
"iternext",
"kwarg",
"kwargs",
"linearization",
"linearize",
"listcomp",
"mappingproxy",
"maxsplit",
"MemoryView",
"metaclass",
"metaclasses",
"metatype",
"ndim",
"nonbytes",
"origname",
"PYTHONDEBUG",
"PYTHONHOME",
"PYTHONINSPECT",
"PYTHONOPTIMIZE",
"PYTHONPATH",
"PYTHONHOME",
"PYTHONPATH",
"PYTHONVERBOSE",
"PYTHONOPTIMIZE",
"PYTHONWARNINGS",
"basicsize",
"itemsize",
"origname",
"getattro",
"setattro",
"iternext",
"maxsplit",
"fdel",
"subclasscheck",
"qualname",
"eventmask",
"instanceof",
"abstractmethods",
"aiter",
"anext",
"rdiv",
"idiv",
"ndim",
"setattro",
"setcomp",
"stacklevel",
"subclasscheck",
"subclasshook",
"unionable",
"unraisablehook",
"vararg",
"varargs",
"varnames",
"getweakrefs",
"getweakrefcount",
"stacklevel",
"MemoryView",
"metatype",
"warningregistry",
"defaultaction",
"unraisablehook",
"descr",
"xopts",
"warnopts",
"weakproxy",
"mappingproxy",
"xopts",
// RustPython
"RustPython",
"baseclass",
"Bytecode",
"cfgs",
"codegen",
"dedentations",
"dedents",
"deduped",
"downcasted",
"dumpable",
"GetSet",
"internable",
"makeunicodedata",
"miri",
"notrace",
"pyarg",
"pyarg",
"pyargs",
"pygetset",
"pyobj",
"pystr",
"PyAttr",
"pyc",
"pyref",
"pyslot",
"PyFunction",
"PyMethod",
"PyClassMethod",
"PyStaticMethod",
"PyProperty",
"PyClass",
"PyClassMethod",
"PyException",
"PyFunction",
"pygetset",
"pyimpl",
"pyarg",
"pymember",
"PyMethod",
"PyModule",
"PyAttr",
"PyResult",
"pyname",
"pyobj",
"PyObject",
"PyException",
"GetSet",
"zelf",
"wasi",
"Bytecode",
"pypayload",
"PyProperty",
"pyref",
"PyResult",
"pyslot",
"PyStaticMethod",
"pystr",
"pystruct",
"pystructseq",
"pytrace",
"richcompare",
"makeunicodedata",
"unhashable",
"unraisable",
"RustPython",
"struc",
"tracebacks",
"typealiases",
"Unconstructible",
"posonlyargs",
"kwonlyargs",
"unhashable",
"uninit",
"miri",
"unraisable",
"wasi",
"zelf",
// cpython
"linearise",
"argtypes",
"asdl",
"asname",
"augassign",
"badsyntax",
"basetype",
"boolop",
"bxor",
"cellarg",
"cellvar",
"cellvars",
"cmpop",
"dictoffset",
"elts",
"excepthandler",
"finalbody",
"freevar",
"freevars",
"fromlist",
"heaptype",
"IMMUTABLETYPE"
"IMMUTABLETYPE",
"kwonlyarg",
"kwonlyargs",
"linearise",
"maxdepth",
"mult",
"nkwargs",
"orelse",
"patma",
"posonlyarg",
"posonlyargs",
"prec",
"stackdepth",
"unaryop",
"unparse",
"unparser",
"VARKEYWORDS",
"varkwarg",
"withitem",
"withs"
],
// flagWords - list of words to be always considered incorrect
"flagWords": [
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ jobs:
echo "OPENSSL_DIR=C:\Program Files\OpenSSL-Win64" >>$GITHUB_ENV
if: runner.os == 'Windows'
- name: Set up the Mac environment
run: brew install autoconf automake libtool openssl@3
run: brew install autoconf automake libtool
if: runner.os == 'macOS'

- uses: Swatinem/rust-cache@v2
Expand Down
30 changes: 15 additions & 15 deletions compiler/ast/src/unparse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ impl<'a> Unparser<'a> {
}

fn unparse_expr<U>(&mut self, ast: &Expr<U>, level: u8) -> fmt::Result {
macro_rules! opprec {
($opty:ident, $x:expr, $enu:path, $($var:ident($op:literal, $prec:ident)),*$(,)?) => {
macro_rules! op_prec {
($op_ty:ident, $x:expr, $enu:path, $($var:ident($op:literal, $prec:ident)),*$(,)?) => {
match $x {
$(<$enu>::$var => (opprec!(@space $opty, $op), precedence::$prec),)*
$(<$enu>::$var => (op_prec!(@space $op_ty, $op), precedence::$prec),)*
}
};
(@space bin, $op:literal) => {
Expand All @@ -72,7 +72,7 @@ impl<'a> Unparser<'a> {
}
match &ast.node {
ExprKind::BoolOp { op, values } => {
let (op, prec) = opprec!(bin, op, Boolop, And("and", AND), Or("or", OR));
let (op, prec) = op_prec!(bin, op, Boolop, And("and", AND), Or("or", OR));
group_if!(prec, {
let mut first = true;
for val in values {
Expand All @@ -89,8 +89,8 @@ impl<'a> Unparser<'a> {
})
}
ExprKind::BinOp { left, op, right } => {
let rassoc = matches!(op, Operator::Pow);
let (op, prec) = opprec!(
let right_associative = matches!(op, Operator::Pow);
let (op, prec) = op_prec!(
bin,
op,
Operator,
Expand All @@ -109,13 +109,13 @@ impl<'a> Unparser<'a> {
FloorDiv("//", TERM),
);
group_if!(prec, {
self.unparse_expr(left, prec + rassoc as u8)?;
self.unparse_expr(left, prec + right_associative as u8)?;
self.p(op)?;
self.unparse_expr(right, prec + !rassoc as u8)?;
self.unparse_expr(right, prec + !right_associative as u8)?;
})
}
ExprKind::UnaryOp { op, operand } => {
let (op, prec) = opprec!(
let (op, prec) = op_prec!(
un,
op,
crate::Unaryop,
Expand All @@ -131,8 +131,8 @@ impl<'a> Unparser<'a> {
}
ExprKind::Lambda { args, body } => {
group_if!(precedence::TEST, {
let npos = args.args.len() + args.posonlyargs.len();
self.p(if npos > 0 { "lambda " } else { "lambda" })?;
let pos = args.args.len() + args.posonlyargs.len();
self.p(if pos > 0 { "lambda " } else { "lambda" })?;
self.unparse_args(args)?;
write!(self, ": {}", **body)?;
})
Expand Down Expand Up @@ -260,7 +260,7 @@ impl<'a> Unparser<'a> {
[],
) = (&**args, &**keywords)
{
// make sure a single genexp doesn't get double parens
// make sure a single genexpr doesn't get double parens
self.unparse_expr(elt, precedence::TEST)?;
self.unparse_comp(generators)?;
} else {
Expand All @@ -287,7 +287,7 @@ impl<'a> Unparser<'a> {
conversion,
format_spec,
} => self.unparse_formatted(value, *conversion, format_spec.as_deref())?,
ExprKind::JoinedStr { values } => self.unparse_joinedstr(values, false)?,
ExprKind::JoinedStr { values } => self.unparse_joined_str(values, false)?,
ExprKind::Constant { value, kind } => {
if let Some(kind) = kind {
self.p(kind)?;
Expand Down Expand Up @@ -490,7 +490,7 @@ impl<'a> Unparser<'a> {
unreachable!()
}
}
ExprKind::JoinedStr { values } => self.unparse_joinedstr(values, is_spec),
ExprKind::JoinedStr { values } => self.unparse_joined_str(values, is_spec),
ExprKind::FormattedValue {
value,
conversion,
Expand All @@ -505,7 +505,7 @@ impl<'a> Unparser<'a> {
self.p(&s)
}

fn unparse_joinedstr<U>(&mut self, values: &[Expr<U>], is_spec: bool) -> fmt::Result {
fn unparse_joined_str<U>(&mut self, values: &[Expr<U>], is_spec: bool) -> fmt::Result {
if is_spec {
self.unparse_fstring_body(values, is_spec)
} else {
Expand Down
Loading