SetUnimportantRange() public static method

public static SetUnimportantRange ( Token from, Token to ) : void
from Token
to Token
return void
Esempio n. 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());
        }
Esempio n. 2
0
        public Token RealCompleteText()
        {
            Token tok = this.RealNext();

            while (!tok.IsEnd() && !tok.IsQuote())
            {
                if (tok.IsControl() && tok.Whitespaces.Length == 0)
                {
                    tok++;
                }
                else if (tok.IsQuote() && tok.Whitespaces.Length == 0 && tok.RealNext().IsQuote())
                {
                    tok++;
                }
                tok++;
            }

            if (tok.IsEnd())
            {
                Program.Log("Text block not finished?");
                return(tok);
            }
            Tokenizer.SetUnimportantRange(this, tok);
            return(tok.RealNext());
        }
Esempio n. 3
0
        public Token RealCompleteLineComment()
        {
            Token tok = this.RealNext();

            while (!tok.IsEnd() && !tok.MakesNewLine())
            {
                tok = tok.RealNext();
            }
            if (tok.IsEnd())
            {
                Program.Log("Line comment without newline.");
                return(tok);
            }
            Tokenizer.SetUnimportantRange(this, tok);
            return(tok.RealNext());
        }
Esempio n. 4
0
        public Token RealCompleteBlockComment()
        {
            //Console.WriteLine("Starting block comment from "+this.Value);
            Token tok = this.RealNext();

            while (!tok.IsEnd() && !tok.IsBlockCommentEnd())
            {
                tok = tok.RealNext();
            }
            if (tok.IsEnd())
            {
                Console.Write("Block comment not finished?\n");
                return(tok);
            }
            Tokenizer.SetUnimportantRange(this, tok.RealNext());
            //Console.WriteLine("Ending block comment at " + tok.Value+tok.RealNext().Value+tok.RealNext().RealNext().Value);
            return(tok.RealNext().RealNext());
        }
Esempio n. 5
0
        public Token RealCompleteChar()
        {
            //Console.WriteLine("starting at " + this.Value + "," + this.RealNext().Value);
            Token tok = this.RealNext();

            while (!tok.IsEnd() && !tok.IsCharDelimiter())
            {
                //Console.Write(tok.Value + "|");
                tok++;
            }
            if (tok.IsEnd())
            {
                Program.Log("Char block not finished?");
                Console.ReadKey();
                return(tok);
            }
            Tokenizer.SetUnimportantRange(this, tok);
            return(tok.RealNext());
        }