Hi,
The deviation section has a lot of fluff text about how bad
deviations are,
but very little text on how to process the "deviate"
statement correctly.
The text is not clear if the statements altered in the
target module
are semantic patches or syntactic patches. Are the
sub-statements
of the deviate-stmt fully processed in the scope of the
deviation module
or in the scope of the target module? In this example, is
the type-stmt
resolved in A or dev-A?
Similar issues for deviating a default for an identityref.
module A {
namespace "...";
prefix a;
// no imports!
leaf foo {
type string;
}
leaf bar {
type string;
}
leaf baz {
type string;
}
}
module A-dev {
...
import A { prefix a; }
import C { prefix c; }
import ietf-interfaces { prefix if; }
// variant 1: inline leafref but module A does not
import path module
deviation /a:foo {
deviate replace {
type leafref {
base /c:modules/c:module/c:name;
}
}
}
// variant 2: imported typedef but module A does not
import it
deviation /a:bar {
deviate replace {
type if:interface-ref;
}
}
// variant 3: local typedef but module A cannot
import it (circular imports)
typedef mystring {
type string { length "1..10"; }
}
deviation /a:baz {
deviate replace {
type mystring;
}
}
}
Andy