export default function (seperator, priority = 100) {
  const row = new RegExp(`^.+?${seperator}.+?$`, 'gm'); // matches a row containing tab seperated values. 
  const cellsInRow = new RegExp(`[^${seperator}]+`, 'g'); // for a given row string find the cell contents
  return {
    pattern: row,
    onMatch: function onMatch(match) {
      let tokens = [
        {
          name: 'TABLE_ROW',
          type: 'RANGE_START',
          index: match.index,
          chars: null,
          handle: 'before',
          priority: (priority + 0.02) * -1,
          delimiters: { open: null, close: null }
        }
      ];
      let text = match[0];
      let cellData = cellsInRow.exec(text);
      while (cellData) {
        tokens.push(
          {
            name: 'TABLE_CELL',
            type: 'RANGE_START',
            index: cellData.index + match.index,
            chars: seperator,
            handle: 'before',
            priority: (priority + 0.01) * -1,
            delimiters: { open: null, close: null }
          },
          // {
          //   name: 'TABLE_SEP_VALUE',
          //   type: 'SPECIAL_CHAR',
          //   chars: seperator,
          //   index: match.index + cellData.index + cellData[0].length,
          //   priority,
          //   handle: 'at',
          // },
          {
            name: 'TABLE_CELL',
            type: 'RANGE_END',
            index: match.index + cellData.index + cellData[0].length,
            chars: null,
            handle: 'before',
            priority: (priority + 0.01),
            delimiters: { open: null, close: null }
          }
        );
        cellData = cellsInRow.exec(text);
      }
      tokens.push({
        name: 'TABLE_ROW',
        type: 'RANGE_END',
        index: match.index + match[0].length,
        chars: null,
        handle: 'before',
        priority: (priority + 0.02),
        delimiters: { open: null, close: null }
      },
      {
        name: 'TABLE_TEST',
        type: 'SPECIAL_CHAR',
        chars: '\n',
        index: match.index + match[0].length,
        priority,
        handle: 'at',
      }
      );

      return tokens;
    }
  };
}

export function newTableStartToken() {
  return { name: 'TABLE', type: 'RANGE_START' };
}

export function newTableEndToken() {
  return { name: 'TABLE', type: 'RANGE_END' };
}

@@ -2180,24 +2180,29 @@
 eStartToken(
+props
 ) %7B%0A  return
@@ -2193,32 +2193,50 @@
 rops) %7B%0A  return
+ Object.assign(%7B%7D,
  %7B name: 'TABLE'
@@ -2258,16 +2258,24 @@
 START' %7D
+, props)
 ;%0A%7D%0A%0Aexp
@@ -2304,16 +2304,21 @@
 ndToken(
+props
 ) %7B%0A  re
@@ -2321,16 +2321,34 @@
   return
+ Object.assign(%7B%7D,
  %7B name:
@@ -2376,12 +2376,20 @@
 E_END' %7D
+, props)
 ;%0A%7D%0A

extend properties of table token