Exemplo n.º 1
0
        public IToken GetChangedToken(IToken token)
        {
            string newText = token.Text;

            newText = newText.Replace('"', ' ').Replace('\'', ' ').Trim();
            StringBuilder sb = new StringBuilder();

            sb.Append('\'');
            foreach (var item in newText.Split(' '))
            {
                if (item.Length != 0)
                {
                    if (factoryNames.ContainsName(newText) || isCreateNew)
                    {
                        sb.Append(factoryNames.GetShortName(item));
                    }
                    else
                    {
                        sb.Append(item);
                    }
                    sb.Append(' ');
                }
            }
            sb.Length--;
            sb.Append('\'');
            return(factoryTokens.Create(token.Type, sb.ToString()));
        }
Exemplo n.º 2
0
        public IToken GetChangedToken(IToken token)
        {
            string newText = token.Text;

            newText = newText.Replace('"', ' ').Replace('\'', ' ').Trim();
            if (factoryNames.ContainsName(newText))
            {
                StringBuilder sb = new StringBuilder();
                sb.Append('\'');
                sb.Append(factoryNames.GetShortName(newText));
                sb.Append('\'');
                newText = sb.ToString();
                return(factoryTokens.Create(token.Type, newText));
            }
            return(token);
        }