quickjs-tart

quickjs-based runtime for wallet-core logic
Log | Files | Refs | README | LICENSE

libregexp-opcode.h (2887B)


      1 /*
      2  * Regular Expression Engine
      3  *
      4  * Copyright (c) 2017-2018 Fabrice Bellard
      5  *
      6  * Permission is hereby granted, free of charge, to any person obtaining a copy
      7  * of this software and associated documentation files (the "Software"), to deal
      8  * in the Software without restriction, including without limitation the rights
      9  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
     10  * copies of the Software, and to permit persons to whom the Software is
     11  * furnished to do so, subject to the following conditions:
     12  *
     13  * The above copyright notice and this permission notice shall be included in
     14  * all copies or substantial portions of the Software.
     15  *
     16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
     17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
     18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
     19  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
     20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
     21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
     22  * THE SOFTWARE.
     23  */
     24 
     25 #ifdef DEF
     26 
     27 DEF(invalid, 1) /* never used */
     28 DEF(char, 3)
     29 DEF(char_i, 3)
     30 DEF(char32, 5)
     31 DEF(char32_i, 5)
     32 DEF(dot, 1)
     33 DEF(any, 1) /* same as dot but match any character including line terminator */
     34 DEF(space, 1)
     35 DEF(not_space, 1) /* must come after */
     36 DEF(line_start, 1)
     37 DEF(line_start_m, 1)
     38 DEF(line_end, 1)
     39 DEF(line_end_m, 1)
     40 DEF(goto, 5)
     41 DEF(split_goto_first, 5)
     42 DEF(split_next_first, 5)
     43 DEF(match, 1)
     44 DEF(lookahead_match, 1)
     45 DEF(negative_lookahead_match, 1) /* must come after */
     46 DEF(save_start, 2) /* save start position */
     47 DEF(save_end, 2) /* save end position, must come after saved_start */
     48 DEF(save_reset, 3) /* reset save positions */
     49 DEF(loop, 6) /* decrement the top the stack and goto if != 0 */
     50 DEF(loop_split_goto_first, 10) /* loop and then split */
     51 DEF(loop_split_next_first, 10)
     52 DEF(loop_check_adv_split_goto_first, 10) /* loop and then check advance and split */
     53 DEF(loop_check_adv_split_next_first, 10)
     54 DEF(set_i32, 6) /* store the immediate value to a register */
     55 DEF(word_boundary, 1)
     56 DEF(word_boundary_i, 1)
     57 DEF(not_word_boundary, 1)
     58 DEF(not_word_boundary_i, 1)
     59 DEF(back_reference, 2) /* variable length */
     60 DEF(back_reference_i, 2) /* must come after */
     61 DEF(backward_back_reference, 2) /* must come after */
     62 DEF(backward_back_reference_i, 2) /* must come after */
     63 DEF(range, 3) /* variable length */
     64 DEF(range_i, 3) /* variable length */
     65 DEF(range32, 3) /* variable length */
     66 DEF(range32_i, 3) /* variable length */
     67 DEF(lookahead, 5)
     68 DEF(negative_lookahead, 5) /* must come after */
     69 DEF(set_char_pos, 2) /* store the character position to a register */
     70 DEF(check_advance, 2) /* check that the register is different from the character position */
     71 DEF(prev, 1) /* go to the previous char */
     72 
     73 #endif /* DEF */