Skip to content

Commit

Permalink
Include component init expressions in hash transformation
Browse files Browse the repository at this point in the history
  • Loading branch information
Arian Weber authored and Arian Weber committed Mar 16, 2024
1 parent 6f44710 commit 770314a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/pg-verify/transform/hash_transformation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def transform_component(graph, component)
return { component.name.to_s => {
"states" => component.states.map(&:to_s),
"variables" => variables.map { |v| transform_variable(v) },
"init" => transform_expression(component.init_expression),
"transitions" => component.transitions.map { |t| transform_transition(t) },
"represents_fault" => component.represents_fault
}}
Expand All @@ -39,13 +40,14 @@ def parse_component(graph, hash)
name = hash.keys.first
states = hash[name]["states"].map(&:to_sym)
variables = hash[name]["variables"].map { |v| parse_variable(name, v) }
init_expression = parse_expression(hash[name]["init"])
transitions = hash[name]["transitions"].map { |t| parse_transition(t) }
represents_fault = hash[name]["represents_fault"]

graph.variables += variables

return Model::Component.new(name: name.to_sym, states: states,
transitions: transitions, represents_fault: represents_fault)
transitions: transitions, represents_fault: represents_fault, init_expression: init_expression)
end

def transform_variable(variable)
Expand Down

0 comments on commit 770314a

Please sign in to comment.