in src/Core/Compiling/Policy/SetHeaderCompiler.cs [34:59]
public void Handle(ICompilationContext context, InvocationExpressionSyntax node)
{
var arguments = node.ArgumentList.Arguments;
if (_type != "delete" && arguments.Count < 2 ||
_type == "delete" && arguments.Count != 1)
{
context.Report(Diagnostic.Create(
CompilationErrors.ArgumentCountMissMatchForPolicy,
node.ArgumentList.GetLocation(),
"set-header"));
return;
}
var element = new XElement("set-header");
var name = node.ArgumentList.Arguments[0].Expression.ProcessParameter(context);
element.Add(new XAttribute("name", name));
element.Add(new XAttribute("exists-action", _type));
for (int i = 1; i < arguments.Count; i++)
{
element.Add(new XElement("value", arguments[i].Expression.ProcessParameter(context)));
}
context.AddPolicy(element);
}