Example #1
0
			public override bool IsValidLineStarter(CodeNodeType nodeType)
			{
				if (nodeType == 30 || nodeType == 42 || nodeType == 19 || nodeType == 33 || nodeType == 31 || nodeType == 28 || nodeType == 29 || nodeType == 26 || nodeType == 25 || nodeType == 35)
				{
					return true;
				}
				return nodeType == 39;
			}
Example #2
0
 public CodeNode(string alias, int startLine, int endLine, string comment = null, CodeNodeType type = CodeNodeType.Function)
 {
     Alias     = alias;
     StartLine = startLine;
     EndLine   = endLine;
     Comment   = comment;
     NodeType  = type;
 }
Example #3
0
 public override bool IsValidLineStarter(CodeNodeType nodeType)
 {
     return(nodeType == CodeNodeType.FieldReferenceExpression ||
            nodeType == CodeNodeType.PropertyReferenceExpression ||
            nodeType == CodeNodeType.MethodInvocationExpression ||
            nodeType == CodeNodeType.SafeCastExpression ||
            nodeType == CodeNodeType.ExplicitCastExpression ||
            nodeType == CodeNodeType.ThisReferenceExpression ||
            nodeType == CodeNodeType.BaseReferenceExpression ||
            nodeType == CodeNodeType.VariableReferenceExpression ||
            nodeType == CodeNodeType.ArgumentReferenceExpression ||
            nodeType == CodeNodeType.TypeOfExpression ||
            nodeType == CodeNodeType.ArrayIndexerExpression);
 }
        private int GetImageIndex(CodeNodeType nodeType)
        {
            switch (nodeType)
            {
            case CodeNodeType.Function:
                return(-1);

            case CodeNodeType.AnonymousFunction:
                return(1);

            case CodeNodeType.Object:
                return(0);
            }

            return(-1);
        }
        private void ProcessVariableReferenceExpression(VariableReferenceExpression variableReferenceExpression)
        {
            VariableReference variableReference = variableReferenceExpression.Variable;

            if (this.variableToAssignedCodeNodeTypeMap.ContainsKey(variableReference))
            {
                CodeNodeType       variableAssignmentType = this.variableToAssignedCodeNodeTypeMap[variableReference];
                VariableDefinition variable = variableReference.Resolve();
                if (!this.variablesToNotInline.Contains(variable))
                {
                    if (!this.language.IsValidLineStarter(variableAssignmentType))
                    {
                        this.variablesToNotInline.Add(variable);
                    }
                }
            }
        }
 private bool IsValidObjectComparisonNode(CodeNodeType codeNodeType)
 {
     return(codeNodeType == CodeNodeType.AnonymousObjectCreationExpression ||
            codeNodeType == CodeNodeType.ArgumentReferenceExpression ||
            codeNodeType == CodeNodeType.FieldReferenceExpression ||
            codeNodeType == CodeNodeType.LiteralExpression ||
            codeNodeType == CodeNodeType.MethodInvocationExpression ||
            codeNodeType == CodeNodeType.ObjectCreationExpression ||
            codeNodeType == CodeNodeType.PropertyReferenceExpression ||
            codeNodeType == CodeNodeType.VariableReferenceExpression ||
            codeNodeType == CodeNodeType.ThisReferenceExpression ||
            codeNodeType == CodeNodeType.ArrayCreationExpression ||
            codeNodeType == CodeNodeType.ArrayIndexerExpression ||
            codeNodeType == CodeNodeType.LambdaExpression ||
            codeNodeType == CodeNodeType.LinqQueryExpression ||
            codeNodeType == CodeNodeType.UnaryExpression);
 }
Example #7
0
 public override bool IsValidLineStarter(CodeNodeType nodeType)
 {
     // As far as we know, basically all nodes can be line starters.
     return(true);
 }
 private bool IsValidObjectComparisonNode(CodeNodeType codeNodeType)
 {
     return codeNodeType == CodeNodeType.AnonymousObjectCreationExpression ||
            codeNodeType == CodeNodeType.ArgumentReferenceExpression ||
            codeNodeType == CodeNodeType.FieldReferenceExpression ||
            codeNodeType == CodeNodeType.LiteralExpression ||
            codeNodeType == CodeNodeType.MethodInvocationExpression ||
            codeNodeType == CodeNodeType.ObjectCreationExpression ||
            codeNodeType == CodeNodeType.PropertyReferenceExpression ||
            codeNodeType == CodeNodeType.VariableReferenceExpression ||
            codeNodeType == CodeNodeType.ThisReferenceExpression ||
            codeNodeType == CodeNodeType.ArrayCreationExpression ||
            codeNodeType == CodeNodeType.ArrayIndexerExpression ||
            codeNodeType == CodeNodeType.LambdaExpression ||
            codeNodeType == CodeNodeType.LinqQueryExpression ||
            codeNodeType == CodeNodeType.UnaryExpression;
 }
 public abstract bool IsValidLineStarter(CodeNodeType nodeType);
 public abstract bool IsValidLineStarter(CodeNodeType nodeType);
 public override bool IsValidLineStarter(CodeNodeType nodeType)
 {
     return nodeType == CodeNodeType.FieldReferenceExpression ||
            nodeType == CodeNodeType.PropertyReferenceExpression ||
            nodeType == CodeNodeType.MethodInvocationExpression ||
            nodeType == CodeNodeType.SafeCastExpression ||
            nodeType == CodeNodeType.CastExpression ||
            nodeType == CodeNodeType.ThisReferenceExpression ||
            nodeType == CodeNodeType.BaseReferenceExpression ||
            nodeType == CodeNodeType.VariableReferenceExpression ||
            nodeType == CodeNodeType.ArgumentReferenceExpression ||
            nodeType == CodeNodeType.TypeOfExpression ||
            nodeType == CodeNodeType.ArrayIndexerExpression;
 }
 public override bool IsValidLineStarter(CodeNodeType nodeType)
 {
     return(false);
 }
Example #13
0
			public override bool IsValidLineStarter(CodeNodeType nodeType)
			{
				return true;
			}
Example #14
0
        private int GetImageIndex(CodeNodeType nodeType)
        {
            switch (nodeType)
            {
                case CodeNodeType.Function:
                    return -1;
                case CodeNodeType.AnonymousFunction:
                    return 1;
                case CodeNodeType.Object:
                    return 0;
            }

            return -1;
        }
Example #15
0
 internal CodeNode(CodeNodeType type)
 {
     Flags |= CodeNodeFlags.Removable;
     Type   = type;
 }
 public override bool IsValidLineStarter(CodeNodeType nodeType)
 {
     return false;
 }