Skip to content
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
2 changes: 1 addition & 1 deletion src/pdl/pdl_ast.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ class FunctionBlock(LeafBlock):
function: Optional[dict[str, PdlTypeType]]
"""Functions parameters with their types.
"""
returns: "BlockType" = Field(..., alias="return")
return_: "BlockType" = Field(..., alias="return")
"""Body of the function.
"""
signature: Optional[Json] = None
Expand Down
4 changes: 2 additions & 2 deletions src/pdl/pdl_ast_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def iter_block_children(f: Callable[[BlockType], None], block: BlockType) -> Non
f(blocks)
match block:
case FunctionBlock():
f(block.returns)
f(block.return_)
case CallBlock():
if block.pdl__trace is not None:
f(block.pdl__trace)
Expand Down Expand Up @@ -124,7 +124,7 @@ def map_block_children(f: MappedFunctions, block: BlockType) -> BlockType:
block = block.model_copy(update={"defs": defs})
match block:
case FunctionBlock():
block.returns = f.f_block(block.returns)
block.return_ = f.f_block(block.return_)
case CallBlock():
block.call = f.f_expr(block.call)
block.args = f.f_expr(block.args)
Expand Down
2 changes: 1 addition & 1 deletion src/pdl/pdl_dumper.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def block_to_dict( # noqa: C901
d["function"] = None
else:
d["function"] = {x: type_to_dict(t) for x, t in block.function.items()}
d["return"] = block_to_dict(block.returns, json_compatible)
d["return"] = block_to_dict(block.return_, json_compatible)
# if block.scope is not None:
# d["scope"] = scope_to_dict(block.scope, json_compatible)
case CallBlock():
Expand Down
2 changes: 1 addition & 1 deletion src/pdl/pdl_interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1859,7 +1859,7 @@ def process_call(
)
if "pdl_context" in args:
args["pdl_context"] = deserialize(args["pdl_context"])
f_body = closure.returns
f_body = closure.return_
f_scope = (
(closure.pdl__scope or PdlDict({}))
| PdlDict({"pdl_context": scope.data["pdl_context"]})
Expand Down
2 changes: 1 addition & 1 deletion src/pdl/pdl_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def parse_dict(
# block.fallback = set_block_location(block.fallback, append(loc, "fallback"))
# match block:
# case FunctionBlock():
# block.returns = set_blocks_location(block.returns, append(loc, "return"))
# block.return_ = set_blocks_location(block.return_, append(loc, "return"))
# case CallBlock():
# block.args = {x: set_expr_location(expr) for x, expr in block.args.items()}
# case ModelBlock():
Expand Down