예제 #1
0
        public static JSDocNode Parse(JSDocSplitSet set, bool includeComments)
        {
            var items = JSDocHelper.GetItems(set);

            var result = JSDocNode.GetSpecificType(items);

            if (includeComments)
            {
                result.Snippet = set.Text;
            }

            result.Parse(items);

            return(result);
        }
예제 #2
0
        public void Parse(string text, bool includeComments)
        {
            var blocks = JSDocHelper.SpecialSplit(text, "/**", "*/");

            foreach (var block in blocks)
            {
                var node = JSDocNode.Parse(block, includeComments);
                if (node is JSDocFunction && !string.IsNullOrWhiteSpace(node?.Name))
                {
                    Functions.Add(node as JSDocFunction);
                }

                if (node is JSDocFile)
                {
                    File = node as JSDocFile;
                }
            }
        }