private RegExp ParseCharClassExp() { if (this.Match('[')) { bool negate = false; if (this.Match('^')) { negate = true; } RegExp e = this.ParseCharClasses(); if (negate) { e = RegExp.MakeIntersection(RegExp.MakeAnyChar(), RegExp.MakeComplement(e)); } if (!this.Match(']')) { throw new ArgumentException("expected ']' at position " + this.pos); } return(e); } return(this.ParseSimpleExp()); }
private RegExp ParseComplExp() { if (this.Check(RegExpSyntaxOptions.Complement) && this.Match('~')) { return(RegExp.MakeComplement(this.ParseComplExp())); } return(this.ParseCharClassExp()); }