Ejemplo n.º 1
0
        public bool CheckVariableDeclaration(ICS.VariableDeclarationStatement node, InspectionData data)
        {
            if ((MatchKind != 0 && (MatchKind & DeclarationKinds.LocalVariable) == 0) || !CheckModifiers(node.Modifiers, ICS.Modifiers.Private))
            {
                return(false);
            }
            var member = data.Document.CompilationUnit.GetMemberAt(node.StartLocation.Line, node.StartLocation.Column);

            foreach (var var in node.Variables)
            {
                string name = var.Name;
                if (IsValid(name))
                {
                    continue;
                }
                var v = new LocalVariable(member, name, DomReturnType.Void,
                                          new DomRegion(node.StartLocation.Line, node.StartLocation.Column,
                                                        node.EndLocation.Line, node.EndLocation.Column));
                data.Add(GetFixableResult(var.NameToken.StartLocation, v, name));
            }

            return(true);
        }
 public static VariableDeclaration Variable(NRefactory.VariableDeclarationStatement variableDeclaration, IScope scope, INRefcatoryExpressionVisitor visitor)
 {
     return(new VariableDeclaration(variableDeclaration, scope, visitor));
 }
        protected internal override bool DoMatch(AstNode other, PatternMatching.Match match)
        {
            VariableDeclarationStatement o = other as VariableDeclarationStatement;

            return(o != null && this.Modifiers == o.Modifiers && this.Type.DoMatch(o.Type, match) && this.Variables.DoMatch(o.Variables, match));
        }
Ejemplo n.º 4
0
 public virtual S VisitVariableDeclarationStatement(VariableDeclarationStatement variableDeclarationStatement, T data)
 {
     return(VisitChildren(variableDeclarationStatement, data));
 }
 public virtual S VisitVariableDeclarationStatement(VariableDeclarationStatement variableDeclarationStatement, T data)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 6
0
 public override AstExpression VisitVariableDeclarationStatement(NRefactory.VariableDeclarationStatement variableDeclarationStatement, IScope scope)
 {
     return(AstExpression.Variable(variableDeclarationStatement, scope, this));
 }