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

Rework Uses statement ordering

    XMLWordPrintable

Details

    • Improvement
    • Status: Confirmed
    • Medium
    • Resolution: Unresolved
    • None
    • 14.0.0, 13.0.2
    • parser

    Description

      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.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

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

              Dates

                Created:
                Updated: