File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -119,12 +119,13 @@ regex_normal_char = {
119119}
120120regex_escaped_char = { "\\" ~ ANY }
121121
122- // Regex arguments for map operations (stop at any } )
123- map_regex_arg = @{ (map_regex_escaped_char | map_regex_pipe_or_char)* }
122+ // Regex arguments for map operations (improved to handle braces in regex )
123+ map_regex_arg = @{ (map_regex_escaped_char | map_regex_balanced_brace | map_regex_pipe_or_char)* }
124124map_regex_pipe_or_char = { map_regex_pipe | map_regex_normal_char }
125125map_regex_pipe = { "|" ~ !operation_name }
126+ map_regex_balanced_brace = { "{" ~ (!("}" ~ &("|" | "}" | EOI | (":" ~ number))) ~ ANY)* ~ "}" }
126127map_regex_normal_char = {
127- !(":" ~ (operation_name | range_spec | number)) ~ !("|" ~ operation_name) ~ !("}" ~ ("|" | EOI)) ~ ANY
128+ !(":" ~ (operation_name | range_spec | number)) ~ !("|" ~ operation_name) ~ !("{" | (" }" ~ & ("|" | "}" | EOI | (":" ~ number)) )) ~ ANY
128129}
129130map_regex_escaped_char = { "\\" ~ ANY }
130131
You can’t perform that action at this time.
0 commit comments