corenova / yang-js

YANG parser and composer
Apache License 2.0
56 stars 18 forks source link

submodule belongs-to issue #101

Closed jcourington closed 5 years ago

jcourington commented 5 years ago

This seems similar to #58 but does not seem to be resolved.

Given

module A { prefix a; }

and

submodule B { belongs-to A { prefix a; } }

submodule C { belongs-to A { prefix a; } include B; }

if C includes B to use a type you get the following error:

ExpressionError: requested submodule 'B' not belongs-to 'C'
    at Function.Element.error (/home/src/node_modules/yang-js/lib/element.js:60:15)
    at Function.Expression.error (/home/src/node_modules/yang-js/lib/expression.js:191:40)
    at Function.resolve (/home/src/node_modules/yang-js/lib/lang/extensions.js:687:19)
    at Function.Expression.compile (/home/src/node_modules/yang-js/lib/expression.js:83:15)
    at /home/src/node_modules/yang-js/lib/expression.js:98:18
    at Array.forEach (<anonymous>)
    at Function.Expression.compile (/home/src/node_modules/yang-js/lib/expression.js:97:18)
    at Function.resolve (/home/src/node_modules/yang-js/lib/lang/extensions.js:693:18)
    at Function.Expression.compile (/home/src//node_modules/yang-js/lib/expression.js:83:15)
    at /home/src/node_modules/yang-js/lib/expression.js:98:18