public static bool ContainsComment(SyntaxNode node, TextSpan span)
        {
            ContainsCommentWalker walker = GetInstance(span);

            walker.Visit(node);

            bool result = walker.Result;

            Free(walker);

            return(result);
        }
示例#2
0
        public static ContainsCommentWalker GetInstance(TextSpan span)
        {
            ContainsCommentWalker walker = _cachedInstance;

            if (walker != null)
            {
                _cachedInstance = null;
                walker.Result   = false;
                walker.Span     = span;
                return(walker);
            }

            return(new ContainsCommentWalker(span));
        }
 public static void Free(ContainsCommentWalker walker)
 {
     _cachedInstance = walker;
 }