corenova / yang-js

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

Enhance if-feature to comply with YANG1.1, additional npm package:voll #53

Closed vcshox closed 7 years ago

vcshox commented 7 years ago

I use voll package to handle the logic expression of the if-feature arguments.

After extracting all the mentioned features, I reuse the origin code to build my logic control string:

feature = @lookup 'feature', feature_name
control_string += (feature_name + " ") if feature?.binding?

Any feature name appears in the control_string stands for true otherwise false

I am not sure if you accept other npm packages as dependencies.

Hope this help.

sekur commented 7 years ago

Thanks, let me analyze the voll package dependency and see if it's a lightweight dependency for this function.

sekur commented 7 years ago

@vcshox - I quickly ran browserify on the voll dependency and it would add about 17KB to the overall yang-js build. I think it's a bit overkill for this simple parsing case. I'll add an implementation for this using comparse which is the underlying parser that implements the yang-parser module since that parsing library is already included as part of yang-js build.

vcshox commented 7 years ago

@saintkepha Thank you!