Changed: params -> quantities
This commit is contained in:
parent
8e362ade79
commit
b8a09b10ff
@ -72,7 +72,7 @@ class DemoBuilder < Ripper::SexpBuilder
|
|||||||
ttype, token = arg
|
ttype, token = arg
|
||||||
case ttype
|
case ttype
|
||||||
when :bt_quantity
|
when :bt_quantity
|
||||||
"params['#{token}']"
|
"quantities['#{token}']"
|
||||||
when :bt_expression
|
when :bt_expression
|
||||||
@parts << {type: :indexed, content: token}
|
@parts << {type: :indexed, content: token}
|
||||||
"parts[#{@parts.length - 1}]"
|
"parts[#{@parts.length - 1}]"
|
||||||
@ -119,10 +119,10 @@ class DemoBuilder < Ripper::SexpBuilder
|
|||||||
when :bt_quantity
|
when :bt_quantity
|
||||||
if mtype == :quantity_method
|
if mtype == :quantity_method
|
||||||
part_index = @parts.length
|
part_index = @parts.length
|
||||||
@parts << {type: :unindexed, content: "params['#{left[1]}']#{dot.to_s}#{method}"}
|
@parts << {type: :unindexed, content: "quantities['#{left[1]}']#{dot.to_s}#{method}"}
|
||||||
[:bt_quantity_method_call, "parts[#{part_index}]", part_index]
|
[:bt_quantity_method_call, "parts[#{part_index}]", part_index]
|
||||||
else
|
else
|
||||||
[:bt_numeric_method_call, "params['#{left[1]}'][_index]#{dot.to_s}#{method}"]
|
[:bt_numeric_method_call, "quantities['#{left[1]}'][_index]#{dot.to_s}#{method}"]
|
||||||
end
|
end
|
||||||
when :bt_quantity_method_call
|
when :bt_quantity_method_call
|
||||||
if mtype == :quantity_method
|
if mtype == :quantity_method
|
||||||
@ -174,7 +174,7 @@ class DemoBuilder < Ripper::SexpBuilder
|
|||||||
[
|
[
|
||||||
:bt_expression,
|
:bt_expression,
|
||||||
[left, right].map do |side|
|
[left, right].map do |side|
|
||||||
side[0] == :bt_quantity ? "params['#{side[1]}'][_index]" : "#{side[1]}"
|
side[0] == :bt_quantity ? "quantities['#{side[1]}'][_index]" : "#{side[1]}"
|
||||||
end.join(op.to_s)
|
end.join(op.to_s)
|
||||||
]
|
]
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user