Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/STextRegex.java')
-rw-r--r--bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/STextRegex.java14
1 files changed, 8 insertions, 6 deletions
diff --git a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/STextRegex.java b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/STextRegex.java
index 4816d4e0d..93edff294 100644
--- a/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/STextRegex.java
+++ b/bundles/org.eclipse.equinox.bidi/src/org/eclipse/equinox/bidi/internal/consumable/STextRegex.java
@@ -11,10 +11,8 @@
package org.eclipse.equinox.bidi.internal.consumable;
import org.eclipse.equinox.bidi.STextDirection;
-import org.eclipse.equinox.bidi.advanced.ISTextExpert;
-import org.eclipse.equinox.bidi.advanced.STextEnvironment;
+import org.eclipse.equinox.bidi.advanced.*;
import org.eclipse.equinox.bidi.custom.*;
-import org.eclipse.equinox.bidi.internal.STextImpl;
/**
* <code>STextRegex</code> is a handler for regular expressions.
@@ -64,6 +62,8 @@ public class STextRegex extends STextTypeHandler {
static final byte AL = Character.DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC;
static final byte AN = Character.DIRECTIONALITY_ARABIC_NUMBER;
static final byte EN = Character.DIRECTIONALITY_EUROPEAN_NUMBER;
+ private static final Integer INTEGER_1 = new Integer(1);
+ private static final Integer INTEGER_17 = new Integer(17);
/**
* This method retrieves the number of special cases handled by this handler.
@@ -146,9 +146,11 @@ public class STextRegex extends STextTypeHandler {
/**
* This method process the special cases.
*/
- public int processSpecial(STextEnvironment environment, String text, STextCharTypes charTypes, STextOffsets offsets, int[] state, int caseNumber, int separLocation) {
+ public int processSpecial(STextEnvironment environment, String text, STextCharTypes charTypes, STextOffsets offsets, Object state, int caseNumber, int separLocation) {
int location;
+ if (separLocation < 0)
+ caseNumber = ((Integer) STextState.getValueAndReset(state)).intValue();
switch (caseNumber) {
case 1 : /* comment (?#...) */
if (separLocation < 0) {
@@ -161,7 +163,7 @@ public class STextRegex extends STextTypeHandler {
}
location = text.indexOf(')', location);
if (location < 0) {
- STextImpl.setState(state, caseNumber);
+ STextState.setValue(state, INTEGER_1);
return text.length();
}
return location + 1;
@@ -201,7 +203,7 @@ public class STextRegex extends STextTypeHandler {
}
location = text.indexOf("\\E", location); //$NON-NLS-1$
if (location < 0) {
- STextImpl.setState(state, caseNumber);
+ STextState.setValue(state, INTEGER_17);
return text.length();
}
// set the charType for the "E" to L (Left to Right character)

Back to the top