src/jdk/nashorn/internal/runtime/regexp/joni/Config.java

Fri, 08 Jun 2018 11:11:06 +0200

author
hannesw
date
Fri, 08 Jun 2018 11:11:06 +0200
changeset 2522
51635f054bcb
parent 1530
fd307cc5f58c
child 2530
c03ab69fec12
permissions
-rw-r--r--

8204290: Add check to limit number of capture groups
Reviewed-by: sundar, jlaskey

     1 /*
     2  * Permission is hereby granted, free of charge, to any person obtaining a copy of
     3  * this software and associated documentation files (the "Software"), to deal in
     4  * the Software without restriction, including without limitation the rights to
     5  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
     6  * of the Software, and to permit persons to whom the Software is furnished to do
     7  * so, subject to the following conditions:
     8  *
     9  * The above copyright notice and this permission notice shall be included in all
    10  * copies or substantial portions of the Software.
    11  *
    12  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    13  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    14  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    15  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    16  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    17  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
    18  * SOFTWARE.
    19  */
    20 package jdk.nashorn.internal.runtime.regexp.joni;
    22 import java.io.PrintStream;
    24 @SuppressWarnings("javadoc")
    25 public interface Config {
    26     final int CHAR_TABLE_SIZE = 256;
    28     /* from jcodings */
    29     final boolean VANILLA = false;
    30     final int INTERNAL_ENC_CASE_FOLD_MULTI_CHAR = (1<<30);
    31     final int ENC_CASE_FOLD_MIN = INTERNAL_ENC_CASE_FOLD_MULTI_CHAR;
    32     final int ENC_CASE_FOLD_DEFAULT = ENC_CASE_FOLD_MIN;
    34     final boolean USE_MONOMANIAC_CHECK_CAPTURES_IN_ENDLESS_REPEAT = true; /* /(?:()|())*\2/ */
    35     final boolean USE_NEWLINE_AT_END_OF_STRING_HAS_EMPTY_LINE = true;     /* /\n$/ =~ "\n" */
    36     final boolean USE_WARNING_REDUNDANT_NESTED_REPEAT_OPERATOR = false;
    38     final boolean CASE_FOLD_IS_APPLIED_INSIDE_NEGATIVE_CCLASS = true;
    40     final boolean USE_MATCH_RANGE_MUST_BE_INSIDE_OF_SPECIFIED_RANGE = false;
    41     final boolean USE_VARIABLE_META_CHARS = true;
    42     final boolean USE_WORD_BEGIN_END = true;                                /* "\<": word-begin, "\>": word-end */
    43     final boolean USE_POSIX_API_REGION_OPTION = false;                           /* needed for POSIX API support */
    44     final boolean USE_FIND_LONGEST_SEARCH_ALL_OF_RANGE = true;
    46     final int NREGION                   = 10;
    47     final int MAX_BACKREF_NUM           = 1000;
    48     final int MAX_CAPTURE_GROUP_NUM     = 0x8000;
    49     final int MAX_REPEAT_NUM            = 100000;
    50     final int MAX_MULTI_BYTE_RANGES_NUM = 10000;
    53     final boolean USE_WARN = true;
    55     // internal config
    56     final boolean USE_PARSE_TREE_NODE_RECYCLE       = true;
    57     final boolean USE_OP_PUSH_OR_JUMP_EXACT         = true;
    58     final boolean USE_SHARED_CCLASS_TABLE           = false;
    59     final boolean USE_QTFR_PEEK_NEXT                = true;
    61     final int INIT_MATCH_STACK_SIZE                 = 64;
    62     final int DEFAULT_MATCH_STACK_LIMIT_SIZE        = 0;        /* unlimited */
    63     final int NUMBER_OF_POOLED_STACKS               = 4;
    67     final boolean DONT_OPTIMIZE                     = false;
    69     final boolean USE_STRING_TEMPLATES              = true; // use embedded string templates in Regex object as byte arrays instead of compiling them into int bytecode array
    71     final boolean NON_UNICODE_SDW                   = true;
    74     final PrintStream log = System.out;
    75     final PrintStream err = System.err;
    77     final boolean DEBUG_ALL                         = false;
    79     final boolean DEBUG                             = DEBUG_ALL;
    80     final boolean DEBUG_PARSE_TREE                  = DEBUG_ALL;
    81     final boolean DEBUG_PARSE_TREE_RAW              = true;
    82     final boolean DEBUG_COMPILE                     = DEBUG_ALL;
    83     final boolean DEBUG_COMPILE_BYTE_CODE_INFO      = DEBUG_ALL;
    84     final boolean DEBUG_SEARCH                      = DEBUG_ALL;
    85     final boolean DEBUG_MATCH                       = DEBUG_ALL;
    86 }

mercurial