Example #1
0
        protected virtual ResourceAccessSyntax ReplaceResourceAccessSyntax(ResourceAccessSyntax syntax)
        {
            var hasChanges = Rewrite(syntax.BaseExpression, out var baseExpression);

            hasChanges |= Rewrite(syntax.Colon, out var colon);
            hasChanges |= Rewrite(syntax.ResourceName, out var propertyName);

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

            return(new ResourceAccessSyntax(baseExpression, colon, propertyName));
        }
Example #2
0
        protected virtual SyntaxBase ReplaceResourceAccessSyntax(ResourceAccessSyntax syntax)
        {
            var hasChanges = TryRewrite(syntax.BaseExpression, out var baseExpression);

            hasChanges |= TryRewriteStrict(syntax.DoubleColon, out var doubleColon);
            hasChanges |= TryRewriteStrict(syntax.ResourceName, out var propertyName);

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

            return(new ResourceAccessSyntax(baseExpression, doubleColon, propertyName));
        }
Example #3
0
 void ISyntaxVisitor.VisitResourceAccessSyntax(ResourceAccessSyntax syntax) => ReplaceCurrent(syntax, ReplaceResourceAccessSyntax);
Example #4
0
 public virtual void VisitResourceAccessSyntax(ResourceAccessSyntax syntax)
 {
     this.Visit(syntax.BaseExpression);
     this.Visit(syntax.DoubleColon);
     this.Visit(syntax.ResourceName);
 }