You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by el...@apache.org on 2001/06/04 22:00:29 UTC

cvs commit: xml-xerces/java/src/org/apache/xerces/utils/regex RegularExpression.java

elena       01/06/04 13:00:29

  Modified:    java/src/org/apache/xerces/utils/regex
                        RegularExpression.java
  Log:
  fix for union of patterns
  
  Revision  Changes    Path
  1.4       +20 -9     xml-xerces/java/src/org/apache/xerces/utils/regex/RegularExpression.java
  
  Index: RegularExpression.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/utils/regex/RegularExpression.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- RegularExpression.java	2000/06/20 23:57:18	1.3
  +++ RegularExpression.java	2001/06/04 20:00:29	1.4
  @@ -1219,8 +1219,10 @@
               case Op.UNION:
                   for (int i = 0;  i < op.size();  i ++) {
                       int ret = this. matchCharArray (con, op.elementAt(i), offset, dx, opts);
  -                    //System.err.println("UNION: "+i+", ret="+ret);
  -                    if (ret >= 0)  return ret;
  +                    if (DEBUG) {
  +                        System.err.println("UNION: "+i+", ret="+ret);
  +                    }
  +                    if (ret == con.length )  return ret;
                   }
                   return -1;
   
  @@ -1466,8 +1468,14 @@
           con.match = match;
   
           if (this.isSet(this.options, XMLSCHEMA_MODE)) {
  +            if (DEBUG) {
  +                System.err.println("target string="+target);
  +            }
               int matchEnd = this. matchString (con, this.operations, con.start, 1, this.options);
  -            //System.err.println("DEBUG: matchEnd="+matchEnd);
  +            if (DEBUG) {
  +                System.err.println("matchEnd="+matchEnd);
  +                System.err.println("con.limit="+con.limit);
  +            }
               if (matchEnd == con.limit) {
                   if (con.match != null) {
                       con.match.setBeginning(0, con.start);
  @@ -1903,7 +1911,6 @@
                               break;
                           }
                       }
  -
                       int ret = this. matchString (con, op.getChild(), offset, dx, opts);
                       if (id >= 0)  con.offsets[id] = -1;
                       if (ret >= 0)  return ret;
  @@ -1931,8 +1938,10 @@
               case Op.UNION:
                   for (int i = 0;  i < op.size();  i ++) {
                       int ret = this. matchString (con, op.elementAt(i), offset, dx, opts);
  -                    //System.err.println("UNION: "+i+", ret="+ret);
  -                    if (ret >= 0)  return ret;
  +                    if (DEBUG) {
  +                        System.err.println("UNION: "+i+", ret="+ret);
  +                    }
  +                    if (ret == con.length )  return ret;
                   }
                   return -1;
   
  @@ -2549,7 +2558,7 @@
                               break;
                           }
                       }
  -
  +                    
                       int ret = this. matchCharacterIterator (con, op.getChild(), offset, dx, opts);
                       if (id >= 0)  con.offsets[id] = -1;
                       if (ret >= 0)  return ret;
  @@ -2577,8 +2586,10 @@
               case Op.UNION:
                   for (int i = 0;  i < op.size();  i ++) {
                       int ret = this. matchCharacterIterator (con, op.elementAt(i), offset, dx, opts);
  -                    //System.err.println("UNION: "+i+", ret="+ret);
  -                    if (ret >= 0)  return ret;
  +                    if (DEBUG) {
  +                        System.err.println("UNION: "+i+", ret="+ret);
  +                    }
  +                    if (ret == con.length)  return ret;
                   }
                   return -1;
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org