nl_tokens: Increases a quantifier by one . Does not change greediness . * - > + + - > { 2 } ? - > { 1 2 } { 2 } - > { 3 } { 2 } - > { 3 } { 2 3 } - > { 3 4 }
pl_tokens: function increaseQuantifierByOne ( quantifier ) { if ( quantifier . kind === '*' ) { quantifier . <mask> = '+' ; } else if ( quantifier . kind === '+' ) { quantifier . kind = 'Range' ; quantifier . from = 2 ; delete quantifier . to ; } else if ( quantifier . kind === '?' ) { quantifier . kind = 'Range' ; quantifier . from = 1 ; quantifier . to = 2 ; } else if ( quantifier . kind === 'Range' ) { quantifier . from += 1 ; if ( quantifier . to ) { quantifier . to += 1 ; } } }