lib/autoproj/ros_condition_parser.rb in autoproj-2.16.0 vs lib/autoproj/ros_condition_parser.rb in autoproj-2.17.0
- old
+ new
@@ -6,18 +6,16 @@
module Autoproj
# Parses a conditional expression
# Syntax and rules as defined in https://www.ros.org/reps/rep-0149.html#id20
class RosConditionParser < Parslet::Parser
- def initialize(context)
- @context = context
+ def initialize(&expander)
+ @expander = expander
super()
end
def expand(var)
- Autoproj.expand(var, @context)
- rescue StandardError
- ""
+ @expander.call(var)
end
# Evaluates the Abstract Syntax Tree generated by the parser
class Transform < Parslet::Transform
rule(literal: simple(:x)) { String(x) }