Skip to content

Commit 32defdf

Browse files
committed
cleanup: format again with new black version
1 parent 33d9148 commit 32defdf

9 files changed

Lines changed: 23 additions & 27 deletions

File tree

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ repos:
66
- id: end-of-file-fixer
77
- id: trailing-whitespace
88
- repo: https://github.com/psf/black
9-
rev: 21.9b0
9+
rev: 22.1.0
1010
hooks:
1111
- id: black

src/arch/z80/backend/_f16.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def f16(op):
3535
op = -op
3636

3737
DE = int(op)
38-
HL = int((op - DE) * 2 ** 16) & 0xFFFF
38+
HL = int((op - DE) * 2**16) & 0xFFFF
3939
DE &= 0xFFFF
4040

4141
if negative: # Do C2

src/arch/z80/beep.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def getDEHL(duration, pitch):
5454

5555
frec = TABLE[A]
5656
tmp2 = tmp * frec
57-
f = tmp2 * 2.0 ** B
57+
f = tmp2 * 2.0**B
5858

5959
DE = int(0.5 + f * duration - 1)
6060
HL = int(0.5 + 437500.0 / f - 30.125)

src/arch/z80/translator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1038,7 +1038,7 @@ def default_value(cls, type_, expr): # TODO: This function must be moved to api
10381038
return [C, DE[-2:], DE[:-2], HL[-2:], HL[:-2]]
10391039

10401040
if type_ == cls.TYPE(TYPE.fixed):
1041-
value = 0xFFFFFFFF & int(expr.value * 2 ** 16)
1041+
value = 0xFFFFFFFF & int(expr.value * 2**16)
10421042
else:
10431043
value = int(expr.value)
10441044

src/arch/z80/translatorvisitor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def emit_data_blocks(self):
142142
lbl = self.add_string_label(d.value.value)
143143
self.ic_data(gl.PTR_TYPE, [lbl])
144144
elif d.value.type_ == self.TYPE(TYPE.fixed): # Convert to bytes
145-
bytes_ = 0xFFFFFFFF & int(d.value.value * 2 ** 16)
145+
bytes_ = 0xFFFFFFFF & int(d.value.value * 2**16)
146146
self.ic_data(TYPE.uinteger, ["0x%04X" % (bytes_ & 0xFFFF), "0x%04X" % (bytes_ >> 16)])
147147
else:
148148
self.ic_data(d.value.type_, [self.traverse_const(d.value)])

src/arch/zx48k/beep.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def getDEHL(duration, pitch):
5454

5555
frec = TABLE[A]
5656
tmp2 = tmp * frec
57-
f = tmp2 * 2.0 ** B
57+
f = tmp2 * 2.0**B
5858

5959
DE = int(0.5 + f * duration - 1)
6060
HL = int(0.5 + 437500.0 / f - 30.125)

src/symbols/binary.py

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -96,25 +96,21 @@ def make_node(cls, operator, left, right, lineno, func=None, type_=None):
9696
b = SymbolTYPECAST.make_node(c_type, b, lineno) # ensure type
9797
return SymbolCONST(cls(operator, a, b, lineno, type_=type_, func=func), lineno=lineno)
9898

99-
if (
100-
operator
101-
in {
102-
"BNOT",
103-
"BAND",
104-
"BOR",
105-
"BXOR",
106-
"NOT",
107-
"AND",
108-
"OR",
109-
"XOR",
110-
"MINUS",
111-
"MULT",
112-
"DIV",
113-
"SHL",
114-
"SHR",
115-
}
116-
and not check.is_numeric(a, b)
117-
):
99+
if operator in {
100+
"BNOT",
101+
"BAND",
102+
"BOR",
103+
"BXOR",
104+
"NOT",
105+
"AND",
106+
"OR",
107+
"XOR",
108+
"MINUS",
109+
"MULT",
110+
"DIV",
111+
"SHL",
112+
"SHR",
113+
} and not check.is_numeric(a, b):
118114
errmsg.error(lineno, "Operator %s cannot be used with STRINGS" % operator)
119115
return None
120116

src/zxbasm/expr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class Expr(Ast):
1515
"+": lambda x, y: x + y,
1616
"*": lambda x, y: x * y,
1717
"/": lambda x, y: x // y,
18-
"^": lambda x, y: x ** y,
18+
"^": lambda x, y: x**y,
1919
"%": lambda x, y: x % y,
2020
"&": lambda x, y: x & y,
2121
"|": lambda x, y: x | y,

src/zxbc/zxbparser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2327,7 +2327,7 @@ def p_expr_pow_expr(p):
23272327
"POW",
23282328
make_typecast(TYPE.float_, p[1], p.lineno(2)),
23292329
make_typecast(TYPE.float_, p[3], p.lexer.lineno),
2330-
lambda x, y: x ** y,
2330+
lambda x, y: x**y,
23312331
)
23322332

23332333

0 commit comments

Comments
 (0)