Open preetjuniper opened 2 weeks ago
I'd say it it legal YANG and a legit bug. Not hard to fix, but will require looking into parser and/or lexer logic and not obvious. Thanks for reporting, let me know if this is urgent.
Not urgent, as it seems trivial to workaround. Also, another observation, loading from string doesn't panic:
func main() {
configModelStr := `
module x {
namespace "";
prefix "";
revision 0;
} // foo
`
// load model
_, err := parser.LoadModuleFromString(nil, configModelStr)
if err != nil {
panic(err.Error())
}
}
Loading the following from file fails (not sure if this is invalid YANG, I didn't see anything in the spec, or get any complaints from pyang)
YANG file:
example:
Output:
The culprit is the little
// foo
comment after the module definition