CodeBox.CodeLexer.TokenList.ParseStringConstant C# (CSharp) Метод

ParseStringConstant() приватный Метод

private ParseStringConstant ( string code, Position position, List indices ) : string
code string
position Position
indices List
Результат string
        private string ParseStringConstant(string code, Position position, List<Index> indices)
        {
            string result = "";

            indices.Add(new Index(position.LineNumber, position.CharNumber));
            position.MoveIndex();

            while ((code.Length > position.CurrentIndex) && (code[position.CurrentIndex] != '"'))
            {
                result += code[position.CurrentIndex];
                indices.Add(new Index(position.LineNumber, position.CharNumber));
                position.MoveIndex();
            }

            if (code.Length > position.CurrentIndex) // record last (")
            {
                indices.Add(new Index(position.LineNumber, position.CharNumber));
                position.MoveIndex();
            }

            return result;
        }