diff options
author | K.Kosako <kkosako0@gmail.com> | 2024-04-01 23:50:00 +0900 |
---|---|---|
committer | K.Kosako <kkosako0@gmail.com> | 2024-04-01 23:50:00 +0900 |
commit | 23dfc82b9ea4a10c7ddb41bbd5a84ac50191aa40 (patch) | |
tree | a948cefb1268e9832d657802ea662b8233fb98ed | |
parent | b6937de434aa413ab204c9a96c48321ff5093dd7 (diff) | |
download | oniguruma-23dfc82b9ea4a10c7ddb41bbd5a84ac50191aa40.zip oniguruma-23dfc82b9ea4a10c7ddb41bbd5a84ac50191aa40.tar.gz oniguruma-23dfc82b9ea4a10c7ddb41bbd5a84ac50191aa40.tar.bz2 |
fix #292: ONIG_SYN_CONTEXT_INDEP_REPEAT_OPS not working for ^* pattern
-rw-r--r-- | src/regparse.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/regparse.c b/src/regparse.c index d7d188a..e21f158 100644 --- a/src/regparse.c +++ b/src/regparse.c @@ -2,7 +2,7 @@ regparse.c - Oniguruma (regular expression library) **********************************************************************/ /*- - * Copyright (c) 2002-2023 K.Kosako + * Copyright (c) 2002-2024 K.Kosako * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -9085,8 +9085,14 @@ prs_exp(Node** np, PToken* tok, int term, UChar** src, UChar* end, if (r == TK_REPEAT || r == TK_INTERVAL) { Node* target; - if (is_invalid_quantifier_target(*tp)) - return ONIGERR_TARGET_OF_REPEAT_OPERATOR_INVALID; + if (is_invalid_quantifier_target(*tp)) { + if (IS_SYNTAX_BV(env->syntax, ONIG_SYN_CONTEXT_INDEP_REPEAT_OPS)) { + if (IS_SYNTAX_BV(env->syntax, ONIG_SYN_CONTEXT_INVALID_REPEAT_OPS)) + return ONIGERR_TARGET_OF_REPEAT_OPERATOR_INVALID; + } + + return r; + } INC_PARSE_DEPTH(parse_depth); |