Mercurial > vim
comparison src/regexp_bt.c @ 26883:7f150a4936f2 v8.2.3970
patch 8.2.3970: error messages are spread out
Commit: https://github.com/vim/vim/commit/74409f62790a93daf0965c71da01ff76aa0fa5a5
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jan 1 15:58:22 2022 +0000
patch 8.2.3970: error messages are spread out
Problem: Error messages are spread out.
Solution: Move more errors to errors.h.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 01 Jan 2022 17:00:04 +0100 |
parents | d66ba549f68a |
children | aa65d1808bd0 |
comparison
equal
deleted
inserted
replaced
26882:196f4d7e2a38 | 26883:7f150a4936f2 |
---|---|
2449 else if (paren == REG_NOPAREN && peekchr() != NUL) | 2449 else if (paren == REG_NOPAREN && peekchr() != NUL) |
2450 { | 2450 { |
2451 if (curchr == Magic(')')) | 2451 if (curchr == Magic(')')) |
2452 EMSG2_RET_NULL(_(e_unmatched_str_close), reg_magic == MAGIC_ALL); | 2452 EMSG2_RET_NULL(_(e_unmatched_str_close), reg_magic == MAGIC_ALL); |
2453 else | 2453 else |
2454 EMSG_RET_NULL(_(e_trailing)); // "Can't happen". | 2454 EMSG_RET_NULL(_(e_trailing_characters)); // "Can't happen". |
2455 // NOTREACHED | 2455 // NOTREACHED |
2456 } | 2456 } |
2457 // Here we set the flag allowing back references to this set of | 2457 // Here we set the flag allowing back references to this set of |
2458 // parentheses. | 2458 // parentheses. |
2459 if (paren == REG_PAREN) | 2459 if (paren == REG_PAREN) |
3137 { | 3137 { |
3138 regitem_T *rp; | 3138 regitem_T *rp; |
3139 | 3139 |
3140 if ((long)((unsigned)regstack.ga_len >> 10) >= p_mmp) | 3140 if ((long)((unsigned)regstack.ga_len >> 10) >= p_mmp) |
3141 { | 3141 { |
3142 emsg(_(e_maxmempat)); | 3142 emsg(_(e_pattern_uses_more_memory_than_maxmempattern)); |
3143 return NULL; | 3143 return NULL; |
3144 } | 3144 } |
3145 if (ga_grow(®stack, sizeof(regitem_T)) == FAIL) | 3145 if (ga_grow(®stack, sizeof(regitem_T)) == FAIL) |
3146 return NULL; | 3146 return NULL; |
3147 | 3147 |
4211 // It could match. Prepare for trying to match what | 4211 // It could match. Prepare for trying to match what |
4212 // follows. The code is below. Parameters are stored in | 4212 // follows. The code is below. Parameters are stored in |
4213 // a regstar_T on the regstack. | 4213 // a regstar_T on the regstack. |
4214 if ((long)((unsigned)regstack.ga_len >> 10) >= p_mmp) | 4214 if ((long)((unsigned)regstack.ga_len >> 10) >= p_mmp) |
4215 { | 4215 { |
4216 emsg(_(e_maxmempat)); | 4216 emsg(_(e_pattern_uses_more_memory_than_maxmempattern)); |
4217 status = RA_FAIL; | 4217 status = RA_FAIL; |
4218 } | 4218 } |
4219 else if (ga_grow(®stack, sizeof(regstar_T)) == FAIL) | 4219 else if (ga_grow(®stack, sizeof(regstar_T)) == FAIL) |
4220 status = RA_FAIL; | 4220 status = RA_FAIL; |
4221 else | 4221 else |
4256 case BEHIND: | 4256 case BEHIND: |
4257 case NOBEHIND: | 4257 case NOBEHIND: |
4258 // Need a bit of room to store extra positions. | 4258 // Need a bit of room to store extra positions. |
4259 if ((long)((unsigned)regstack.ga_len >> 10) >= p_mmp) | 4259 if ((long)((unsigned)regstack.ga_len >> 10) >= p_mmp) |
4260 { | 4260 { |
4261 emsg(_(e_maxmempat)); | 4261 emsg(_(e_pattern_uses_more_memory_than_maxmempattern)); |
4262 status = RA_FAIL; | 4262 status = RA_FAIL; |
4263 } | 4263 } |
4264 else if (ga_grow(®stack, sizeof(regbehind_T)) == FAIL) | 4264 else if (ga_grow(®stack, sizeof(regbehind_T)) == FAIL) |
4265 status = RA_FAIL; | 4265 status = RA_FAIL; |
4266 else | 4266 else |