From 5767ba52b727b188d5d6a6943ba058a21f1d0bb4 Mon Sep 17 00:00:00 2001
From: ilor <kailoran@gmail.com>
Date: Wed, 27 Apr 2011 10:37:56 +0200
Subject: [PATCH] fix parser grammar passing emptu string as channel name in
 ass/annsub operators (fixes issue 1453)

---
 libwccl/parser/grammar.g | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/libwccl/parser/grammar.g b/libwccl/parser/grammar.g
index f534a84..932d3e1 100644
--- a/libwccl/parser/grammar.g
+++ b/libwccl/parser/grammar.g
@@ -1329,17 +1329,16 @@ bool_ann
 {
 	boost::shared_ptr< Function<Match> > match_from;
 	boost::shared_ptr< Function<Match> > match_to;
-	std::string chan_name;
 }
 	: "ann" LPAREN
 			match_from = match_operator [scope] COMMA
 			(match_to  = match_operator [scope] COMMA)?
-			name : STRING
+			channel : STRING
 		RPAREN {
 			if (match_to) {
-				op.reset(new Ann(match_from, match_to, chan_name));
+				op.reset(new Ann(match_from, match_to, token_ref_to_std_string(channel)));
 			} else {
-				op.reset(new Ann(match_from, chan_name));
+				op.reset(new Ann(match_from, token_ref_to_std_string(channel)));
 			}
 		}
 ;
@@ -1353,18 +1352,17 @@ bool_annsub
 {
 	boost::shared_ptr< Function<Match> > match_from;
 	boost::shared_ptr< Function<Match> > match_to;
-	std::string chan_name;
 }
 	: "annsub" LPAREN
 		match_from = match_operator [scope] COMMA
 		(match_to = match_operator [scope] COMMA)?
-		name : STRING
+		channel : STRING
 		RPAREN
 		{
 			if (match_to) {
-				op.reset(new AnnSub(match_from, match_to, chan_name));
+				op.reset(new AnnSub(match_from, match_to, token_ref_to_std_string(channel)));
 			} else {
-				op.reset(new AnnSub(match_from, chan_name));
+				op.reset(new AnnSub(match_from, token_ref_to_std_string(channel)));
 			}
 		}
 ;
-- 
GitLab