Commit 01048a2f authored by Brice Videau's avatar Brice Videau

Relax in expression parser constraint.

parent 92a63358
......@@ -66,7 +66,7 @@ module CCS
end
rule(:in_expr) do |r|
r[:identifier, "#", :list].as { |v, _, l|
r[:value, "#", :list].as { |v, _, l|
Expression.binary(type: :CCS_IN, left: v, right: l) }
end
......
......@@ -34,5 +34,17 @@ class CConfigSpaceTestExpressionParser < Minitest::Test
assert( res.kind_of? CCS::Expression )
assert_equal( 4, res.eval )
end
def test_in
m = CCS::ExpressionParser.new.method(:parse)
exp = "5 # [3.0, 5]"
res = m[exp]
assert( res.kind_of? CCS::Expression )
assert_equal( true, res.eval )
exp = "5 # [3.0, 4]"
res = m[exp]
assert( res.kind_of? CCS::Expression )
assert_equal( false, res.eval )
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment