Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alternate choice syntax doesn't compile #100

Closed
jcourington opened this issue May 23, 2019 · 1 comment
Closed

Alternate choice syntax doesn't compile #100

jcourington opened this issue May 23, 2019 · 1 comment

Comments

@jcourington
Copy link

jcourington commented May 23, 2019

From RFC6020 - the following 2 should be equivalent but the first version without the 'case' gives an error - see Error below

choice interface-type {
    container ethernet { ... }
}

is equivalent to:

choice interface-type {
    case ethernet {
        container ethernet { ... }
    }
}
ExpressionError: cannot contain more than one non-case data node statement
    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:296:22)
    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 /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)
@sekur
Copy link
Collaborator

sekur commented May 23, 2019

Thanks for reporting the issue, I’ll investigate and let you know what I find.

@sekur sekur closed this as completed in f324c7e May 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants