public override QsDeclarationAttribute onAttribute(QsDeclarationAttribute att) { var declRoot = this._Scope.DeclarationOffset; this._Scope.DeclarationOffset = att.Offset; if (att.TypeId.IsValue) { this._Scope._Expression._Type.onUserDefinedType(att.TypeId.Item); } this._Scope._Expression.Transform(att.Argument); this._Scope.DeclarationOffset = declRoot; return(att); }
/// <summary> /// Adds the given attribute to all callables in the given compilation that satisfy the given predicate /// - if the predicate is specified and not null. /// </summary> public static QsCompilation AddToCallables(QsCompilation compilation, QsDeclarationAttribute attribute, CallablePredicate?predicate = null) =>
public IAttributeBuilder <QsCustomType> AddAttribute(QsDeclarationAttribute attribute) => new Udt(this.type.AddAttribute(attribute));
public IAttributeBuilder <QsCallable> AddAttribute(QsDeclarationAttribute attribute) => new Callable(this.callable.AddAttribute(attribute));
private static (string AlternativeOperation, string InSimulator) GetSubstitutionAttributeArguments(QsDeclarationAttribute attribute) =>
private static bool HasSubstitutionAttribute(QsDeclarationAttribute attribute) => attribute.TypeId.IsValue && attribute.TypeId.Item.Namespace == "Microsoft.Quantum.Targeting" && attribute.TypeId.Item.Name == "SubstitutableOnTarget";