Esempio n. 1
0
        private void ReadVarSpec(char ch)
        {
            if (TryReadEndVarSpec(ch))
            {
                return;
            }

            if (ch == '*')
            {
                token = Token.VarSpecExploded;
            }
            else if (ch == ':')
            {
                varSpecMaxLength = -1;
                token            = Token.VarSpecMaxLength;
            }
            else if (!CharSpec.IsVarChar(ch))
            {
                ThrowException("Invalid name of template variable.");
            }
            else
            {
                builder.Append(ch);
            }
        }
Esempio n. 2
0
        private static bool IsWellFormedName(string name)
        {
            for (var i = 0; i < name.Length; i++)
            {
                if (!CharSpec.IsVarChar(name[i]))
                {
                    return(false);
                }
            }

            return(true);
        }