* Fixed: [uses oc-if:interface-ref error with openconfig #233](https://github.com/clicon/clixon/issues/233)
This commit is contained in:
parent
85e2945ec9
commit
89f843f919
5 changed files with 24 additions and 17 deletions
|
|
@ -239,7 +239,6 @@ xpath_tree_print(FILE *f,
|
|||
* @param[in] xs XPATH tree
|
||||
* @param[out] xpath XPath string as CLIgen buf
|
||||
* @see xpath_tree_print
|
||||
* @note XXX Not complete
|
||||
*/
|
||||
int
|
||||
xpath_tree2cbuf(xpath_tree *xs,
|
||||
|
|
@ -247,6 +246,7 @@ xpath_tree2cbuf(xpath_tree *xs,
|
|||
{
|
||||
int retval = -1;
|
||||
|
||||
/* 1. Before first child */
|
||||
switch (xs->xs_type){
|
||||
case XP_ABSPATH:
|
||||
if (xs->xs_int == A_DESCENDANT_OR_SELF)
|
||||
|
|
@ -283,8 +283,10 @@ xpath_tree2cbuf(xpath_tree *xs,
|
|||
default:
|
||||
break;
|
||||
}
|
||||
/* 2. First child */
|
||||
if (xs->xs_c0 && xpath_tree2cbuf(xs->xs_c0, xcb) < 0)
|
||||
goto done;
|
||||
/* 3. Between first and second child */
|
||||
switch (xs->xs_type){
|
||||
case XP_AND: /* and or */
|
||||
case XP_ADD: /* div mod + * - */
|
||||
|
|
@ -293,6 +295,13 @@ xpath_tree2cbuf(xpath_tree *xs,
|
|||
if (xs->xs_c1)
|
||||
cprintf(xcb, " %s ", clicon_int2str(xpopmap, xs->xs_int));
|
||||
break;
|
||||
case XP_PATHEXPR:
|
||||
/* [19] PathExpr ::= | FilterExpr '/' RelativeLocationPath
|
||||
| FilterExpr '//' RelativeLocationPath
|
||||
*/
|
||||
if (xs->xs_s0)
|
||||
cprintf(xcb, "%s", xs->xs_s0);
|
||||
break;
|
||||
case XP_RELLOCPATH:
|
||||
if (xs->xs_c1){
|
||||
if (xs->xs_int == A_DESCENDANT_OR_SELF)
|
||||
|
|
@ -311,8 +320,10 @@ xpath_tree2cbuf(xpath_tree *xs,
|
|||
default:
|
||||
break;
|
||||
}
|
||||
/* 4. Second child */
|
||||
if (xs->xs_c1 && xpath_tree2cbuf(xs->xs_c1, xcb) < 0)
|
||||
goto done;
|
||||
/* 5. After second child */
|
||||
switch (xs->xs_type){
|
||||
case XP_PRED:
|
||||
if (xs->xs_c1)
|
||||
|
|
@ -915,6 +926,8 @@ xpath_vec_bool(cxobj *xcur,
|
|||
return retval;
|
||||
}
|
||||
|
||||
/*!
|
||||
*/
|
||||
static int
|
||||
traverse_canonical(xpath_tree *xs,
|
||||
yang_stmt *yspec,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue