Beispiel #1
0
        public bool hasNext()
        {
Label_0000:
            if (this.int_1 < this.int_0)
            {
                char ch = this.string_0[this.int_1];
                switch (ch)
                {
                case '\'':
                case '"':
                {
                    int num2 = ExpString.scanQuotation(this.string_0, this.int_1);
                    if (num2 < 0)
                    {
                        if (this.stringBuilder_0 != null)
                        {
                            this.stringBuilder_0.Append(this.string_0.Substring(this.int_1));
                        }
                        this.int_1    = this.int_0;
                        this.string_1 = null;
                        return(false);
                    }
                    if (this.stringBuilder_0 != null)
                    {
                        this.stringBuilder_0.Append(this.string_0.Substring(this.int_1, (num2 + 1) - this.int_1));
                    }
                    this.int_1 = num2 + 1;
                    goto Label_0000;
                }
                }
                if (ch != '$')
                {
                    this.int_1++;
                    if (this.stringBuilder_0 != null)
                    {
                        this.stringBuilder_0.Append(ch);
                    }
                }
                else
                {
                    if ((this.int_1 < this.int_0) && (this.string_0[this.int_1 + 1] == '{'))
                    {
                        int num = ExpString.scanBrace(this.string_0, this.int_1 + 1);
                        if (num < 0)
                        {
                            if (this.stringBuilder_0 != null)
                            {
                                this.stringBuilder_0.Append(this.string_0.Substring(this.int_1));
                            }
                            this.int_1    = this.int_0;
                            this.string_1 = null;
                            return(false);
                        }
                        if (this.stringBuilder_0 == null)
                        {
                            this.stringBuilder_0 = new StringBuilder(this.int_0 + 80);
                            this.stringBuilder_0.Append(this.string_0.Substring(0, this.int_1));
                        }
                        this.string_1 = this.string_0.Substring(this.int_1 + 2, num - (this.int_1 + 2));
                        this.int_1    = num + 1;
                        return(true);
                    }
                    this.int_1++;
                    if (this.stringBuilder_0 != null)
                    {
                        this.stringBuilder_0.Append(ch);
                    }
                }
                goto Label_0000;
            }
            this.string_1 = null;
            return(false);
        }
Beispiel #2
0
        public string next()
        {
            if ((this.string_0 == null) || (this.int_0 > this.int_1))
            {
                return(null);
            }
            int num = this.int_0;

            while (this.int_0 <= this.int_1)
            {
                int num2;
                if (this.int_0 == this.int_1)
                {
                    this.int_0++;
                    if ((this.int_1 <= 1) || (this.string_0[(this.int_1 - 1)] != this.char_0))
                    {
                        break;
                    }
                    return(!this.bool_0 ? "" : null);
                }
                char ch = this.string_0[(this.int_0)];
                switch (ch)
                {
                case '\\':
                    break;

                case '"':
                case '\'':
                {
                    num2 = ExpString.scanQuotation(this.string_0, this.int_0);
                    if (num2 < 0)
                    {
                        this.int_0 = this.int_1 + 1;
                        return(!this.bool_0 ? this.string_0.Substring(num) : null);
                    }
                    this.int_0 = num2 + 1;
                    continue;
                }

                default:
                {
                    if (!this.bool_1 || (ch != '('))
                    {
                        if (this.bool_2 && (ch == '['))
                        {
                            num2 = ExpString.scanBracket(this.string_0, this.int_0);
                            if (num2 < 0)
                            {
                                this.int_0 = this.int_1 + 1;
                                return(this.bool_0 ? null : this.string_0.Substring(num));
                            }
                            this.int_0 = num2 + 1;
                        }
                        else
                        {
                            if (!this.bool_3 || (ch != '{'))
                            {
                                this.int_0++;
                                if (ch != this.char_0)
                                {
                                    continue;
                                }
                                goto Label_01D4;
                            }
                            num2 = ExpString.scanBrace(this.string_0, this.int_0);
                            if (num2 < 0)
                            {
                                this.int_0 = this.int_1 + 1;
                                return(this.bool_0 ? null : this.string_0.Substring(num));
                            }
                            this.int_0 = num2 + 1;
                        }
                    }
                    else
                    {
                        num2 = ExpString.scanParenthesis(this.string_0, this.int_0);
                        if (num2 < 0)
                        {
                            this.int_0 = this.int_1 + 1;
                            return(!this.bool_0 ? this.string_0.Substring(num) : null);
                        }
                        this.int_0 = num2 + 1;
                    }
                    continue;
                }
                }
                this.int_0 += 2;
            }
Label_01D4:
            return(!this.bool_0 ? this.string_0.Substring(num, (this.int_0 - 1) - num) : null);
        }