ScriptsRefactorer.Token.IsLeftBracket C# (CSharp) Method

IsLeftBracket() public method

public IsLeftBracket ( ) : bool
return bool
        public bool IsLeftBracket()
        {
            return IsSymbol() && Value == "{";
        }

Usage Example

Esempio n. 1
0
        public Token PreCompleteClass()
        {
            Token tok = this.Next();

            while (!tok.IsEnd() && !tok.IsLeftBracket())
            {
                tok = tok.Next();
            }
            if (tok.IsEnd())
            {
                Program.Log("Bad class definition?\n");
                return(tok);
            }
            int depth = 1;

            while (depth > 0)
            {
                tok = tok.Next();
                if (tok.IsEnd())
                {
                    Program.Log("Failure on class closure: " + this.Next().Value);
                    return(tok);
                }
                if (tok.IsLeftBracket())
                {
                    depth++;
                }
                else if (tok.IsRightBracket())
                {
                    depth--;
                }
            }
            return(tok);
        }
All Usage Examples Of ScriptsRefactorer.Token::IsLeftBracket