From e6d27783dbb3b8c11051e27e36dbe0727545420a Mon Sep 17 00:00:00 2001
From: An-Cheng Huang <ancheng@vyatta.com>
Date: Wed, 9 Feb 2011 09:45:04 -0800
Subject: fix for bug 6791

* work around comment syntax ambiguity by ignoring comments not associated with any nodes.
(cherry picked from commit 1acfc5fd32f42264612d109c19be2268968c27d4)
---
 src/cparse/cparse.ypp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

(limited to 'src/cparse')

diff --git a/src/cparse/cparse.ypp b/src/cparse/cparse.ypp
index b1958e9..e4fb452 100644
--- a/src/cparse/cparse.ypp
+++ b/src/cparse/cparse.ypp
@@ -151,7 +151,7 @@ tree:       node {
               add_node();
             } LEFTB {
               go_down();
-            } forest RIGHTB {
+            } forest comment RIGHTB {
               go_up();
             }
 ;
@@ -169,10 +169,10 @@ nodec:      NODE {
               nname = $1.str;
               ndeact = $1.deactivated;
             }
-          | COMMENT NODE {
+          | COMMENT comment NODE {
               ncomment = $1.str;
-              nname = $2.str;
-              ndeact = $2.deactivated;
+              nname = $3.str;
+              ndeact = $3.deactivated;
             }
 ;
 
-- 
cgit v1.2.3