more code clean-up
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-08-31 17:58:12 +09:00
parent 8f1b8ffc03
commit 6aca30c893
3 changed files with 194 additions and 181 deletions

View File

@ -210,6 +210,8 @@ function main()
tap_ensure (x, "the tiger-tiger pounces on the dog", @SCRIPTNAME, @SCRIPTLINE);
x = gensub(/(tiger|dog)/, "\\1-\\1", 2, "the tiger pounces on the dog");
tap_ensure (x, "the tiger pounces on the dog-dog", @SCRIPTNAME, @SCRIPTLINE);
x = gensub(/(tiger|dog)/, "\\1-\\1", 2, @b"the tiger pounces on the dog");
tap_ensure (x, @b"the tiger pounces on the dog-dog", @SCRIPTNAME, @SCRIPTLINE);
## 0 as the third argument is same as not passing "g"/"G" or a positive occurrence number.
x = gensub(/(tiger|dog)/, "\\1-\\1", 0, "the tiger pounces on the dog");
@ -220,6 +222,8 @@ function main()
tap_ensure (x, "the tiger pounces on the dog", @SCRIPTNAME, @SCRIPTLINE);
x = gensub(/(tiger|(dog))/, "\\1-\\2", 'g', "the tiger pounces on the dog");
tap_ensure (x, "the tiger- pounces on the dog-dog", @SCRIPTNAME, @SCRIPTLINE);
x = gensub(/(tiger|(dog))/, "\\1-\\2", 'g', @b"the tiger pounces on the dog");
tap_ensure (x, @b"the tiger- pounces on the dog-dog", @SCRIPTNAME, @SCRIPTLINE);
x = gensub(/(tiger|(dog))/, "[&]", 'g', "the tiger pounces on the dog");
tap_ensure (x, "the [tiger] pounces on the [dog]", @SCRIPTNAME, @SCRIPTLINE);
x = gensub(/(tiger|(dog))/, "[\\0]", 'g', "the tiger pounces on the dog");