Пример #1
0
        private static IDictionary <Token, bool> BuildEndTokens(bool enableNewLineAsEnd, FunctionMetaData meta)
        {
            var endTokens       = new Dictionary <Token, bool>();
            var formalEndTokens = enableNewLineAsEnd ? Terminators.ExpFluentFuncExpParenEnd : Terminators.ExpFuncExpEnd;

            foreach (var pair in formalEndTokens)
            {
                endTokens[pair.Key] = true;
            }

            if (meta == null)
            {
                return(endTokens);
            }

            // Go through all the arguments and use the
            if (meta.ArgumentsLookup != null && meta.ArgumentsLookup.Count > 0)
            {
                // Add all the parameter names and aliases to the map.
                foreach (var pair in meta.ArgumentsLookup)
                {
                    var idToken = TokenBuilder.ToIdentifier(pair.Value.Name);
                    endTokens[idToken] = true;
                    if (!string.IsNullOrEmpty(pair.Value.Alias))
                    {
                        idToken            = TokenBuilder.ToIdentifier(pair.Value.Alias);
                        endTokens[idToken] = true;
                    }
                }
            }
            return(endTokens);
        }
Пример #2
0
        /// <summary>
        /// Parses doctags supporting simple format for the 1st release.
        /// </summary>
        /// <param name="comments"></param>
        /// <returns></returns>
        public static Tuple <DocTags, List <string> > ParseDocTags(List <string> comments)
        {
            var commentTokens = new List <Token>();

            foreach (var comment in comments)
            {
                commentTokens.Add(TokenBuilder.ToComment(false, comment));
            }

            return(ParseDocTags(commentTokens));
        }