lib/grumlin/steps_serializers/bytecode.rb in grumlin-0.17.0 vs lib/grumlin/steps_serializers/bytecode.rb in grumlin-0.18.0
- old
+ new
@@ -4,11 +4,11 @@
module StepsSerializers
class Bytecode < Serializer
# constructor params: no_return: true|false, default false
# TODO: add pretty
- NONE_STEP = StepData.new("none", [])
+ NONE_STEP = StepData.new("none")
def serialize
steps = ShortcutsApplyer.call(@steps)
no_return = @params[:no_return] || false
@@ -20,10 +20,10 @@
end
private
def serialize_step(step)
- [step.name, *step.arguments.map { |arg| serialize_arg(arg) }]
+ [step.name, *step.args.map { |arg| serialize_arg(arg) }, step.params.any? ? step.params : nil].compact
end
def serialize_arg(arg)
return serialize_typed_value(arg) if arg.is_a?(TypedValue)
return serialize_predicate(arg) if arg.is_a?(Expressions::P::Predicate)