Skip to content

Commit 03ea29d

Browse files
committed
Normalize spacing for keyword args in Python
1 parent 2272fce commit 03ea29d

File tree

2 files changed

+24
-24
lines changed

2 files changed

+24
-24
lines changed

design/mvp/CanonicalABI.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1367,10 +1367,10 @@ def load(cx, ptr, t):
13671367
case U16Type() : return load_int(cx, ptr, 2)
13681368
case U32Type() : return load_int(cx, ptr, 4)
13691369
case U64Type() : return load_int(cx, ptr, 8)
1370-
case S8Type() : return load_int(cx, ptr, 1, signed=True)
1371-
case S16Type() : return load_int(cx, ptr, 2, signed=True)
1372-
case S32Type() : return load_int(cx, ptr, 4, signed=True)
1373-
case S64Type() : return load_int(cx, ptr, 8, signed=True)
1370+
case S8Type() : return load_int(cx, ptr, 1, signed = True)
1371+
case S16Type() : return load_int(cx, ptr, 2, signed = True)
1372+
case S32Type() : return load_int(cx, ptr, 4, signed = True)
1373+
case S64Type() : return load_int(cx, ptr, 8, signed = True)
13741374
case F32Type() : return decode_i32_as_float(load_int(cx, ptr, 4))
13751375
case F64Type() : return decode_i64_as_float(load_int(cx, ptr, 8))
13761376
case CharType() : return convert_i32_to_char(cx, load_int(cx, ptr, 4))
@@ -1390,7 +1390,7 @@ Integers are loaded directly from memory, with their high-order bit interpreted
13901390
according to the signedness of the type.
13911391
```python
13921392
def load_int(cx, ptr, nbytes, signed = False):
1393-
return int.from_bytes(cx.opts.memory[ptr : ptr+nbytes], 'little', signed=signed)
1393+
return int.from_bytes(cx.opts.memory[ptr : ptr+nbytes], 'little', signed = signed)
13941394
```
13951395

13961396
Integer-to-boolean conversions treats `0` as `false` and all other bit-patterns
@@ -1668,10 +1668,10 @@ def store(cx, v, t, ptr):
16681668
case U16Type() : store_int(cx, v, ptr, 2)
16691669
case U32Type() : store_int(cx, v, ptr, 4)
16701670
case U64Type() : store_int(cx, v, ptr, 8)
1671-
case S8Type() : store_int(cx, v, ptr, 1, signed=True)
1672-
case S16Type() : store_int(cx, v, ptr, 2, signed=True)
1673-
case S32Type() : store_int(cx, v, ptr, 4, signed=True)
1674-
case S64Type() : store_int(cx, v, ptr, 8, signed=True)
1671+
case S8Type() : store_int(cx, v, ptr, 1, signed = True)
1672+
case S16Type() : store_int(cx, v, ptr, 2, signed = True)
1673+
case S32Type() : store_int(cx, v, ptr, 4, signed = True)
1674+
case S64Type() : store_int(cx, v, ptr, 8, signed = True)
16751675
case F32Type() : store_int(cx, encode_float_as_i32(v), ptr, 4)
16761676
case F64Type() : store_int(cx, encode_float_as_i64(v), ptr, 8)
16771677
case CharType() : store_int(cx, char_to_i32(v), ptr, 4)
@@ -1693,7 +1693,7 @@ the `signed` parameter is only present to ensure that the internal range checks
16931693
of `int.to_bytes` are satisfied.
16941694
```python
16951695
def store_int(cx, v, ptr, nbytes, signed = False):
1696-
cx.opts.memory[ptr : ptr+nbytes] = int.to_bytes(v, nbytes, 'little', signed=signed)
1696+
cx.opts.memory[ptr : ptr+nbytes] = int.to_bytes(v, nbytes, 'little', signed = signed)
16971697
```
16981698

16991699
Floats are stored directly into memory, with the sign and payload bits of NaN
@@ -2056,7 +2056,7 @@ elements in the current component instance's handle table. The increment of
20562056
and ensures that all borrowed handles are dropped before the end of the task.
20572057
```python
20582058
def lower_own(cx, rep, t):
2059-
h = ResourceHandle(rep, own=True)
2059+
h = ResourceHandle(rep, own = True)
20602060
return cx.inst.resources.add(t.rt, h)
20612061

20622062
def lower_borrow(cx, rep, t):
@@ -2795,7 +2795,7 @@ instance's handle table:
27952795
```python
27962796
async def canon_resource_new(rt, task, rep):
27972797
trap_if(not task.inst.may_leave)
2798-
h = ResourceHandle(rep, own=True)
2798+
h = ResourceHandle(rep, own = True)
27992799
i = task.inst.resources.add(rt, h)
28002800
return [i]
28012801
```

design/mvp/canonical-abi/definitions.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -933,10 +933,10 @@ def load(cx, ptr, t):
933933
case U16Type() : return load_int(cx, ptr, 2)
934934
case U32Type() : return load_int(cx, ptr, 4)
935935
case U64Type() : return load_int(cx, ptr, 8)
936-
case S8Type() : return load_int(cx, ptr, 1, signed=True)
937-
case S16Type() : return load_int(cx, ptr, 2, signed=True)
938-
case S32Type() : return load_int(cx, ptr, 4, signed=True)
939-
case S64Type() : return load_int(cx, ptr, 8, signed=True)
936+
case S8Type() : return load_int(cx, ptr, 1, signed = True)
937+
case S16Type() : return load_int(cx, ptr, 2, signed = True)
938+
case S32Type() : return load_int(cx, ptr, 4, signed = True)
939+
case S64Type() : return load_int(cx, ptr, 8, signed = True)
940940
case F32Type() : return decode_i32_as_float(load_int(cx, ptr, 4))
941941
case F64Type() : return decode_i64_as_float(load_int(cx, ptr, 8))
942942
case CharType() : return convert_i32_to_char(cx, load_int(cx, ptr, 4))
@@ -952,7 +952,7 @@ def load(cx, ptr, t):
952952
case FutureType(t) : return lift_future(cx, load_int(cx, ptr, 4), t)
953953

954954
def load_int(cx, ptr, nbytes, signed = False):
955-
return int.from_bytes(cx.opts.memory[ptr : ptr+nbytes], 'little', signed=signed)
955+
return int.from_bytes(cx.opts.memory[ptr : ptr+nbytes], 'little', signed = signed)
956956

957957
def convert_int_to_bool(i):
958958
assert(i >= 0)
@@ -1133,10 +1133,10 @@ def store(cx, v, t, ptr):
11331133
case U16Type() : store_int(cx, v, ptr, 2)
11341134
case U32Type() : store_int(cx, v, ptr, 4)
11351135
case U64Type() : store_int(cx, v, ptr, 8)
1136-
case S8Type() : store_int(cx, v, ptr, 1, signed=True)
1137-
case S16Type() : store_int(cx, v, ptr, 2, signed=True)
1138-
case S32Type() : store_int(cx, v, ptr, 4, signed=True)
1139-
case S64Type() : store_int(cx, v, ptr, 8, signed=True)
1136+
case S8Type() : store_int(cx, v, ptr, 1, signed = True)
1137+
case S16Type() : store_int(cx, v, ptr, 2, signed = True)
1138+
case S32Type() : store_int(cx, v, ptr, 4, signed = True)
1139+
case S64Type() : store_int(cx, v, ptr, 8, signed = True)
11401140
case F32Type() : store_int(cx, encode_float_as_i32(v), ptr, 4)
11411141
case F64Type() : store_int(cx, encode_float_as_i64(v), ptr, 8)
11421142
case CharType() : store_int(cx, char_to_i32(v), ptr, 4)
@@ -1152,7 +1152,7 @@ def store(cx, v, t, ptr):
11521152
case FutureType(t) : store_int(cx, lower_future(cx, v, t), ptr, 4)
11531153

11541154
def store_int(cx, v, ptr, nbytes, signed = False):
1155-
cx.opts.memory[ptr : ptr+nbytes] = int.to_bytes(v, nbytes, 'little', signed=signed)
1155+
cx.opts.memory[ptr : ptr+nbytes] = int.to_bytes(v, nbytes, 'little', signed = signed)
11561156

11571157
def maybe_scramble_nan32(f):
11581158
if math.isnan(f):
@@ -1401,7 +1401,7 @@ def pack_flags_into_int(v, labels):
14011401
return i
14021402

14031403
def lower_own(cx, rep, t):
1404-
h = ResourceHandle(rep, own=True)
1404+
h = ResourceHandle(rep, own = True)
14051405
return cx.inst.resources.add(t.rt, h)
14061406

14071407
def lower_borrow(cx, rep, t):
@@ -1818,7 +1818,7 @@ async def do_call(on_block):
18181818

18191819
async def canon_resource_new(rt, task, rep):
18201820
trap_if(not task.inst.may_leave)
1821-
h = ResourceHandle(rep, own=True)
1821+
h = ResourceHandle(rep, own = True)
18221822
i = task.inst.resources.add(rt, h)
18231823
return [i]
18241824

0 commit comments

Comments
 (0)