Skip to content

Commit

Permalink
Rename function in code generator
Browse files Browse the repository at this point in the history
Ref. eng/recordflux/RecordFlux!1658
  • Loading branch information
treiher committed Aug 29, 2024
1 parent 6432c92 commit 75a7881
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions rflx/generator/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,7 @@ def field_condition_call(
[
Variable("Ctx"),
Variable(package * field.affixed_name),
*([value] if has_value_dependent_condition(message) else []),
*([value] if has_scalar_value_dependent_condition(message) else []),
*([aggregate] if has_aggregate_dependent_condition(message) else []),
*([size] if has_size_dependent_condition(message, field) else []),
],
Expand Down Expand Up @@ -820,7 +820,7 @@ def contains_function_name(refinement_package: ID, pdu: ID, sdu: ID, field: ID)
return f"{sdu_name.flat}_In_{pdu_name.flat}_{field}"


def has_value_dependent_condition(message: model.Message) -> bool:
def has_scalar_value_dependent_condition(message: model.Message) -> bool:
return any(
True
for l in message.structure
Expand Down
4 changes: 2 additions & 2 deletions rflx/generator/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -2198,7 +2198,7 @@ def condition(field: Field, message: Message) -> Expr:
Parameter(["Fld"], "Field"),
*(
[Parameter(["Val"], const.TYPES_BASE_INT)]
if common.has_value_dependent_condition(message)
if common.has_scalar_value_dependent_condition(message)
else []
),
*(
Expand Down Expand Up @@ -2235,7 +2235,7 @@ def condition(field: Field, message: Message) -> Expr:
[Variable("Fld"), Variable("Val")],
),
]
if common.has_value_dependent_condition(message)
if common.has_scalar_value_dependent_condition(message)
else []
),
Call(
Expand Down
6 changes: 5 additions & 1 deletion rflx/generator/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,11 @@ def create_verify_procedure(
[
Variable("Ctx"),
Variable("Fld"),
*([Variable("Value")] if common.has_value_dependent_condition(message) else []),
*(
[Variable("Value")]
if common.has_scalar_value_dependent_condition(message)
else []
),
*(
[
Slice(
Expand Down

0 comments on commit 75a7881

Please sign in to comment.