dist/vue-i18n.esm.browser.js
function parse$1 (path) {
  const keys = [];
  let index = -1;
  let mode = BEFORE_PATH;
  let subPathDepth = 0;
  let c;
  let key;
  let newChar;
  let type;
  let transition;
  let action;
  let typeMap;
  const actions = [];

  actions[PUSH] = function () {
    if (key !== undefined) {
      keys.push(key);
      key = undefined;
    }
  };

  actions[APPEND] = function () {
    if (key === undefined) {
      key = newChar;
    } else {
      key += newChar;
    }
  };

  actions[INC_SUB_PATH_DEPTH] = function () {
    actions[APPEND]();
    subPathDepth++;
  };

  actions[PUSH_SUB_PATH] = function () {
    if (subPathDepth > 0) {
      subPathDepth--;
      mode = IN_SUB_PATH;
      actions[APPEND]();
    } else {
      subPathDepth = 0;
      key = formatSubPath(key);
      if (key === false) {
        return false
      } else {
        actions[PUSH]();
      }
    }
  };

  function maybeUnescapeQuote () {
    const nextChar = path[index + 1];
    if ((mode === IN_SINGLE_QUOTE && nextChar === "'") ||
      (mode === IN_DOUBLE_QUOTE && nextChar === '"')) {
      index++;
      newChar = '\\' + nextChar;
      actions[APPEND]();
      return true
    }
  }

  while (mode !== null) {
    index++;
    c = path[index];

    if (c === '\\' && maybeUnescapeQuote()) {
      continue
    }

    type = getPathCharType(c);
    typeMap = pathStateMachine[mode];
    transition = typeMap[type] || typeMap['else'] || ERROR;

    if (transition === ERROR) {
      return // parse error
    }

    mode = transition[0];
    action = actions[transition[1]];
    if (action) {
      newChar = transition[2];
      newChar = newChar === undefined
        ? c
        : newChar;
      if (action() === false) {
        return
      }
    }

    if (mode === AFTER_PATH) {
      return keys
    }
  }
}
function parse$1 (path) {
  const keys = [];
  let index = -1;
  let mode = BEFORE_PATH;
  let subPathDepth = 0;
  let c;
  let key;
  let newChar;
  let type;
  let transition;
  let action;
  let typeMap;
  const actions = [];

  actions[PUSH] = function () {
    if (key !== undefined) {
      keys.push(key);
      key = undefined;
    }
  };

  actions[APPEND] = function () {
    if (key === undefined) {
      key = newChar;
    } else {
      key += newChar;
    }
  };

  actions[INC_SUB_PATH_DEPTH] = function () {
    actions[APPEND]();
    subPathDepth++;
  };

  actions[PUSH_SUB_PATH] = function () {
    if (subPathDepth > 0) {
      subPathDepth--;
      mode = IN_SUB_PATH;
      actions[APPEND]();
    } else {
      subPathDepth = 0;
      key = formatSubPath(key);
      if (key === false) {
        return false
      } else {
        actions[PUSH]();
      }
    }
  };

  function maybeUnescapeQuote () {
    const nextChar = path[index + 1];
    if ((mode === IN_SINGLE_QUOTE && nextChar === "'") ||
      (mode === IN_DOUBLE_QUOTE && nextChar === '"')) {
      index++;
      newChar = '\\' + nextChar;
      actions[APPEND]();
      return true
    }
  }

  while (mode !== null) {
    index++;
    c = path[index];

    if (c === '\\' && maybeUnescapeQuote()) {
      continue
    }

    type = getPathCharType(c);
    typeMap = pathStateMachine[mode];
    transition = typeMap[type] || typeMap['else'] || ERROR;

    if (transition === ERROR) {
      return // parse error
    }

    mode = transition[0];
    action = actions[transition[1]];
    if (action) {
      newChar = transition[2];
      newChar = newChar === undefined
        ? c
        : newChar;
      if (action() === false) {
        return
      }
    }

    if (mode === AFTER_PATH) {
      return keys
    }
  }
}
function parse$1 ( path ) { const keys = [ ] ; let index = - 1 ; let mode = BEFORE_PATH ; let subPathDepth = 0 ; let c ; let key ; let newChar ; let type ; let transition ; let action ; let typeMap ; const actions = [ ] ; actions [ PUSH ] = function ( ) { if ( key !== undefined ) { keys . push ( key ) ; key = undefined ; } } ; actions [ APPEND ] = function ( ) { if ( key === undefined ) { key = newChar ; } else { key += newChar ; } } ; actions [ INC_SUB_PATH_DEPTH ] = function ( ) { actions [ APPEND ] ( ) ; subPathDepth ++ ; } ; actions [ PUSH_SUB_PATH ] = function ( ) { if ( subPathDepth > 0 ) { subPathDepth -- ; mode = IN_SUB_PATH ; actions [ APPEND ] ( ) ; } else { subPathDepth = 0 ; key = formatSubPath ( key ) ; if ( key === false ) { return false } else { actions [ PUSH ] ( ) ; } } } ; function maybeUnescapeQuote ( ) { const nextChar = path [ index + 1 ] ; if ( ( mode === IN_SINGLE_QUOTE && nextChar === "'" ) || ( mode === IN_DOUBLE_QUOTE && nextChar === '"' ) ) { index ++ ; newChar = '\\' + nextChar ; actions [ APPEND ] ( ) ; return true } } while ( mode !== null ) { index ++ ; c = path [ index ] ; if ( c === '\\' && maybeUnescapeQuote ( ) ) { continue } type = getPathCharType ( c ) ; typeMap = pathStateMachine [ mode ] ; transition = typeMap [ type ] || typeMap [ 'else' ] || ERROR ; if ( transition === ERROR ) { return // parse error } mode = transition [ 0 ] ; action = actions [ transition [ 1 ] ] ; if ( action ) { newChar = transition [ 2 ] ; newChar = newChar === undefined ? c : newChar ; if ( action ( ) === false ) { return } } if ( mode === AFTER_PATH ) { return keys } } }
Parse a string path into an array of segments
Parse a string path into an array of segments