[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jakarta-oro-dev
Subject:    cvs commit: jakarta-oro/src/java/org/apache/oro/text/regex Perl5Matcher.java
From:       dfs () apache ! org
Date:       2001-11-14 2:39:37
[Download RAW message or body]

dfs         01/11/13 18:39:37

  Modified:    .        CHANGES
               src/java/org/apache/oro/text/regex Perl5Matcher.java
  Log:
  Fixed [[:upper:]] so it would match lower case characters during case
  insensitive matches.
  PR: 4854
  
  Revision  Changes    Path
  1.20      +4 -1      jakarta-oro/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/jakarta-oro/CHANGES,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- CHANGES	2001/11/14 01:30:08	1.19
  +++ CHANGES	2001/11/14 02:39:37	1.20
  @@ -1,6 +1,9 @@
  -$Id: CHANGES,v 1.19 2001/11/14 01:30:08 dfs Exp $
  +$Id: CHANGES,v 1.20 2001/11/14 02:39:37 dfs Exp $
   
   Version 2.x.x
  +
  +o Fixed [[:upper:]] so it would match lower case characters during case
  +  insensitive matches.
   
   o Fixed [[:punct:]] (which also affected [[:print:]] and [[:graph:]])
     to conform to Single Unix Specification (some characters had been
  
  
  
  1.17      +14 -2     jakarta-oro/src/java/org/apache/oro/text/regex/Perl5Matcher.java
  
  Index: Perl5Matcher.java
  ===================================================================
  RCS file: /home/cvs/jakarta-oro/src/java/org/apache/oro/text/regex/Perl5Matcher.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- Perl5Matcher.java	2001/11/14 01:30:08	1.16
  +++ Perl5Matcher.java	2001/11/14 02:39:37	1.17
  @@ -59,7 +59,7 @@
   
   
   /*
  - * $Id: Perl5Matcher.java,v 1.16 2001/11/14 01:30:08 dfs Exp $
  + * $Id: Perl5Matcher.java,v 1.17 2001/11/14 02:39:37 dfs Exp $
    */
   import java.io.IOException;
   import java.util.*;
  @@ -80,6 +80,7 @@
     private static final int __INITIAL_NUM_OFFSETS = 20;
   
     private boolean __multiline = false, __lastSuccess = false;
  +  private boolean __caseInsensitive = false;
     private char __previousChar, __input[], __originalInput[];
     private Perl5Repetition __currentRep;
     private int __numParentheses, __bol, __eol, __currentOffset, __endOffset;
  @@ -198,6 +199,9 @@
   					int beginOffset, int endOffset,
   					int currentOffset)
     {
  +    // Remove this hack after more efficient case-folding and unicode
  +    // character classes are implemented
  +    __caseInsensitive            = expression._isCaseInsensitive;
       __input                      = input;
       __endOffset                  = endOffset;
       __currentRep                 = new Perl5Repetition();
  @@ -684,9 +688,17 @@
   	  break;
   	case OpCode._LOWER:
   	  if(Character.isLowerCase(code)) return isANYOF;
  +	  // Remove this hack after more efficient case-folding and unicode
  +	  // character classes are implemented
  +	  if(__caseInsensitive && Character.isUpperCase(code))
  +	    return isANYOF;
   	  break;
   	case OpCode._UPPER:
   	  if(Character.isUpperCase(code)) return isANYOF;
  +	  // Remove this hack after more efficient case-folding and unicode
  +	  // character classes are implemented
  +	  if(__caseInsensitive && Character.isLowerCase(code))
  +	    return isANYOF;
   	  break;
   	case OpCode._PRINT:
   	  if(Character.isSpaceChar(code)) return isANYOF;
  @@ -1651,7 +1663,7 @@
         inp = __originalInput;
   
       __initInterpreterGlobals(expression, inp, input._beginOffset,
  -			    input._endOffset, input._beginOffset);
  +			     input._endOffset, input._beginOffset);
   
       __lastMatchResult = null;
   
  
  
  

--
To unsubscribe, e-mail:   <mailto:oro-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:oro-dev-help@jakarta.apache.org>

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic