diff options
author | An-Cheng Huang <ancheng@vyatta.com> | 2010-11-19 10:23:34 -0800 |
---|---|---|
committer | An-Cheng Huang <ancheng@vyatta.com> | 2010-11-19 10:23:34 -0800 |
commit | cf5a5fb3e38a10532f44c7ea36b46e3c59d5314c (patch) | |
tree | 1f7757256f4377815849d889fb759bf73b534251 | |
parent | 2ea19c29ccf37e05a98790c6f63988889e5d3faa (diff) | |
download | vyatta-cfg-cf5a5fb3e38a10532f44c7ea36b46e3c59d5314c.tar.gz vyatta-cfg-cf5a5fb3e38a10532f44c7ea36b46e3c59d5314c.zip |
remove parser debug output and move existence check.
-rw-r--r-- | src/cnode/cnode.cpp | 12 | ||||
-rw-r--r-- | src/cparse/cparse.ypp | 25 |
2 files changed, 6 insertions, 31 deletions
diff --git a/src/cnode/cnode.cpp b/src/cnode/cnode.cpp index 697c89b..876e32e 100644 --- a/src/cnode/cnode.cpp +++ b/src/cnode/cnode.cpp @@ -113,15 +113,15 @@ CfgNode::CfgNode(Cstore& cstore, vector<string>& path_comps, * "root", treat it as an intermediate node. */ if (path_comps.size() > 0) { - if (!cstore.cfgPathExists(path_comps, active)) { - // path doesn't exist - _exists = false; - return; - } - vtw_def def; if (cstore.validateTmplPath(path_comps, false, def)) { // got the def + if (!cstore.cfgPathExists(path_comps, active)) { + // path doesn't exist + _exists = false; + return; + } + _is_value = def.is_value; _is_tag = def.tag; _is_leaf = (!def.tag && def.def_type != ERROR_TYPE); diff --git a/src/cparse/cparse.ypp b/src/cparse/cparse.ypp index ed37932..80d1120 100644 --- a/src/cparse/cparse.ypp +++ b/src/cparse/cparse.ypp @@ -42,29 +42,6 @@ static vector<string> pcomps; static vector<bool> pcomp_is_value; static void -print_path() -{ - printf("[%p,%p] p[", cur_parent, cur_node); - for (size_t i = 0; i < pcomps.size(); i++) { - if (i > 0) { - printf(","); - } - printf("%s", pcomps[i].c_str()); - } - printf("] n[%s]", nname); - if (nval) { - printf(" v[%s]", nval); - } - if (ncomment) { - printf(" c[%s]", ncomment); - } - if (ndeact) { - printf(" D"); - } - printf("\n"); -} - -static void add_node() { pcomps.push_back(nname); @@ -166,11 +143,9 @@ forest: /* empty */ tree: node { add_node(); - print_path(); } | node { add_node(); - print_path(); } LEFTB { go_down(); } forest RIGHTB { |