コード例 #1
0
        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);
        }
コード例 #2
0
 /// <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) =>
コード例 #3
0
ファイル: Extensions.cs プロジェクト: sycomix/qsharp-compiler
 public IAttributeBuilder <QsCustomType> AddAttribute(QsDeclarationAttribute attribute) =>
 new Udt(this.type.AddAttribute(attribute));
コード例 #4
0
ファイル: Extensions.cs プロジェクト: sycomix/qsharp-compiler
 public IAttributeBuilder <QsCallable> AddAttribute(QsDeclarationAttribute attribute) =>
 new Callable(this.callable.AddAttribute(attribute));
コード例 #5
0
 private static (string AlternativeOperation, string InSimulator) GetSubstitutionAttributeArguments(QsDeclarationAttribute attribute) =>
コード例 #6
0
 private static bool HasSubstitutionAttribute(QsDeclarationAttribute attribute) =>
 attribute.TypeId.IsValue && attribute.TypeId.Item.Namespace == "Microsoft.Quantum.Targeting" && attribute.TypeId.Item.Name == "SubstitutableOnTarget";