summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Peterson2013-08-23 12:35:41 (EDT)
committerChris2013-08-28 16:53:34 (EDT)
commita341cb30ba2d913c92befa916b2ff04f767ade86 (patch)
tree5598f9c2dfd74976bfe04234f83751ec87b139a0
parent6e93b676f010d5108482ee488ac514e60b09b10b (diff)
downloadwebtools.jsdt.core-a341cb30ba2d913c92befa916b2ff04f767ade86.zip
webtools.jsdt.core-a341cb30ba2d913c92befa916b2ff04f767ade86.tar.gz
webtools.jsdt.core-a341cb30ba2d913c92befa916b2ff04f767ade86.tar.bz2
[326449] parser error on regular expression containing sequencev201308282108R3_5_1
Signed-off-by: Jason Peterson <jasonpet@us.ibm.com>
-rw-r--r--bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/Scanner.java17
1 files changed, 14 insertions, 3 deletions
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/Scanner.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/Scanner.java
index 99d5730..b1c8c15 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/Scanner.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/parser/Scanner.java
@@ -1884,6 +1884,7 @@ public NLSTag[] getNLSTags() {
public char[] getSource(){
return this.source;
}
+
public final void jumpOverMethodBody() {
this.wasAcr = false;
@@ -4324,7 +4325,8 @@ protected boolean checkIfRegExp() throws IndexOutOfBoundsException, InvalidInput
if (this.withoutUnicodePtr != 0) {
unicodeStore();
}
-
+ //inCharacterClass = true if any one character between brackets [...]
+ boolean inCharacterClass = false;
try {
loop: while (true) {
@@ -4337,9 +4339,18 @@ protected boolean checkIfRegExp() throws IndexOutOfBoundsException, InvalidInput
unicodeStore();
}
break;
+ case '[' :
+ inCharacterClass = true;
+ break;
+ case ']' :
+ inCharacterClass = false;
+ break;
case '/' :
- regExp = true;
- break loop;
+ if (!inCharacterClass) {
+ regExp = true;
+ break loop;
+ }
+ break;
case '\r' :
case '\n' :
break loop;