From 8d9e4357306b5f7487a58d3f00c11f3c1339a027 Mon Sep 17 00:00:00 2001
From: Adam Wardynski <award@.(win7-laptop)>
Date: Mon, 9 May 2011 14:23:07 +0200
Subject: [PATCH] Create Match variale "_M" for each MatchRule. It would create
 one only if top-level parse_match_operator parser rule had been used. Now it
 creates it within match_rule_operator parser rule, so it works for
 parse_wccl_file as well.

---
 libwccl/parser/grammar.g | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libwccl/parser/grammar.g b/libwccl/parser/grammar.g
index c6958c7..f342038 100644
--- a/libwccl/parser/grammar.g
+++ b/libwccl/parser/grammar.g
@@ -282,7 +282,6 @@ parse_match_rule
 {
 	Lexicons empty_lex;
 	ParsingScope scope(tagset, empty_lex);
-	scope.variables().get_put<Match>("_M");
 }
 	: ret_match = match_rule_operator[scope] 
 ;
@@ -2325,6 +2324,7 @@ match_rule_operator
 	returns [boost::shared_ptr<MatchRule> ret_op]
 {
 	boost::shared_ptr<ApplyOperator> apply;
+	scope.variables().get_put<Match>("_M");
 }
 	: apply = match_apply_operator [scope] {
 		ret_op = boost::make_shared<MatchRule>(scope.variables(), apply);
-- 
GitLab