RealPrev() публичный Метод

public RealPrev ( ) : Token
Результат Token
Пример #1
0
        public Token RealCompleteDirective()
        {
            Token tok        = this;
            bool  no_control = true;

            while (!tok.IsEnd() && !tok.MakesNewLine() && no_control)
            {
                if (tok.IsQuote())
                {
                    tok = tok.RealCompleteText();
                    if (tok.RealPrev().MakesNewLine())
                    {
                        tok = tok.RealPrev();
                        break;
                    }
                    continue;
                }
                if (tok.IsControl())
                {
                    no_control = false;
                }
                if (tok.MakesNewLine())
                {
                    no_control = true;
                }
                tok = tok.RealNext();
            }

            Tokenizer.SetUnimportantRange(this, tok);
            return(tok.RealNext());
        }
Пример #2
0
        public Token Prev()
        {
            Token tok = this.RealPrev(); while (tok != null && tok.IsUnimportant())

            {
                tok = tok.RealPrev();
            }
            return(tok);
        }
Пример #3
0
        private void replaceWithArray(Token from, Token to)
        {
            Token arr = new Token();

            arr.Type  = Token.Typeenum.Identifier;
            arr.Value = "array";
            Token left = new Token();

            left.Type  = Token.Typeenum.Symbol;
            left.Value = "<";
            Token right = new Token();

            right.Type  = Token.Typeenum.TemplateClosure;
            right.Value = ">";
            linkTokens(arr, left);
            linkTokens(from.RealPrev(), arr);
            linkTokens(left, from);
            linkTokens(right, to.RealNext());
            if (right.Next().IsIdentifier() || right.Next().Type == Token.Typeenum.TemplateClosure)
            {
                right.Whitespaces = " ";
            }
            linkTokens(to, right);
        }
Пример #4
0
 private void replaceWithArray(Token from, Token to)
 {
     Token arr = new Token();
     arr.Type = Token.Typeenum.Identifier;
     arr.Value = "array";
     Token left = new Token();
     left.Type = Token.Typeenum.Symbol;
     left.Value = "<";
     Token right = new Token();
     right.Type = Token.Typeenum.TemplateClosure;
     right.Value = ">";
     linkTokens(arr, left);
     linkTokens(from.RealPrev(), arr);
     linkTokens(left,from);
     linkTokens(right,to.RealNext());
     if (right.Next().IsIdentifier() || right.Next().Type == Token.Typeenum.TemplateClosure) right.Whitespaces = " ";
     linkTokens(to, right);
 }