Skip to content
Snippets Groups Projects
Commit 88d3aef2 authored by Adam Wardynski's avatar Adam Wardynski
Browse files

Make match available for apply conditions.

parent e31b1b62
No related branches found
No related tags found
No related merge requests found
......@@ -38,12 +38,12 @@ void ApplyOperator::execute(const ActionExecContext &context) const
context.sentence_context().set_position(orig_pos + 1);
} else {
// there was a match - check conditions of apply
matches->append(match.get_match()); // the match goes to $m:_M[0]
bool should_act = true;
for(size_t i = 0; should_act && i < apply_conditions_->size(); ++i) {
should_act = (*apply_conditions_)[i]->apply(context)->get_value();
}
if (should_act) {
matches->append(match.get_match()); // the match goes to $m:_M[0]
foreach (const boost::shared_ptr<MatchAction>& action, *actions_) {
action->execute(context);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment