Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions gen/repl.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
const uint32_t qjsc_repl_size = 24338;

const uint8_t qjsc_repl[24338] = {
0x1a, 0x8e, 0x10, 0xe1, 0xf4, 0xb5, 0x04, 0x01,
0x1a, 0x8e, 0x2b, 0x32, 0xdd, 0xb5, 0x04, 0x01,
0x0e, 0x72, 0x65, 0x70, 0x6c, 0x2e, 0x6a, 0x73,
0x01, 0x0e, 0x71, 0x6a, 0x73, 0x3a, 0x73, 0x74,
0x64, 0x01, 0x0c, 0x71, 0x6a, 0x73, 0x3a, 0x6f,
Expand Down Expand Up @@ -1323,13 +1323,13 @@ const uint8_t qjsc_repl[24338] = {
0x79, 0x5d, 0x2b, 0x24, 0x07, 0x96, 0x01, 0x00,
0x00, 0x01, 0x00, 0x43, 0x00, 0x00, 0x00, 0x09,
0x06, 0x00, 0x00, 0x00, 0x05, 0x08, 0xf5, 0xff,
0xff, 0xff, 0x0c, 0x00, 0x06, 0x1d, 0x20, 0x00,
0xff, 0xff, 0x0c, 0x00, 0x21, 0x1d, 0x20, 0x00,
0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff,
0xff, 0x7f, 0x01, 0x00, 0x00, 0x00, 0x16, 0x07,
0x00, 0x64, 0x00, 0x64, 0x00, 0x67, 0x00, 0x67,
0x00, 0x69, 0x00, 0x69, 0x00, 0x6d, 0x00, 0x6d,
0x00, 0x73, 0x00, 0x73, 0x00, 0x75, 0x00, 0x76,
0x00, 0x79, 0x00, 0x79, 0x00, 0x0b, 0x07, 0x0d,
0x00, 0x79, 0x00, 0x79, 0x00, 0x0b, 0x22, 0x0d,
0x00, 0x0b, 0xd8, 0xba, 0xa6, 0xf0, 0x03, 0xe3,
0x28, 0xd7, 0xd8, 0xbb, 0x9d, 0x46, 0xcf, 0xd8,
0xbb, 0xad, 0xf0, 0x17, 0xcb, 0x04, 0xc3, 0x01,
Expand Down Expand Up @@ -1722,7 +1722,7 @@ const uint8_t qjsc_repl[24338] = {
0x24, 0x5d, 0x2a, 0x07, 0xaa, 0x01, 0x00, 0x00,
0x01, 0x00, 0x4d, 0x00, 0x00, 0x00, 0x09, 0x06,
0x00, 0x00, 0x00, 0x05, 0x08, 0xf5, 0xff, 0xff,
0xff, 0x0c, 0x00, 0x06, 0x16, 0x04, 0x00, 0x24,
0xff, 0x0c, 0x00, 0x21, 0x16, 0x04, 0x00, 0x24,
0x00, 0x24, 0x00, 0x41, 0x00, 0x5a, 0x00, 0x5f,
0x00, 0x5f, 0x00, 0x61, 0x00, 0x7a, 0x00, 0x1d,
0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
Expand Down Expand Up @@ -1952,7 +1952,7 @@ const uint8_t qjsc_repl[24338] = {
0x7c, 0x5c, 0x5c, 0x2e, 0x29, 0x2a, 0x22, 0x07,
0x98, 0x01, 0x00, 0x00, 0x02, 0x01, 0x44, 0x00,
0x00, 0x00, 0x09, 0x06, 0x00, 0x00, 0x00, 0x05,
0x08, 0xf5, 0xff, 0xff, 0xff, 0x0c, 0x00, 0x06,
0x08, 0xf5, 0xff, 0xff, 0xff, 0x0c, 0x00, 0x21,
0x01, 0x22, 0x0e, 0x01, 0x01, 0x0a, 0x27, 0x00,
0x00, 0x00, 0x1a, 0x0c, 0x01, 0x0a, 0x14, 0x00,
0x00, 0x00, 0x16, 0x03, 0x00, 0x00, 0x00, 0x21,
Expand All @@ -1965,7 +1965,7 @@ const uint8_t qjsc_repl[24338] = {
0x07, 0x98, 0x01, 0x00, 0x00, 0x02, 0x01, 0x44,
0x00, 0x00, 0x00, 0x09, 0x06, 0x00, 0x00, 0x00,
0x05, 0x08, 0xf5, 0xff, 0xff, 0xff, 0x0c, 0x00,
0x06, 0x01, 0x27, 0x0e, 0x01, 0x01, 0x0a, 0x27,
0x21, 0x01, 0x27, 0x0e, 0x01, 0x01, 0x0a, 0x27,
0x00, 0x00, 0x00, 0x1a, 0x0c, 0x01, 0x0a, 0x14,
0x00, 0x00, 0x00, 0x16, 0x03, 0x00, 0x00, 0x00,
0x26, 0x00, 0x28, 0x00, 0x5b, 0x00, 0x5d, 0x00,
Expand All @@ -1976,7 +1976,7 @@ const uint8_t qjsc_repl[24338] = {
0x5d, 0x2b, 0x5c, 0x3e, 0x07, 0x74, 0x00, 0x00,
0x01, 0x00, 0x32, 0x00, 0x00, 0x00, 0x09, 0x06,
0x00, 0x00, 0x00, 0x05, 0x08, 0xf5, 0xff, 0xff,
0xff, 0x0c, 0x00, 0x06, 0x01, 0x3c, 0x1d, 0x0c,
0xff, 0x0c, 0x00, 0x21, 0x01, 0x3c, 0x1d, 0x0c,
0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xff,
0xff, 0xff, 0x7f, 0x01, 0x00, 0x00, 0x00, 0x16,
0x02, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x3f, 0x00,
Expand All @@ -1985,7 +1985,7 @@ const uint8_t qjsc_repl[24338] = {
0x5d, 0x5d, 0x2b, 0x5c, 0x5d, 0x07, 0x74, 0x00,
0x00, 0x01, 0x00, 0x32, 0x00, 0x00, 0x00, 0x09,
0x06, 0x00, 0x00, 0x00, 0x05, 0x08, 0xf5, 0xff,
0xff, 0xff, 0x0c, 0x00, 0x06, 0x01, 0x5b, 0x1d,
0xff, 0xff, 0x0c, 0x00, 0x21, 0x01, 0x5b, 0x1d,
0x0c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0xff, 0xff, 0xff, 0x7f, 0x01, 0x00, 0x00, 0x00,
0x16, 0x02, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x5e,
Expand All @@ -2002,7 +2002,7 @@ const uint8_t qjsc_repl[24338] = {
0x2d, 0x39, 0x5d, 0x2a, 0x07, 0x9e, 0x03, 0x00,
0x00, 0x01, 0x00, 0xc7, 0x00, 0x00, 0x00, 0x09,
0x06, 0x00, 0x00, 0x00, 0x05, 0x08, 0xf5, 0xff,
0xff, 0xff, 0x0c, 0x00, 0x06, 0x1d, 0x10, 0x00,
0xff, 0xff, 0x0c, 0x00, 0x21, 0x1d, 0x10, 0x00,
0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff,
0xff, 0x7f, 0x01, 0x00, 0x00, 0x00, 0x16, 0x03,
0x00, 0x30, 0x00, 0x39, 0x00, 0x5f, 0x00, 0x5f,
Expand Down
17 changes: 15 additions & 2 deletions libregexp-opcode.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ DEF(char16, 3)
DEF(char32, 5)
DEF(dot, 1)
DEF(any, 1) /* same as dot but match any character including line terminator */
DEF(line_start, 1)
DEF(line_end, 1)
DEF(line_start, 1) /* multiline ^: match at string start or after a line terminator */
DEF(line_end, 1) /* multiline $: match at string end or before a line terminator */
DEF(goto, 5)
DEF(split_goto_first, 5)
DEF(split_next_first, 5)
Expand All @@ -55,4 +55,17 @@ DEF(check_advance, 1) /* pop one stack element and check that it is different fr
DEF(prev, 1) /* go to the previous char */
DEF(simple_greedy_quant, 17)

/* Opcodes added for ES2025 RegExp pattern modifiers. Appended at the end so the
numeric values of the opcodes above stay stable (e.g. hardcoded bytecode in
lre-test.c and the bytecode validator depend on them). */
DEF(char8_ci, 2) /* case-insensitive: canonicalize the input before comparing */
DEF(char16_ci, 3)
DEF(char32_ci, 5)
DEF(bol, 1) /* absolute ^: match only at the start of the string */
DEF(eol, 1) /* absolute $: match only at the end of the string */
DEF(back_reference_ci, 2) /* case-insensitive back reference */
DEF(backward_back_reference_ci, 2) /* must come after back_reference_ci */
DEF(range_ci, 3) /* case-insensitive range, variable length */
DEF(range32_ci, 3) /* case-insensitive range32, variable length */

#endif /* DEF */
Loading
Loading