function parseStringToken (state, quote) {
    let str = ''

    while (currentCharacter(state) !== '' && currentCharacter(state) !== quote) {
      if (currentCharacter(state) === '\\') {
        next(state)

        const char = currentCharacter(state)
        const escapeChar = ESCAPE_CHARACTERS[char]
        if (escapeChar !== undefined) {
          // an escaped control character like \" or \n
          str += escapeChar
          state.index += 1
        } else if (char === 'u') {
          // escaped unicode character
          const unicode = state.expression.slice(state.index + 1, state.index + 5)
          if (/^[0-9A-Fa-f]{4}$/.test(unicode)) { // test whether the string holds four hexadecimal values
            str += String.fromCharCode(parseInt(unicode, 16))
            state.index += 5
          } else {
            throw createSyntaxError(state, `Invalid unicode character \\u${unicode}`)
          }
        } else {
          throw createSyntaxError(state, `Bad escape character \\${char}`)
        }
      } else {
        // any regular character
        str += currentCharacter(state)
        next(state)
      }
    }

    getToken(state)
    if (state.token !== quote) {
      throw createSyntaxError(state, `End of string ${quote} expected`)
    }
    getToken(state)

    return str
  }
Parse a string surrounded by single or double quotes
@param {Object} state
@param {"'" | "\""} quote
@return {string}