mirror of
https://github.com/m-labs/artiq.git
synced 2024-12-20 00:46:30 +08:00
ARTIQIRGenerator: fix keyword/optional argument codegen in calls.
This commit is contained in:
parent
501ba912c2
commit
5e0ec3a6ea
@ -1483,19 +1483,19 @@ class ARTIQIRGenerator(algorithm.Visitor):
|
||||
for index, arg_name in enumerate(fn_typ.args):
|
||||
if keyword.arg == arg_name:
|
||||
assert args[index] is None
|
||||
args[index + offset] = arg
|
||||
args[index] = arg
|
||||
break
|
||||
elif keyword.arg in fn_typ.optargs:
|
||||
for index, optarg_name in enumerate(fn_typ.optargs):
|
||||
if keyword.arg == optarg_name:
|
||||
assert args[len(fn_typ.args) + index] is None
|
||||
args[len(fn_typ.args) + index + offset] = \
|
||||
args[len(fn_typ.args) + index] = \
|
||||
self.append(ir.Alloc([arg], ir.TOption(arg.type)))
|
||||
break
|
||||
|
||||
for index, optarg_name in enumerate(fn_typ.optargs):
|
||||
if args[len(fn_typ.args) + index + offset] is None:
|
||||
args[len(fn_typ.args) + index + offset] = \
|
||||
if args[len(fn_typ.args) + index] is None:
|
||||
args[len(fn_typ.args) + index] = \
|
||||
self.append(ir.Alloc([], ir.TOption(fn_typ.optargs[optarg_name])))
|
||||
|
||||
if self_arg is not None:
|
||||
|
Loading…
Reference in New Issue
Block a user