Skip to content

Commit

Permalink
Local augments working
Browse files Browse the repository at this point in the history
  • Loading branch information
carl-andersson-at-westermo committed May 29, 2024
1 parent 082d070 commit 0ab9731
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions YangParser/SemanticModel/Augment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 0ab9731

Please sign in to comment.