Skip to content

Commit

Permalink
format code
Browse files Browse the repository at this point in the history
  • Loading branch information
StunxFS committed Jan 26, 2024
1 parent 9e6490c commit be57ba4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
5 changes: 2 additions & 3 deletions rivetc/src/checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -1335,9 +1335,8 @@ def check_expr(self, expr):
f"instead of using tuple indexing, use array indexing: `expr[{expr.field_name}]`"
)
expr.left_typ = left_typ
if isinstance(
expr.left_typ, type.Ptr
) and expr.left_typ.nr_level() > 1 and not expr.is_indirect:
if isinstance(expr.left_typ, type.Ptr) and expr.left_typ.nr_level(
) > 1 and not expr.is_indirect:
report.error(
"fields of an multi-level pointer cannot be accessed directly",
expr.pos
Expand Down
10 changes: 5 additions & 5 deletions rivetc/src/codegen/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1255,11 +1255,11 @@ def gen_expr(self, expr, custom_tmp = None):
args.append(self.gen_expr_with_cast(arg.typ, arg.expr))
else:
var_arg = expr.sym.args[-1]
if variadic_count == 1 and len(expr.args
) > 0 and isinstance(
expr.args[-1].expr.typ,
type.Variadic
):
if variadic_count == 1 and len(
expr.args
) > 0 and isinstance(
expr.args[-1].expr.typ, type.Variadic
):
arg = expr.args[-1]
args.append(self.gen_expr_with_cast(arg.typ, arg.expr))
elif variadic_count > 0:
Expand Down
4 changes: 3 additions & 1 deletion rivetc/src/codegen/ir.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ def __str__(self):
return f"{[self.size]}{self.typ}"

def __eq__(self, other):
return isinstance(other, Array) and self.typ == other.typ and self.size == other.size
return isinstance(
other, Array
) and self.typ == other.typ and self.size == other.size

class Function:
def __init__(self, args, ret_typ):
Expand Down

0 comments on commit be57ba4

Please sign in to comment.