function GroupRefOrDecChar(text, textLoc) {
  const reference = Number(text.slice(1));

  if (reference > 0 && reference <= capturingGroupsCount) {
    return Node({
      type: 'Backreference',
      kind: 'number',
      number: reference,
      reference,
    }, textLoc);
  }

  return Char(text, 'decimal', textLoc);
}
function GroupRefOrDecChar(text, textLoc) {
  const reference = Number(text.slice(1));

  if (reference > 0 && reference <= capturingGroupsCount) {
    return Node({
      type: 'Backreference',
      kind: 'number',
      number: reference,
      reference,
    }, textLoc);
  }

  return Char(text, 'decimal', textLoc);
}
function GroupRefOrDecChar ( text , textLoc ) { const reference = Number ( text . slice ( 1 ) ) ; if ( reference > 0 && reference <= capturingGroupsCount ) { return Node ( { type : 'Backreference' , kind : 'number' , number : reference , reference , } , textLoc ) ; } return Char ( text , 'decimal' , textLoc ) ; }
Parses patterns like \1, \2, etc. either as a backreference
to a group, or a deciaml char code.
Parses patterns like \ 1 \ 2 etc . either as a backreference to a group or a deciaml char code .