Commit Graph

11 Commits

Author SHA1 Message Date
Raka Hourianto
9b2b286baf nre: fix replacement string parser OOB access, numeric refs, and unterminated named refs (#25560)
1. A trailing `$` at the end of a replacement string could read out of
bounds via `how[i + 1]`; this now raises `ValueError` instead.

2. Numeric capture parsing used `id += (id * 10) + digit` instead of `id
= (id * 10) + digit`, so multi-digit refs were parsed incorrectly (e.g.
`$12` resolved as capture 13 instead of 12).

4. Unterminated named replacement syntax (e.g. `${foo)` is now rejected
with ValueError instead of being accepted and parsed inconsistently.

Found and fixed by GPT 5.3 Codex.
2026-02-28 07:39:16 +01:00
ringabout
4d11d0619d complete std prefixes for stdlib (#22887)
follow up https://github.com/nim-lang/Nim/pull/22851
follow up https://github.com/nim-lang/Nim/pull/22873
2023-10-30 17:03:04 +01:00
Andreas Rumpf
955b31a7d9 fixes #13654 2020-03-16 23:00:43 +01:00
Flaviu Tamas
c0a47f7e22 Rework nil/option for nre in light of ""==nil
Fixes #9243
2018-12-11 22:15:57 +00:00
Flaviu Tamas
22b3e9df27 Revert 7f49364fd0 for nre 2018-12-11 22:15:02 +00:00
Andreas Rumpf
7f49364fd0 make more tests green 2018-08-13 12:29:03 +02:00
Arne Döring
000b8afd26 Remove expr/stmt (#5857) 2017-07-25 09:28:23 +02:00
Flaviu Tamas
38064d043a Use stdlib's PCRE in nre 2015-06-07 13:13:04 -04:00
Flaviu Tamas
be64b8d0d4 Ensure no one uses internal module 2015-06-07 13:12:19 -04:00
Flaviu Tamas
075a5e8440 Disable static building of PCRE 2015-05-26 19:20:00 -04:00
Flaviu Tamas
0527e1f9fe Rearrange nre files 2015-05-26 19:14:04 -04:00