Exemplo n.º 1
0
 public virtual void VisitResourceDeclarationSyntax(ResourceDeclarationSyntax syntax)
 {
     this.Visit(syntax.Keyword);
     this.Visit(syntax.Name);
     this.Visit(syntax.Type);
     this.Visit(syntax.Assignment);
     this.Visit(syntax.Body);
 }
Exemplo n.º 2
0
 public virtual void VisitResourceDeclarationSyntax(ResourceDeclarationSyntax syntax)
 {
     this.VisitNodes(syntax.LeadingNodes);
     this.Visit(syntax.Keyword);
     this.Visit(syntax.Name);
     this.Visit(syntax.Type);
     this.Visit(syntax.ExistingKeyword);
     this.Visit(syntax.Assignment);
     this.Visit(syntax.Value);
 }
Exemplo n.º 3
0
 public virtual void VisitResourceDeclarationSyntax(ResourceDeclarationSyntax syntax)
 {
     this.VisitNodes(syntax.LeadingNodes);
     this.Visit(syntax.Keyword);
     this.Visit(syntax.Name);
     this.Visit(syntax.Type);
     this.Visit(syntax.Assignment);
     this.Visit(syntax.IfCondition);
     this.Visit(syntax.Body);
 }
Exemplo n.º 4
0
        protected virtual ResourceDeclarationSyntax ReplaceResourceDeclarationSyntax(ResourceDeclarationSyntax syntax)
        {
            var hasChanges = Rewrite(syntax.Keyword, out var keyword);

            hasChanges |= Rewrite(syntax.Name, out var name);
            hasChanges |= Rewrite(syntax.Type, out var type);
            hasChanges |= Rewrite(syntax.Assignment, out var assignment);
            hasChanges |= Rewrite(syntax.Body, out var body);

            if (!hasChanges)
            {
                return(syntax);
            }

            return(new ResourceDeclarationSyntax(keyword, name, type, assignment, body));
        }
Exemplo n.º 5
0
        protected virtual SyntaxBase ReplaceResourceDeclarationSyntax(ResourceDeclarationSyntax syntax)
        {
            var hasChanges = TryRewrite(syntax.LeadingNodes, out var leadingNodes);

            hasChanges |= TryRewriteStrict(syntax.Keyword, out var keyword);
            hasChanges |= TryRewriteStrict(syntax.Name, out var name);
            hasChanges |= TryRewrite(syntax.Type, out var type);
            hasChanges |= TryRewriteStrict(syntax.ExistingKeyword, out var existingKeyword);
            hasChanges |= TryRewrite(syntax.Assignment, out var assignment);
            hasChanges |= TryRewrite(syntax.Value, out var value);

            if (!hasChanges)
            {
                return(syntax);
            }

            return(new ResourceDeclarationSyntax(leadingNodes, keyword, name, type, existingKeyword, assignment, value));
        }
Exemplo n.º 6
0
        protected virtual ResourceDeclarationSyntax ReplaceResourceDeclarationSyntax(ResourceDeclarationSyntax syntax)
        {
            var hasChanges = Rewrite(syntax.LeadingNodes, out var leadingNodes);

            hasChanges |= Rewrite(syntax.Keyword, out var keyword);
            hasChanges |= Rewrite(syntax.Name, out var name);
            hasChanges |= Rewrite(syntax.Type, out var type);
            hasChanges |= Rewrite(syntax.Assignment, out var assignment);
            hasChanges |= RewriteNullable(syntax.IfCondition, out var ifExpression);
            hasChanges |= Rewrite(syntax.Body, out var body);

            if (!hasChanges)
            {
                return(syntax);
            }

            return(new ResourceDeclarationSyntax(leadingNodes, keyword, name, type, assignment, ifExpression, body));
        }
Exemplo n.º 7
0
 void ISyntaxVisitor.VisitResourceDeclarationSyntax(ResourceDeclarationSyntax syntax) => ReplaceCurrent(syntax, ReplaceResourceDeclarationSyntax);
Exemplo n.º 8
0
 public static bool ReferencesResource(this VariableAccessSyntax syntax, ResourceDeclarationSyntax resource)
 => LanguageConstants.IdentifierComparer.Equals(syntax.Name.IdentifierName, resource.Name.IdentifierName);