tl;dr: I want to make sure it's always the rule defined last that will be matched first.
My parsed inputs can look something like that:
{:command=>{:map_start=>"start"@66}}
or {:command=>{:map_start=>[{:name=>"mountain ledge"@77}, {:item_quantity=>"20"@94}]}
So I have 2 rules, one that matches the simple "start", and one that matches the subtree [{}, {}...].
rule(map_start: simple(:no_options)) do
# some code
end
rule(map_start: subtree(:options)) do
# some code
end
Seems like the subtree one is always matched first. If I put the rule with simple second, then it matches correctly.
Just want to make sure it's always the last rule that will be matched first?
tl;dr: I want to make sure it's always the rule defined last that will be matched first.
My parsed inputs can look something like that:
{:command=>{:map_start=>"start"@66}}
{:command=>{:map_start=>[{:name=>"mountain ledge"@77}, {:item_quantity=>"20"@94}]}
So I have 2 rules, one that matches the simple "start", and one that matches the subtree
[{}, {}...]
.Seems like the subtree one is always matched first. If I put the rule with
simple
second, then it matches correctly. Just want to make sure it's always the last rule that will be matched first?