marvin-zhao / pyang

Automatically exported from code.google.com/p/pyang
0 stars 0 forks source link

syntax error with min-elements not caught #1

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Module test.yang:
module test {
    min-elements 1;
}
2. Run "pyang test.yang" 

What is the expected output? What do you see instead?
YANG syntax error should be reported. A Python KeyError occurs instead:

Traceback (most recent call last):
  File "/home/lhotka/bin/pyang", line 161, in <module>
    run()
  File "/home/lhotka/bin/pyang", line 135, in run
    module = ctx.add_module(filename, text)
  File "/home/lhotka/lib/Python/pyang/__init__.py", line 56, in add_module
    self._set_attrs(module)
  File "/home/lhotka/lib/Python/pyang/__init__.py", line 133, in _set_attrs
    util.attrsearch(s.arg, 'arg', stmt.__dict__[attr])):
KeyError: 'min_elements'

Please use labels and text to provide additional information.

Original issue reported on code.google.com by lada.lho...@gmail.com on 17 Jun 2008 at 1:05

GoogleCodeExporter commented 9 years ago

Original comment by mbj4...@gmail.com on 13 Oct 2008 at 7:08

GoogleCodeExporter commented 9 years ago

Original comment by mbj4...@gmail.com on 13 Oct 2008 at 7:09