diff --git a/YangParser/SemanticModel/Augment.cs b/YangParser/SemanticModel/Augment.cs index 411346a..b8f8a8d 100644 --- a/YangParser/SemanticModel/Augment.cs +++ b/YangParser/SemanticModel/Augment.cs @@ -73,14 +73,9 @@ public void Inject() } } - if (Argument.StartsWith("/")) - { - top = GetModule(components); - } - else - { - throw new SemanticError("TODO: Uses/Augment", Source); - } + top = Argument.StartsWith("/") ? GetModule(components) : Parent!; + + Parent?.Replace(this,[]); var target = GetTarget(top, components, sourceNS); @@ -148,7 +143,8 @@ private IStatement GetTarget(IStatement top, string[] components, string sourceN case Notification: break; default: - throw new SemanticError($"Augment target was disallowed type {current.GetType().Name}", Source); + throw new SemanticError($"Augment target '{Argument}' was disallowed type " + + $"'{current.GetType().Name} {current.Argument}'", Source); } return current;