}
else { // capture test
++ ptr;
- asn = new CaptureAssertion ();
+ asn = new CaptureAssertion (new Literal (name, IsIgnoreCase (options)));
refs.Add (asn, name);
}
/* check bounds and ordering */
- if (n >= 0xffff || m >= 0xffff)
- throw NewParseException ("Illegal {x, y} - maximum of 65535.");
+ if (n > 0x7fffffff || m > 0x7fffffff)
+ throw NewParseException ("Illegal {x, y} - maximum of 2147483647.");
if (m >= 0 && m < n)
throw NewParseException ("Illegal {x, y} with x > y.");
if (m > 0)
max = m;
else
- max = 0xffff;
+ max = 0x7fffffff;
return true;
}
foreach (Expression expr in refs.Keys) {
string name = (string)refs[expr];
if (!dict.Contains (name)) {
+ if (expr is CaptureAssertion && !Char.IsDigit (name [0]))
+ continue;
throw NewParseException ("Reference to undefined group " +
(Char.IsDigit (name[0]) ? "number " : "name ") +
name);