mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
RUBY-12899: added option to RegExp parser to accept \h and \H as char class.
This commit is contained in:
@@ -24,5 +24,6 @@ public enum RegExpCapability {
|
||||
NESTED_CHARACTER_CLASSES,
|
||||
OCTAL_NO_LEADING_ZERO,
|
||||
OMIT_NUMBERS_IN_QUANTIFIERS,
|
||||
COMMENT_MODE
|
||||
COMMENT_MODE,
|
||||
ALLOW_HEX_DIGIT_CLASS,
|
||||
}
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
/* The following code was generated by JFlex 1.4.3 on 10/1/12 11:19 AM */
|
||||
/* The following code was generated by JFlex 1.4.3 on 2/9/13 3:43 PM */
|
||||
|
||||
/* It's an automatically generated code. Do not modify it. */
|
||||
package org.intellij.lang.regexp;
|
||||
|
||||
import com.intellij.lexer.FlexLexer;
|
||||
import com.intellij.psi.StringEscapesTokenTypes;
|
||||
import com.intellij.psi.tree.IElementType;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.EnumSet;
|
||||
import com.intellij.psi.StringEscapesTokenTypes;
|
||||
|
||||
// IDEADEV-11055
|
||||
@SuppressWarnings({ "ALL", "SameParameterValue", "WeakerAccess", "SameReturnValue", "RedundantThrows", "UnusedDeclaration", "UnusedDeclaration" })
|
||||
@@ -16,7 +15,7 @@ import java.util.LinkedList;
|
||||
/**
|
||||
* This class is a scanner generated by
|
||||
* <a href="http://www.jflex.de/">JFlex</a> 1.4.3
|
||||
* on 10/1/12 11:19 AM from the specification file
|
||||
* on 2/9/13 3:43 PM from the specification file
|
||||
* <tt>C:/work/IDEA/tools/lexer/../../community/RegExpSupport/src/org/intellij/lang/regexp/regexp-lexer.flex</tt>
|
||||
*/
|
||||
class _RegExLexer implements FlexLexer {
|
||||
@@ -53,73 +52,73 @@ class _RegExLexer implements FlexLexer {
|
||||
* Translates characters to character classes
|
||||
*/
|
||||
private static final String ZZ_CMAP_PACKED =
|
||||
"\10\0\2\52\1\13\1\0\1\52\1\62\22\0\1\45\1\56\1\0"+
|
||||
"\1\60\1\15\1\0\1\51\1\61\1\4\1\5\1\17\1\20\1\50"+
|
||||
"\1\43\1\3\1\0\1\2\7\42\2\1\1\53\1\0\1\57\1\55"+
|
||||
"\1\54\1\16\1\0\1\24\1\24\1\30\1\27\1\37\1\35\1\25"+
|
||||
"\1\44\1\32\6\44\1\34\1\36\1\44\1\26\3\44\1\26\1\26"+
|
||||
"\1\44\1\25\1\10\1\12\1\11\1\14\1\46\1\0\1\23\1\24"+
|
||||
"\1\31\1\27\1\23\1\23\2\44\1\32\4\44\1\22\1\44\1\33"+
|
||||
"\1\44\1\22\1\26\1\22\1\41\1\44\1\26\1\40\1\44\1\25"+
|
||||
"\1\6\1\21\1\7\54\0\1\44\12\0\1\44\4\0\1\44\5\0"+
|
||||
"\27\44\1\0\37\44\1\0\u013f\44\31\0\162\44\4\0\14\44\16\0"+
|
||||
"\5\44\11\0\1\44\213\0\1\44\13\0\1\44\1\0\3\44\1\0"+
|
||||
"\1\44\1\0\24\44\1\0\54\44\1\0\46\44\1\0\5\44\4\0"+
|
||||
"\202\44\10\0\105\44\1\0\46\44\2\0\2\44\6\0\20\44\41\0"+
|
||||
"\46\44\2\0\1\44\7\0\47\44\110\0\33\44\5\0\3\44\56\0"+
|
||||
"\32\44\5\0\13\44\25\0\12\47\4\0\2\44\1\0\143\44\1\0"+
|
||||
"\1\44\17\0\2\44\7\0\2\44\12\47\3\44\2\0\1\44\20\0"+
|
||||
"\1\44\1\0\36\44\35\0\3\44\60\0\46\44\13\0\1\44\u0152\0"+
|
||||
"\66\44\3\0\1\44\22\0\1\44\7\0\12\44\4\0\12\47\25\0"+
|
||||
"\10\44\2\0\2\44\2\0\26\44\1\0\7\44\1\0\1\44\3\0"+
|
||||
"\4\44\3\0\1\44\36\0\2\44\1\0\3\44\4\0\12\47\2\44"+
|
||||
"\23\0\6\44\4\0\2\44\2\0\26\44\1\0\7\44\1\0\2\44"+
|
||||
"\1\0\2\44\1\0\2\44\37\0\4\44\1\0\1\44\7\0\12\47"+
|
||||
"\2\0\3\44\20\0\11\44\1\0\3\44\1\0\26\44\1\0\7\44"+
|
||||
"\1\0\2\44\1\0\5\44\3\0\1\44\22\0\1\44\17\0\2\44"+
|
||||
"\4\0\12\47\25\0\10\44\2\0\2\44\2\0\26\44\1\0\7\44"+
|
||||
"\1\0\2\44\1\0\5\44\3\0\1\44\36\0\2\44\1\0\3\44"+
|
||||
"\4\0\12\47\1\0\1\44\21\0\1\44\1\0\6\44\3\0\3\44"+
|
||||
"\1\0\4\44\3\0\2\44\1\0\1\44\1\0\2\44\3\0\2\44"+
|
||||
"\3\0\3\44\3\0\10\44\1\0\3\44\55\0\11\47\25\0\10\44"+
|
||||
"\1\0\3\44\1\0\27\44\1\0\12\44\1\0\5\44\46\0\2\44"+
|
||||
"\4\0\12\47\25\0\10\44\1\0\3\44\1\0\27\44\1\0\12\44"+
|
||||
"\1\0\5\44\3\0\1\44\40\0\1\44\1\0\2\44\4\0\12\47"+
|
||||
"\25\0\10\44\1\0\3\44\1\0\27\44\1\0\20\44\46\0\2\44"+
|
||||
"\4\0\12\47\25\0\22\44\3\0\30\44\1\0\11\44\1\0\1\44"+
|
||||
"\2\0\7\44\72\0\60\44\1\0\2\44\14\0\7\44\11\0\12\47"+
|
||||
"\47\0\2\44\1\0\1\44\2\0\2\44\1\0\1\44\2\0\1\44"+
|
||||
"\6\0\4\44\1\0\7\44\1\0\3\44\1\0\1\44\1\0\1\44"+
|
||||
"\2\0\2\44\1\0\4\44\1\0\2\44\11\0\1\44\2\0\5\44"+
|
||||
"\1\0\1\44\11\0\12\47\2\0\2\44\42\0\1\44\37\0\12\47"+
|
||||
"\26\0\10\44\1\0\42\44\35\0\4\44\164\0\42\44\1\0\5\44"+
|
||||
"\1\0\2\44\25\0\12\47\6\0\6\44\112\0\46\44\12\0\51\44"+
|
||||
"\7\0\132\44\5\0\104\44\5\0\122\44\6\0\7\44\1\0\77\44"+
|
||||
"\1\0\1\44\1\0\4\44\2\0\7\44\1\0\1\44\1\0\4\44"+
|
||||
"\2\0\47\44\1\0\1\44\1\0\4\44\2\0\37\44\1\0\1\44"+
|
||||
"\1\0\4\44\2\0\7\44\1\0\1\44\1\0\4\44\2\0\7\44"+
|
||||
"\1\0\7\44\1\0\27\44\1\0\37\44\1\0\1\44\1\0\4\44"+
|
||||
"\2\0\7\44\1\0\47\44\1\0\23\44\16\0\11\47\56\0\125\44"+
|
||||
"\14\0\u026c\44\2\0\10\44\12\0\32\44\5\0\113\44\25\0\15\44"+
|
||||
"\1\0\4\44\16\0\22\44\16\0\22\44\16\0\15\44\1\0\3\44"+
|
||||
"\17\0\64\44\43\0\1\44\4\0\1\44\3\0\12\47\46\0\12\47"+
|
||||
"\6\0\130\44\10\0\51\44\127\0\35\44\51\0\12\47\36\44\2\0"+
|
||||
"\5\44\u038b\0\154\44\224\0\234\44\4\0\132\44\6\0\26\44\2\0"+
|
||||
"\6\44\2\0\46\44\2\0\6\44\2\0\10\44\1\0\1\44\1\0"+
|
||||
"\1\44\1\0\1\44\1\0\37\44\2\0\65\44\1\0\7\44\1\0"+
|
||||
"\1\44\3\0\3\44\1\0\7\44\3\0\4\44\2\0\6\44\4\0"+
|
||||
"\15\44\5\0\3\44\1\0\7\44\164\0\1\44\15\0\1\44\202\0"+
|
||||
"\1\44\4\0\1\44\2\0\12\44\1\0\1\44\3\0\5\44\6\0"+
|
||||
"\1\44\1\0\1\44\1\0\1\44\1\0\4\44\1\0\3\44\1\0"+
|
||||
"\7\44\3\0\3\44\5\0\5\44\u0ebb\0\2\44\52\0\5\44\5\0"+
|
||||
"\2\44\4\0\126\44\6\0\3\44\1\0\132\44\1\0\4\44\5\0"+
|
||||
"\50\44\4\0\136\44\21\0\30\44\70\0\20\44\u0200\0\u19b6\44\112\0"+
|
||||
"\u51a6\44\132\0\u048d\44\u0773\0\u2ba4\44\u215c\0\u012e\44\2\0\73\44\225\0"+
|
||||
"\7\44\14\0\5\44\5\0\1\44\1\0\12\44\1\0\15\44\1\0"+
|
||||
"\5\44\1\0\1\44\1\0\2\44\1\0\2\44\1\0\154\44\41\0"+
|
||||
"\u016b\44\22\0\100\44\2\0\66\44\50\0\14\44\164\0\5\44\1\0"+
|
||||
"\207\44\23\0\12\47\7\0\32\44\6\0\32\44\13\0\131\44\3\0"+
|
||||
"\6\44\2\0\6\44\2\0\6\44\2\0\3\44\43\0";
|
||||
"\10\0\2\53\1\13\1\0\1\53\1\63\22\0\1\46\1\57\1\0"+
|
||||
"\1\61\1\15\1\0\1\52\1\62\1\4\1\5\1\17\1\20\1\51"+
|
||||
"\1\43\1\3\1\0\1\2\7\42\2\1\1\54\1\0\1\60\1\56"+
|
||||
"\1\55\1\16\1\0\1\24\1\24\1\30\1\27\1\37\1\35\1\25"+
|
||||
"\1\44\1\32\6\45\1\34\1\36\1\45\1\26\3\45\1\26\1\26"+
|
||||
"\1\45\1\25\1\10\1\12\1\11\1\14\1\47\1\0\1\23\1\24"+
|
||||
"\1\31\1\27\1\23\1\23\1\45\1\44\1\32\4\45\1\22\1\45"+
|
||||
"\1\33\1\45\1\22\1\26\1\22\1\41\1\45\1\26\1\40\1\45"+
|
||||
"\1\25\1\6\1\21\1\7\54\0\1\45\12\0\1\45\4\0\1\45"+
|
||||
"\5\0\27\45\1\0\37\45\1\0\u013f\45\31\0\162\45\4\0\14\45"+
|
||||
"\16\0\5\45\11\0\1\45\213\0\1\45\13\0\1\45\1\0\3\45"+
|
||||
"\1\0\1\45\1\0\24\45\1\0\54\45\1\0\46\45\1\0\5\45"+
|
||||
"\4\0\202\45\10\0\105\45\1\0\46\45\2\0\2\45\6\0\20\45"+
|
||||
"\41\0\46\45\2\0\1\45\7\0\47\45\110\0\33\45\5\0\3\45"+
|
||||
"\56\0\32\45\5\0\13\45\25\0\12\50\4\0\2\45\1\0\143\45"+
|
||||
"\1\0\1\45\17\0\2\45\7\0\2\45\12\50\3\45\2\0\1\45"+
|
||||
"\20\0\1\45\1\0\36\45\35\0\3\45\60\0\46\45\13\0\1\45"+
|
||||
"\u0152\0\66\45\3\0\1\45\22\0\1\45\7\0\12\45\4\0\12\50"+
|
||||
"\25\0\10\45\2\0\2\45\2\0\26\45\1\0\7\45\1\0\1\45"+
|
||||
"\3\0\4\45\3\0\1\45\36\0\2\45\1\0\3\45\4\0\12\50"+
|
||||
"\2\45\23\0\6\45\4\0\2\45\2\0\26\45\1\0\7\45\1\0"+
|
||||
"\2\45\1\0\2\45\1\0\2\45\37\0\4\45\1\0\1\45\7\0"+
|
||||
"\12\50\2\0\3\45\20\0\11\45\1\0\3\45\1\0\26\45\1\0"+
|
||||
"\7\45\1\0\2\45\1\0\5\45\3\0\1\45\22\0\1\45\17\0"+
|
||||
"\2\45\4\0\12\50\25\0\10\45\2\0\2\45\2\0\26\45\1\0"+
|
||||
"\7\45\1\0\2\45\1\0\5\45\3\0\1\45\36\0\2\45\1\0"+
|
||||
"\3\45\4\0\12\50\1\0\1\45\21\0\1\45\1\0\6\45\3\0"+
|
||||
"\3\45\1\0\4\45\3\0\2\45\1\0\1\45\1\0\2\45\3\0"+
|
||||
"\2\45\3\0\3\45\3\0\10\45\1\0\3\45\55\0\11\50\25\0"+
|
||||
"\10\45\1\0\3\45\1\0\27\45\1\0\12\45\1\0\5\45\46\0"+
|
||||
"\2\45\4\0\12\50\25\0\10\45\1\0\3\45\1\0\27\45\1\0"+
|
||||
"\12\45\1\0\5\45\3\0\1\45\40\0\1\45\1\0\2\45\4\0"+
|
||||
"\12\50\25\0\10\45\1\0\3\45\1\0\27\45\1\0\20\45\46\0"+
|
||||
"\2\45\4\0\12\50\25\0\22\45\3\0\30\45\1\0\11\45\1\0"+
|
||||
"\1\45\2\0\7\45\72\0\60\45\1\0\2\45\14\0\7\45\11\0"+
|
||||
"\12\50\47\0\2\45\1\0\1\45\2\0\2\45\1\0\1\45\2\0"+
|
||||
"\1\45\6\0\4\45\1\0\7\45\1\0\3\45\1\0\1\45\1\0"+
|
||||
"\1\45\2\0\2\45\1\0\4\45\1\0\2\45\11\0\1\45\2\0"+
|
||||
"\5\45\1\0\1\45\11\0\12\50\2\0\2\45\42\0\1\45\37\0"+
|
||||
"\12\50\26\0\10\45\1\0\42\45\35\0\4\45\164\0\42\45\1\0"+
|
||||
"\5\45\1\0\2\45\25\0\12\50\6\0\6\45\112\0\46\45\12\0"+
|
||||
"\51\45\7\0\132\45\5\0\104\45\5\0\122\45\6\0\7\45\1\0"+
|
||||
"\77\45\1\0\1\45\1\0\4\45\2\0\7\45\1\0\1\45\1\0"+
|
||||
"\4\45\2\0\47\45\1\0\1\45\1\0\4\45\2\0\37\45\1\0"+
|
||||
"\1\45\1\0\4\45\2\0\7\45\1\0\1\45\1\0\4\45\2\0"+
|
||||
"\7\45\1\0\7\45\1\0\27\45\1\0\37\45\1\0\1\45\1\0"+
|
||||
"\4\45\2\0\7\45\1\0\47\45\1\0\23\45\16\0\11\50\56\0"+
|
||||
"\125\45\14\0\u026c\45\2\0\10\45\12\0\32\45\5\0\113\45\25\0"+
|
||||
"\15\45\1\0\4\45\16\0\22\45\16\0\22\45\16\0\15\45\1\0"+
|
||||
"\3\45\17\0\64\45\43\0\1\45\4\0\1\45\3\0\12\50\46\0"+
|
||||
"\12\50\6\0\130\45\10\0\51\45\127\0\35\45\51\0\12\50\36\45"+
|
||||
"\2\0\5\45\u038b\0\154\45\224\0\234\45\4\0\132\45\6\0\26\45"+
|
||||
"\2\0\6\45\2\0\46\45\2\0\6\45\2\0\10\45\1\0\1\45"+
|
||||
"\1\0\1\45\1\0\1\45\1\0\37\45\2\0\65\45\1\0\7\45"+
|
||||
"\1\0\1\45\3\0\3\45\1\0\7\45\3\0\4\45\2\0\6\45"+
|
||||
"\4\0\15\45\5\0\3\45\1\0\7\45\164\0\1\45\15\0\1\45"+
|
||||
"\202\0\1\45\4\0\1\45\2\0\12\45\1\0\1\45\3\0\5\45"+
|
||||
"\6\0\1\45\1\0\1\45\1\0\1\45\1\0\4\45\1\0\3\45"+
|
||||
"\1\0\7\45\3\0\3\45\5\0\5\45\u0ebb\0\2\45\52\0\5\45"+
|
||||
"\5\0\2\45\4\0\126\45\6\0\3\45\1\0\132\45\1\0\4\45"+
|
||||
"\5\0\50\45\4\0\136\45\21\0\30\45\70\0\20\45\u0200\0\u19b6\45"+
|
||||
"\112\0\u51a6\45\132\0\u048d\45\u0773\0\u2ba4\45\u215c\0\u012e\45\2\0\73\45"+
|
||||
"\225\0\7\45\14\0\5\45\5\0\1\45\1\0\12\45\1\0\15\45"+
|
||||
"\1\0\5\45\1\0\1\45\1\0\2\45\1\0\2\45\1\0\154\45"+
|
||||
"\41\0\u016b\45\22\0\100\45\2\0\66\45\50\0\14\45\164\0\5\45"+
|
||||
"\1\0\207\45\23\0\12\50\7\0\32\45\6\0\32\45\13\0\131\45"+
|
||||
"\3\0\6\45\2\0\6\45\2\0\6\45\2\0\3\45\43\0";
|
||||
|
||||
/**
|
||||
* Translates characters to character classes
|
||||
@@ -140,13 +139,14 @@ class _RegExLexer implements FlexLexer {
|
||||
"\1\1\1\43\1\44\1\2\1\45\1\46\1\47\1\50"+
|
||||
"\1\0\1\51\1\52\1\53\1\54\1\55\1\56\1\57"+
|
||||
"\1\60\2\61\1\62\1\11\1\63\1\64\1\65\1\52"+
|
||||
"\1\66\1\67\1\70\1\71\1\72\1\0\1\73\1\74"+
|
||||
"\1\75\1\76\1\0\1\77\1\100\1\101\1\102\2\64"+
|
||||
"\2\65\1\52\1\103\1\104\1\105\1\106\1\0\1\101"+
|
||||
"\1\64\1\107\2\65\1\110\1\111\1\101\3\65\1\112";
|
||||
"\1\66\1\67\1\70\1\71\1\72\1\73\1\0\1\74"+
|
||||
"\1\75\1\76\1\77\1\0\1\100\1\101\1\102\1\103"+
|
||||
"\2\64\2\65\1\52\1\104\1\105\1\106\1\107\1\0"+
|
||||
"\1\102\1\64\1\110\2\65\1\111\1\112\1\102\3\65"+
|
||||
"\1\113";
|
||||
|
||||
private static int [] zzUnpackAction() {
|
||||
int [] result = new int[111];
|
||||
int [] result = new int[112];
|
||||
int offset = 0;
|
||||
offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result);
|
||||
return result;
|
||||
@@ -171,23 +171,23 @@ class _RegExLexer implements FlexLexer {
|
||||
private static final int [] ZZ_ROWMAP = zzUnpackRowMap();
|
||||
|
||||
private static final String ZZ_ROWMAP_PACKED_0 =
|
||||
"\0\0\0\63\0\146\0\231\0\314\0\377\0\u0132\0\u0165"+
|
||||
"\0\u0198\0\u01cb\0\u01fe\0\u0231\0\u0264\0\u0297\0\u0297\0\u02ca"+
|
||||
"\0\u0297\0\u0297\0\u02fd\0\u0330\0\u0297\0\u0297\0\u0297\0\u0297"+
|
||||
"\0\u0297\0\u0297\0\u0297\0\u0297\0\u0297\0\u0297\0\u0363\0\u0297"+
|
||||
"\0\u0396\0\u0297\0\u03c9\0\u0297\0\u0297\0\u0297\0\u0297\0\u03fc"+
|
||||
"\0\u0297\0\u042f\0\u0297\0\u0462\0\u0297\0\u0297\0\u02fd\0\u0297"+
|
||||
"\0\u0297\0\u0495\0\u04c8\0\u0297\0\u0297\0\u0297\0\u0297\0\u04fb"+
|
||||
"\0\u0297\0\u052e\0\u0297\0\u0561\0\u0594\0\u0297\0\u0297\0\u0297"+
|
||||
"\0\u0297\0\u0297\0\u0297\0\u05c7\0\u0297\0\u0297\0\u0297\0\u05fa"+
|
||||
"\0\u062d\0\u0660\0\u0297\0\u0297\0\u0297\0\u0297\0\u0297\0\u0693"+
|
||||
"\0\u0297\0\u0297\0\u0297\0\u06c6\0\u06f9\0\u0297\0\u0297\0\u072c"+
|
||||
"\0\u0297\0\u075f\0\u0792\0\u07c5\0\u07f8\0\u082b\0\u0297\0\u0297"+
|
||||
"\0\u0297\0\u0297\0\u085e\0\u0891\0\u0297\0\u0297\0\u08c4\0\u08f7"+
|
||||
"\0\u0561\0\u0297\0\u0297\0\u092a\0\u095d\0\u0297\0\u0297";
|
||||
"\0\0\0\64\0\150\0\234\0\320\0\u0104\0\u0138\0\u016c"+
|
||||
"\0\u01a0\0\u01d4\0\u0208\0\u023c\0\u0270\0\u02a4\0\u02a4\0\u02d8"+
|
||||
"\0\u02a4\0\u02a4\0\u030c\0\u0340\0\u02a4\0\u02a4\0\u02a4\0\u02a4"+
|
||||
"\0\u02a4\0\u02a4\0\u02a4\0\u02a4\0\u02a4\0\u02a4\0\u0374\0\u02a4"+
|
||||
"\0\u03a8\0\u02a4\0\u03dc\0\u02a4\0\u02a4\0\u02a4\0\u02a4\0\u0410"+
|
||||
"\0\u02a4\0\u0444\0\u02a4\0\u0478\0\u02a4\0\u02a4\0\u030c\0\u02a4"+
|
||||
"\0\u02a4\0\u04ac\0\u04e0\0\u02a4\0\u02a4\0\u02a4\0\u02a4\0\u0514"+
|
||||
"\0\u02a4\0\u0548\0\u02a4\0\u057c\0\u05b0\0\u02a4\0\u02a4\0\u02a4"+
|
||||
"\0\u02a4\0\u02a4\0\u02a4\0\u05e4\0\u02a4\0\u02a4\0\u02a4\0\u0618"+
|
||||
"\0\u064c\0\u0680\0\u02a4\0\u02a4\0\u02a4\0\u02a4\0\u02a4\0\u02a4"+
|
||||
"\0\u06b4\0\u02a4\0\u02a4\0\u02a4\0\u06e8\0\u071c\0\u02a4\0\u02a4"+
|
||||
"\0\u0750\0\u02a4\0\u0784\0\u07b8\0\u07ec\0\u0820\0\u0854\0\u02a4"+
|
||||
"\0\u02a4\0\u02a4\0\u02a4\0\u0888\0\u08bc\0\u02a4\0\u02a4\0\u08f0"+
|
||||
"\0\u0924\0\u057c\0\u02a4\0\u02a4\0\u0958\0\u098c\0\u02a4\0\u02a4";
|
||||
|
||||
private static int [] zzUnpackRowMap() {
|
||||
int [] result = new int[111];
|
||||
int [] result = new int[112];
|
||||
int offset = 0;
|
||||
offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result);
|
||||
return result;
|
||||
@@ -212,51 +212,51 @@ class _RegExLexer implements FlexLexer {
|
||||
private static final String ZZ_TRANS_PACKED_0 =
|
||||
"\3\16\1\17\1\20\1\21\1\22\1\16\1\23\1\16"+
|
||||
"\1\24\1\25\1\26\1\27\1\30\1\31\1\32\1\33"+
|
||||
"\21\16\1\34\1\16\1\35\4\16\1\25\5\16\1\36"+
|
||||
"\1\16\1\25\12\16\1\37\50\16\1\40\2\41\4\40"+
|
||||
"\1\42\12\40\20\43\1\41\1\40\1\43\2\40\1\41"+
|
||||
"\1\44\12\40\11\45\1\46\1\45\1\0\62\45\1\0"+
|
||||
"\1\47\46\45\6\16\1\22\1\16\1\50\1\51\1\52"+
|
||||
"\1\53\1\26\26\16\1\34\5\16\1\54\1\53\7\16"+
|
||||
"\1\53\6\55\1\56\1\55\1\57\1\55\1\24\50\55"+
|
||||
"\5\60\1\61\14\60\20\62\1\60\1\63\1\62\6\60"+
|
||||
"\1\64\7\60\13\11\1\65\46\11\1\65\22\60\20\43"+
|
||||
"\2\60\1\43\7\60\1\66\30\60\20\43\2\60\1\43"+
|
||||
"\14\60\1\67\6\60\1\61\14\60\20\43\2\60\1\43"+
|
||||
"\21\16\1\34\2\16\1\35\4\16\1\25\5\16\1\36"+
|
||||
"\1\16\1\25\12\16\1\37\51\16\1\40\2\41\4\40"+
|
||||
"\1\42\12\40\20\43\1\41\1\40\2\43\2\40\1\41"+
|
||||
"\1\44\12\40\11\45\1\46\1\45\1\0\63\45\1\0"+
|
||||
"\1\47\47\45\6\16\1\22\1\16\1\50\1\51\1\52"+
|
||||
"\1\53\1\26\26\16\1\34\6\16\1\54\1\53\7\16"+
|
||||
"\1\53\6\55\1\56\1\55\1\57\1\55\1\24\51\55"+
|
||||
"\5\60\1\61\14\60\20\62\1\60\1\63\2\62\6\60"+
|
||||
"\1\64\7\60\13\11\1\65\47\11\1\65\22\60\20\43"+
|
||||
"\2\60\2\43\7\60\1\66\30\60\20\43\2\60\2\43"+
|
||||
"\14\60\1\67\6\60\1\61\14\60\20\43\2\60\2\43"+
|
||||
"\17\60\2\41\2\60\1\61\14\60\20\43\1\41\1\60"+
|
||||
"\1\43\2\60\1\41\13\60\101\0\1\70\55\0\1\71"+
|
||||
"\2\0\1\72\46\0\1\73\1\74\1\75\4\76\1\73"+
|
||||
"\2\43\2\60\1\41\13\60\102\0\1\70\56\0\1\71"+
|
||||
"\2\0\1\72\47\0\1\73\1\74\1\75\4\76\1\73"+
|
||||
"\1\76\1\73\1\76\1\77\6\76\2\100\2\101\2\102"+
|
||||
"\1\103\1\104\1\103\2\105\1\106\1\107\1\106\1\110"+
|
||||
"\1\111\1\112\1\76\1\106\1\77\4\73\1\77\7\73"+
|
||||
"\1\77\37\0\1\113\24\0\2\41\37\0\1\41\4\0"+
|
||||
"\1\41\14\0\2\43\17\0\21\43\1\0\1\43\1\0"+
|
||||
"\2\43\24\0\1\114\2\0\1\72\46\0\1\73\1\74"+
|
||||
"\1\75\4\76\1\73\1\76\1\115\1\76\1\77\6\76"+
|
||||
"\2\100\2\101\2\102\1\103\1\104\1\103\2\105\1\106"+
|
||||
"\1\107\1\106\1\110\1\111\1\112\1\76\1\106\1\77"+
|
||||
"\4\73\1\77\7\73\1\77\51\0\1\116\33\0\20\62"+
|
||||
"\2\0\1\62\40\0\20\63\2\0\1\63\22\0\1\117"+
|
||||
"\27\0\1\120\16\0\2\121\1\122\1\123\1\124\1\125"+
|
||||
"\1\126\12\0\1\127\52\0\2\74\37\0\1\74\22\0"+
|
||||
"\1\130\37\0\1\130\20\0\63\131\1\132\2\133\20\132"+
|
||||
"\2\133\2\132\3\133\3\132\1\133\1\132\1\133\2\132"+
|
||||
"\1\133\20\132\1\134\2\135\20\134\2\135\2\134\3\135"+
|
||||
"\3\134\1\135\1\134\1\135\2\134\1\135\20\134\1\0"+
|
||||
"\1\74\1\136\37\0\1\136\75\0\1\137\1\0\1\140"+
|
||||
"\60\0\1\141\1\142\4\0\5\143\1\0\55\143\2\0"+
|
||||
"\1\144\37\0\1\144\20\0\64\145\2\146\20\145\2\146"+
|
||||
"\2\145\3\146\3\145\1\146\1\145\1\146\2\145\1\146"+
|
||||
"\20\145\64\147\2\150\20\147\2\150\2\147\3\150\3\147"+
|
||||
"\1\150\1\147\1\150\2\147\1\150\20\147\1\0\1\74"+
|
||||
"\1\151\37\0\1\151\20\0\5\143\1\152\55\143\2\0"+
|
||||
"\1\153\37\0\1\153\20\0\64\154\2\155\20\154\2\155"+
|
||||
"\2\154\3\155\3\154\1\155\1\154\1\155\2\154\1\155"+
|
||||
"\20\154\64\156\2\157\20\156\2\157\2\156\3\157\3\156"+
|
||||
"\1\157\1\156\1\157\2\156\1\157\20\156";
|
||||
"\1\111\1\112\1\76\1\113\1\106\1\77\4\73\1\77"+
|
||||
"\7\73\1\77\37\0\1\114\25\0\2\41\37\0\1\41"+
|
||||
"\5\0\1\41\14\0\2\43\17\0\21\43\1\0\2\43"+
|
||||
"\1\0\2\43\24\0\1\115\2\0\1\72\47\0\1\73"+
|
||||
"\1\74\1\75\4\76\1\73\1\76\1\116\1\76\1\77"+
|
||||
"\6\76\2\100\2\101\2\102\1\103\1\104\1\103\2\105"+
|
||||
"\1\106\1\107\1\106\1\110\1\111\1\112\1\76\1\113"+
|
||||
"\1\106\1\77\4\73\1\77\7\73\1\77\52\0\1\117"+
|
||||
"\33\0\20\62\2\0\2\62\40\0\20\63\2\0\2\63"+
|
||||
"\22\0\1\120\27\0\1\121\17\0\2\122\1\123\1\124"+
|
||||
"\1\125\1\126\1\127\12\0\1\130\53\0\2\74\37\0"+
|
||||
"\1\74\23\0\1\131\37\0\1\131\21\0\64\132\1\133"+
|
||||
"\2\134\20\133\2\134\2\133\3\134\3\133\1\134\1\133"+
|
||||
"\1\134\2\133\1\134\21\133\1\135\2\136\20\135\2\136"+
|
||||
"\2\135\3\136\3\135\1\136\1\135\1\136\2\135\1\136"+
|
||||
"\21\135\1\0\1\74\1\137\37\0\1\137\77\0\1\140"+
|
||||
"\1\0\1\141\61\0\1\142\1\143\4\0\5\144\1\0"+
|
||||
"\56\144\2\0\1\145\37\0\1\145\21\0\65\146\2\147"+
|
||||
"\20\146\2\147\2\146\3\147\3\146\1\147\1\146\1\147"+
|
||||
"\2\146\1\147\21\146\65\150\2\151\20\150\2\151\2\150"+
|
||||
"\3\151\3\150\1\151\1\150\1\151\2\150\1\151\21\150"+
|
||||
"\1\0\1\74\1\152\37\0\1\152\21\0\5\144\1\153"+
|
||||
"\56\144\2\0\1\154\37\0\1\154\21\0\65\155\2\156"+
|
||||
"\20\155\2\156\2\155\3\156\3\155\1\156\1\155\1\156"+
|
||||
"\2\155\1\156\21\155\65\157\2\160\20\157\2\160\2\157"+
|
||||
"\3\160\3\157\1\160\1\157\1\160\2\157\1\160\21\157";
|
||||
|
||||
private static int [] zzUnpackTrans() {
|
||||
int [] result = new int[2448];
|
||||
int [] result = new int[2496];
|
||||
int offset = 0;
|
||||
offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result);
|
||||
return result;
|
||||
@@ -301,12 +301,12 @@ class _RegExLexer implements FlexLexer {
|
||||
"\1\1\1\11\1\1\1\11\1\1\4\11\1\1\1\11"+
|
||||
"\1\1\1\11\1\1\2\11\1\1\2\11\2\1\4\11"+
|
||||
"\1\1\1\11\1\0\1\11\2\1\6\11\1\1\3\11"+
|
||||
"\3\1\5\11\1\0\3\11\1\1\1\0\2\11\1\1"+
|
||||
"\3\1\6\11\1\0\3\11\1\1\1\0\2\11\1\1"+
|
||||
"\1\11\5\1\4\11\1\0\1\1\2\11\3\1\2\11"+
|
||||
"\2\1\2\11";
|
||||
|
||||
private static int [] zzUnpackAttribute() {
|
||||
int [] result = new int[111];
|
||||
int [] result = new int[112];
|
||||
int offset = 0;
|
||||
offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result);
|
||||
return result;
|
||||
@@ -376,6 +376,7 @@ class _RegExLexer implements FlexLexer {
|
||||
private boolean allowDanglingMetacharacters;
|
||||
private boolean allowNestedCharacterClasses;
|
||||
private boolean allowOctalNoLeadingZero;
|
||||
private boolean allowHexDigitClass;
|
||||
|
||||
_RegExLexer(EnumSet<RegExpCapability> capabilities) {
|
||||
this((java.io.Reader)null);
|
||||
@@ -384,6 +385,7 @@ class _RegExLexer implements FlexLexer {
|
||||
this.allowNestedCharacterClasses = capabilities.contains(RegExpCapability.NESTED_CHARACTER_CLASSES);
|
||||
this.allowOctalNoLeadingZero = capabilities.contains(RegExpCapability.OCTAL_NO_LEADING_ZERO);
|
||||
this.commentMode = capabilities.contains(RegExpCapability.COMMENT_MODE);
|
||||
this.allowHexDigitClass = capabilities.contains(RegExpCapability.ALLOW_HEX_DIGIT_CLASS);
|
||||
}
|
||||
|
||||
private void yypushstate(int state) {
|
||||
@@ -431,7 +433,7 @@ class _RegExLexer implements FlexLexer {
|
||||
char [] map = new char[0x10000];
|
||||
int i = 0; /* index in packed string */
|
||||
int j = 0; /* index in unpacked array */
|
||||
while (i < 1336) {
|
||||
while (i < 1338) {
|
||||
int count = packed.charAt(i++);
|
||||
char value = packed.charAt(i++);
|
||||
do map[j++] = value; while (--count > 0);
|
||||
@@ -612,7 +614,7 @@ class _RegExLexer implements FlexLexer {
|
||||
while (true) {
|
||||
|
||||
if (zzCurrentPosL < zzEndReadL)
|
||||
zzInput = zzBufferArrayL != null ? zzBufferArrayL[zzCurrentPosL++]:zzBufferL.charAt(zzCurrentPosL++);
|
||||
zzInput = (zzBufferArrayL != null ? zzBufferArrayL[zzCurrentPosL++] : zzBufferL.charAt(zzCurrentPosL++));
|
||||
else if (zzAtEOF) {
|
||||
zzInput = YYEOF;
|
||||
break zzForAction;
|
||||
@@ -632,7 +634,7 @@ class _RegExLexer implements FlexLexer {
|
||||
break zzForAction;
|
||||
}
|
||||
else {
|
||||
zzInput = zzBufferArrayL != null ? zzBufferArrayL[zzCurrentPosL++]:zzBufferL.charAt(zzCurrentPosL++);
|
||||
zzInput = (zzBufferArrayL != null ? zzBufferArrayL[zzCurrentPosL++] : zzBufferL.charAt(zzCurrentPosL++));
|
||||
}
|
||||
}
|
||||
int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ];
|
||||
@@ -653,34 +655,34 @@ class _RegExLexer implements FlexLexer {
|
||||
zzMarkedPos = zzMarkedPosL;
|
||||
|
||||
switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) {
|
||||
case 74:
|
||||
case 75:
|
||||
{ return RegExpTT.UNICODE_CHAR;
|
||||
}
|
||||
case 75: break;
|
||||
case 76: break;
|
||||
case 7:
|
||||
{ if (yystate() != CLASS2) yypushstate(EMBRACED); return RegExpTT.LBRACE;
|
||||
}
|
||||
case 76: break;
|
||||
case 77: break;
|
||||
case 24:
|
||||
{ return RegExpTT.COMMA;
|
||||
}
|
||||
case 77: break;
|
||||
case 60:
|
||||
case 78: break;
|
||||
case 61:
|
||||
{ return RegExpTT.POS_LOOKAHEAD;
|
||||
}
|
||||
case 78: break;
|
||||
case 73:
|
||||
case 79: break;
|
||||
case 74:
|
||||
{ return RegExpTT.COMMENT;
|
||||
}
|
||||
case 79: break;
|
||||
case 68:
|
||||
case 80: break;
|
||||
case 69:
|
||||
{ yybegin(NAMED_GROUP); return RegExpTT.PYTHON_NAMED_GROUP;
|
||||
}
|
||||
case 80: break;
|
||||
case 81: break;
|
||||
case 14:
|
||||
{ return RegExpTT.STAR;
|
||||
}
|
||||
case 81: break;
|
||||
case 82: break;
|
||||
case 28:
|
||||
{ if (allowNestedCharacterClasses) {
|
||||
yypushstate(CLASS2);
|
||||
@@ -688,159 +690,159 @@ class _RegExLexer implements FlexLexer {
|
||||
}
|
||||
return RegExpTT.CHARACTER;
|
||||
}
|
||||
case 82: break;
|
||||
case 58:
|
||||
case 83: break;
|
||||
case 59:
|
||||
{ yybegin(PY_COND_REF); return RegExpTT.PYTHON_COND_REF;
|
||||
}
|
||||
case 83: break;
|
||||
case 84: break;
|
||||
case 48:
|
||||
{ return RegExpTT.CHAR_CLASS;
|
||||
}
|
||||
case 84: break;
|
||||
case 85: break;
|
||||
case 35:
|
||||
{ handleOptions(); return RegExpTT.OPTIONS_OFF;
|
||||
}
|
||||
case 85: break;
|
||||
case 86: break;
|
||||
case 40:
|
||||
// lookahead expression with fixed base length
|
||||
zzMarkedPos = zzStartRead + 1;
|
||||
{ yypushstate(CLASS1);
|
||||
return RegExpTT.CLASS_BEGIN;
|
||||
}
|
||||
case 86: break;
|
||||
case 54:
|
||||
case 87: break;
|
||||
case 55:
|
||||
{ yypopstate(); return RegExpTT.QUOTE_END;
|
||||
}
|
||||
case 87: break;
|
||||
case 88: break;
|
||||
case 34:
|
||||
{ yybegin(YYINITIAL); return RegExpTT.GROUP_END;
|
||||
}
|
||||
case 88: break;
|
||||
case 89: break;
|
||||
case 5:
|
||||
{ return RegExpTT.GROUP_BEGIN;
|
||||
}
|
||||
case 89: break;
|
||||
case 90: break;
|
||||
case 36:
|
||||
{ yybegin(YYINITIAL); return RegExpTT.COLON;
|
||||
}
|
||||
case 90: break;
|
||||
case 91: break;
|
||||
case 6:
|
||||
{ return RegExpTT.GROUP_END;
|
||||
}
|
||||
case 91: break;
|
||||
case 92: break;
|
||||
case 25:
|
||||
{ assert false : yytext();
|
||||
}
|
||||
case 92: break;
|
||||
case 93: break;
|
||||
case 18:
|
||||
{ return commentMode ? com.intellij.psi.TokenType.WHITE_SPACE : RegExpTT.CHARACTER;
|
||||
}
|
||||
case 93: break;
|
||||
case 94: break;
|
||||
case 45:
|
||||
{ return commentMode ? RegExpTT.CHARACTER : RegExpTT.REDUNDANT_ESCAPE;
|
||||
}
|
||||
case 94: break;
|
||||
case 95: break;
|
||||
case 23:
|
||||
{ return RegExpTT.NAME;
|
||||
}
|
||||
case 95: break;
|
||||
case 96: break;
|
||||
case 29:
|
||||
{ yypopstate(); return RegExpTT.CLASS_END;
|
||||
}
|
||||
case 96: break;
|
||||
case 97: break;
|
||||
case 33:
|
||||
{ yybegin(YYINITIAL); return RegExpTT.BAD_CHARACTER;
|
||||
}
|
||||
case 97: break;
|
||||
case 98: break;
|
||||
case 51:
|
||||
{ yypushstate(QUOTED); return RegExpTT.QUOTE_BEGIN;
|
||||
}
|
||||
case 98: break;
|
||||
case 99: break;
|
||||
case 21:
|
||||
{ return RegExpTT.NUMBER;
|
||||
}
|
||||
case 99: break;
|
||||
case 100: break;
|
||||
case 4:
|
||||
{ return RegExpTT.DOT;
|
||||
}
|
||||
case 100: break;
|
||||
case 70:
|
||||
case 101: break;
|
||||
case 71:
|
||||
{ return RegExpTT.NEG_LOOKBEHIND;
|
||||
}
|
||||
case 101: break;
|
||||
case 102: break;
|
||||
case 43:
|
||||
{ return (allowOctalNoLeadingZero ? RegExpTT.OCT_CHAR : RegExpTT.BAD_OCT_VALUE);
|
||||
}
|
||||
case 102: break;
|
||||
case 61:
|
||||
case 103: break;
|
||||
case 62:
|
||||
{ return RegExpTT.NEG_LOOKAHEAD;
|
||||
}
|
||||
case 103: break;
|
||||
case 104: break;
|
||||
case 10:
|
||||
{ return commentMode ? com.intellij.psi.TokenType.WHITE_SPACE : RegExpTT.CTRL_CHARACTER;
|
||||
}
|
||||
case 104: break;
|
||||
case 59:
|
||||
case 105: break;
|
||||
case 60:
|
||||
{ return RegExpTT.NON_CAPT_GROUP;
|
||||
}
|
||||
case 105: break;
|
||||
case 63:
|
||||
case 106: break;
|
||||
case 64:
|
||||
{ yybegin(QUOTED_NAMED_GROUP); return RegExpTT.RUBY_QUOTED_NAMED_GROUP;
|
||||
}
|
||||
case 106: break;
|
||||
case 107: break;
|
||||
case 19:
|
||||
{ if (commentMode) { yypushstate(COMMENT); return RegExpTT.COMMENT; } else return RegExpTT.CHARACTER;
|
||||
}
|
||||
case 107: break;
|
||||
case 108: break;
|
||||
case 50:
|
||||
{ yypushstate(PROP); return RegExpTT.PROPERTY;
|
||||
}
|
||||
case 108: break;
|
||||
case 69:
|
||||
case 109: break;
|
||||
case 70:
|
||||
{ return RegExpTT.POS_LOOKBEHIND;
|
||||
}
|
||||
case 109: break;
|
||||
case 110: break;
|
||||
case 42:
|
||||
{ return yystate() != CLASS2 ? RegExpTT.BACKREF : RegExpTT.ESC_CHARACTER;
|
||||
}
|
||||
case 110: break;
|
||||
case 71:
|
||||
case 111: break;
|
||||
case 72:
|
||||
{ return RegExpTT.HEX_CHAR;
|
||||
}
|
||||
case 111: break;
|
||||
case 112: break;
|
||||
case 1:
|
||||
{ handleOptions(); return RegExpTT.OPTIONS_ON;
|
||||
}
|
||||
case 112: break;
|
||||
case 57:
|
||||
case 113: break;
|
||||
case 58:
|
||||
{ return allowNestedCharacterClasses ? RegExpTT.ANDAND : RegExpTT.CHARACTER;
|
||||
}
|
||||
case 113: break;
|
||||
case 114: break;
|
||||
case 2:
|
||||
{ yypopstate(); return RegExpTT.COMMENT;
|
||||
}
|
||||
case 114: break;
|
||||
case 115: break;
|
||||
case 17:
|
||||
{ return RegExpTT.MINUS;
|
||||
}
|
||||
case 115: break;
|
||||
case 116: break;
|
||||
case 46:
|
||||
{ return RegExpTT.ESC_CTRL_CHARACTER;
|
||||
}
|
||||
case 116: break;
|
||||
case 117: break;
|
||||
case 32:
|
||||
{ yypopstate(); yypushstate(EMBRACED); return RegExpTT.LBRACE;
|
||||
}
|
||||
case 117: break;
|
||||
case 56:
|
||||
case 118: break;
|
||||
case 57:
|
||||
{ if (!allowNestedCharacterClasses) return RegExpTT.CHARACTER;
|
||||
return RegExpTT.REDUNDANT_ESCAPE;
|
||||
}
|
||||
case 118: break;
|
||||
case 119: break;
|
||||
case 13:
|
||||
{ return RegExpTT.QUEST;
|
||||
}
|
||||
case 119: break;
|
||||
case 120: break;
|
||||
case 20:
|
||||
{ if (allowDanglingMetacharacters) {
|
||||
yypopstate(); yypushback(1);
|
||||
@@ -848,114 +850,118 @@ class _RegExLexer implements FlexLexer {
|
||||
return RegExpTT.BAD_CHARACTER;
|
||||
}
|
||||
}
|
||||
case 120: break;
|
||||
case 121: break;
|
||||
case 54:
|
||||
{ return (allowHexDigitClass ? RegExpTT.CHAR_CLASS : StringEscapesTokenTypes.INVALID_CHARACTER_ESCAPE_TOKEN);
|
||||
}
|
||||
case 122: break;
|
||||
case 15:
|
||||
{ return RegExpTT.PLUS;
|
||||
}
|
||||
case 121: break;
|
||||
case 65:
|
||||
case 123: break;
|
||||
case 66:
|
||||
{ return RegExpTT.OCT_CHAR;
|
||||
}
|
||||
case 122: break;
|
||||
case 72:
|
||||
case 124: break;
|
||||
case 73:
|
||||
{ if (allowOctalNoLeadingZero) return RegExpTT.OCT_CHAR;
|
||||
return yystate() != CLASS2 ? RegExpTT.BACKREF : RegExpTT.ESC_CHARACTER;
|
||||
}
|
||||
case 123: break;
|
||||
case 125: break;
|
||||
case 38:
|
||||
{ yybegin(YYINITIAL); return RegExpTT.QUOTE;
|
||||
}
|
||||
case 124: break;
|
||||
case 126: break;
|
||||
case 31:
|
||||
{ yypopstate(); yypushback(1);
|
||||
}
|
||||
case 125: break;
|
||||
case 127: break;
|
||||
case 27:
|
||||
{ yybegin(CLASS1); return RegExpTT.CARET;
|
||||
}
|
||||
case 126: break;
|
||||
case 128: break;
|
||||
case 37:
|
||||
{ yybegin(YYINITIAL); return RegExpTT.GT;
|
||||
}
|
||||
case 127: break;
|
||||
case 67:
|
||||
case 129: break;
|
||||
case 68:
|
||||
{ yybegin(PY_NAMED_GROUP_REF); return RegExpTT.PYTHON_NAMED_GROUP_REF;
|
||||
}
|
||||
case 128: break;
|
||||
case 130: break;
|
||||
case 16:
|
||||
{ return RegExpTT.UNION;
|
||||
}
|
||||
case 129: break;
|
||||
case 131: break;
|
||||
case 3:
|
||||
{ return RegExpTT.CHARACTER;
|
||||
}
|
||||
case 130: break;
|
||||
case 62:
|
||||
case 132: break;
|
||||
case 63:
|
||||
{ yybegin(NAMED_GROUP); return RegExpTT.RUBY_NAMED_GROUP;
|
||||
}
|
||||
case 131: break;
|
||||
case 133: break;
|
||||
case 39:
|
||||
{ yybegin(OPTIONS); return RegExpTT.SET_OPTIONS;
|
||||
}
|
||||
case 132: break;
|
||||
case 134: break;
|
||||
case 26:
|
||||
{ yybegin(CLASS2); return RegExpTT.CHARACTER;
|
||||
}
|
||||
case 133: break;
|
||||
case 66:
|
||||
case 135: break;
|
||||
case 67:
|
||||
{ if (xmlSchemaMode) { yypushback(1); return RegExpTT.CHAR_CLASS; } else return RegExpTT.CTRL;
|
||||
}
|
||||
case 134: break;
|
||||
case 136: break;
|
||||
case 30:
|
||||
{ return commentMode ? com.intellij.psi.TokenType.WHITE_SPACE : RegExpTT.ESC_CHARACTER;
|
||||
}
|
||||
case 135: break;
|
||||
case 137: break;
|
||||
case 12:
|
||||
{ return RegExpTT.DOLLAR;
|
||||
}
|
||||
case 136: break;
|
||||
case 138: break;
|
||||
case 49:
|
||||
{ if (xmlSchemaMode) return RegExpTT.CHAR_CLASS; else return StringEscapesTokenTypes.INVALID_CHARACTER_ESCAPE_TOKEN;
|
||||
}
|
||||
case 137: break;
|
||||
case 139: break;
|
||||
case 41:
|
||||
{ return RegExpTT.REDUNDANT_ESCAPE;
|
||||
}
|
||||
case 138: break;
|
||||
case 140: break;
|
||||
case 47:
|
||||
{ return yystate() != CLASS2 ? RegExpTT.BOUNDARY : RegExpTT.ESC_CHARACTER;
|
||||
}
|
||||
case 139: break;
|
||||
case 141: break;
|
||||
case 8:
|
||||
{ yypushstate(CLASS2);
|
||||
return RegExpTT.CLASS_BEGIN;
|
||||
}
|
||||
case 140: break;
|
||||
case 142: break;
|
||||
case 22:
|
||||
{ yypopstate(); return RegExpTT.RBRACE;
|
||||
}
|
||||
case 141: break;
|
||||
case 143: break;
|
||||
case 53:
|
||||
{ return StringEscapesTokenTypes.INVALID_UNICODE_ESCAPE_TOKEN;
|
||||
}
|
||||
case 142: break;
|
||||
case 144: break;
|
||||
case 52:
|
||||
{ return RegExpTT.BAD_HEX_VALUE;
|
||||
}
|
||||
case 143: break;
|
||||
case 145: break;
|
||||
case 9:
|
||||
{ return StringEscapesTokenTypes.INVALID_CHARACTER_ESCAPE_TOKEN;
|
||||
}
|
||||
case 144: break;
|
||||
case 146: break;
|
||||
case 11:
|
||||
{ return RegExpTT.CARET;
|
||||
}
|
||||
case 145: break;
|
||||
case 147: break;
|
||||
case 44:
|
||||
{ return RegExpTT.ESC_CHARACTER;
|
||||
}
|
||||
case 146: break;
|
||||
case 55:
|
||||
case 148: break;
|
||||
case 56:
|
||||
// lookahead expression with fixed base length
|
||||
zzMarkedPos = zzStartRead + 1;
|
||||
{ if (allowNestedCharacterClasses) {
|
||||
@@ -964,8 +970,8 @@ class _RegExLexer implements FlexLexer {
|
||||
}
|
||||
return RegExpTT.CHARACTER;
|
||||
}
|
||||
case 147: break;
|
||||
case 64:
|
||||
case 149: break;
|
||||
case 65:
|
||||
// lookahead expression with fixed base length
|
||||
zzMarkedPos = zzStartRead + 1;
|
||||
{ if (!allowNestedCharacterClasses) {
|
||||
@@ -976,7 +982,7 @@ class _RegExLexer implements FlexLexer {
|
||||
}
|
||||
return RegExpTT.CLASS_BEGIN;
|
||||
}
|
||||
case 148: break;
|
||||
case 150: break;
|
||||
default:
|
||||
if (zzInput == YYEOF && zzStartRead == zzCurrentPos) {
|
||||
zzAtEOF = true;
|
||||
|
||||
@@ -31,6 +31,7 @@ import com.intellij.psi.StringEscapesTokenTypes;
|
||||
private boolean allowDanglingMetacharacters;
|
||||
private boolean allowNestedCharacterClasses;
|
||||
private boolean allowOctalNoLeadingZero;
|
||||
private boolean allowHexDigitClass;
|
||||
|
||||
_RegExLexer(EnumSet<RegExpCapability> capabilities) {
|
||||
this((java.io.Reader)null);
|
||||
@@ -39,6 +40,7 @@ import com.intellij.psi.StringEscapesTokenTypes;
|
||||
this.allowNestedCharacterClasses = capabilities.contains(RegExpCapability.NESTED_CHARACTER_CLASSES);
|
||||
this.allowOctalNoLeadingZero = capabilities.contains(RegExpCapability.OCTAL_NO_LEADING_ZERO);
|
||||
this.commentMode = capabilities.contains(RegExpCapability.COMMENT_MODE);
|
||||
this.allowHexDigitClass = capabilities.contains(RegExpCapability.ALLOW_HEX_DIGIT_CLASS);
|
||||
}
|
||||
|
||||
private void yypushstate(int state) {
|
||||
@@ -155,6 +157,7 @@ HEX_CHAR=[0-9a-fA-F]
|
||||
{ESCAPE} {BOUNDARY} { return yystate() != CLASS2 ? RegExpTT.BOUNDARY : RegExpTT.ESC_CHARACTER; }
|
||||
{ESCAPE} {CONTROL} { return RegExpTT.ESC_CTRL_CHARACTER; }
|
||||
|
||||
{ESCAPE} [hH] { return (allowHexDigitClass ? RegExpTT.CHAR_CLASS : StringEscapesTokenTypes.INVALID_CHARACTER_ESCAPE_TOKEN); }
|
||||
{ESCAPE} [:letter:] { return StringEscapesTokenTypes.INVALID_CHARACTER_ESCAPE_TOKEN; }
|
||||
{ESCAPE} [\n\b\t\r\f ] { return commentMode ? RegExpTT.CHARACTER : RegExpTT.REDUNDANT_ESCAPE; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user