Uploaded image for project: 'yangtools'
  1. yangtools
  2. YANGTOOLS-1044

Rework Uses statement ordering

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Medium Medium
    • 14.0.0, 13.0.6
    • None
    • parser

      Our current implementation of uses statements relies on a rather ugly hack to ensure statements are resolved in definition order, for example in case of:

      container foo {
        uses bar;
        uses baz;
      }
               
      grouping baz {
        leaf baz {
          type string;
        }
      }
               
      grouping bar {
        leaf bar {
          type string;
        }
      }
      

      As the two uses statements are resolved in reverse order, we end up:

      1. tracking effects of those statements separately
      2. re-inline these effects when 'foo' is built in EffectiveStatementBase

      Instead of this complicated tracking, we should be able to express a resolution dependency of 'uses baz' on 'uses bar', such that 'uses baz' is resolved only after 'uses bar' – which will naturally ensure that effectiveStatements are properly ordered.

            Unassigned Unassigned
            rovarga Robert Varga
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: