From 88d3aef2d8ca450c9f6b5f6abae0678bb99e530a Mon Sep 17 00:00:00 2001
From: Adam Wardynski <award@.(win7-laptop)>
Date: Fri, 22 Apr 2011 21:16:00 +0200
Subject: [PATCH] Make match available for apply conditions.

---
 libwccl/ops/match/applyoperator.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libwccl/ops/match/applyoperator.cpp b/libwccl/ops/match/applyoperator.cpp
index 9e9816a..edcefc0 100644
--- a/libwccl/ops/match/applyoperator.cpp
+++ b/libwccl/ops/match/applyoperator.cpp
@@ -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);
 				}
-- 
GitLab