NameopsSourceIdentifiers and names
remove trailing digits
remove trailing digits, ' and _
Below, by subscript we mean a suffix composed solely from (decimal) digits.
Split an identifier into a base name and a subscript.
Append the subscript to the identifier.
Return the same identifier as the original one but whose subscript is incremented. If the original identifier does not have a suffix, 0 is appended to it.
Example mappings:
bar ↦ bar0
bar0 ↦ bar1
bar00 ↦ bar01
bar1 ↦ bar2
bar01 ↦ bar01
bar9 ↦ bar10
bar09 ↦ bar10
bar99 ↦ bar100
Metavariables