sample-proxies/graphql-sample/graphql-proxy/apiproxy/resources/jsc/graphql.jsc.js
/**
     * Reads a string token from the source file.
     *
     * "([^"\\\u000A\u000D]|(\\(u[0-9a-fA-F]{4}|["\\/bfnrt])))*"
     */
Reads a string token from the source file.
Reads a string token from the source file .
function readString(source, start, line, col, prev) {
      var body = source.body;
      var position = start + 1;
      var chunkStart = position;
      var code = 0;
      var value = '';
      while (position < body.length && (code = charCodeAt.call(body, position)) !== null && 
      code !== 0x000a && code !== 0x000d) {
        if (code === 34) {
          value += slice.call(body, chunkStart, position);
          return new Tok(TokenKind.STRING, start, position + 1, line, col, prev, value);
        } 
        if (code < 0x0020 && code !== 0x0009) {
          throw syntaxError(source, position, "Invalid character within String: ".concat(printCharCode(code), "."));
        }
        ++position;
        if (code === 92) {
          value += slice.call(body, chunkStart, position - 1);
          code = charCodeAt.call(body, position);
          switch (code) {
            case 34:
              value += '"';
              break;
            case 47:
              value += '/';
              break;
            case 92:
              value += '\\';
              break;
            case 98:
              value += '\b';
              break;
            case 102:
              value += '\f';
              break;
            case 110:
              value += '\n';
              break;
            case 114:
              value += '\r';
              break;
            case 116:
              value += '\t';
              break;
            case 117:
              var charCode = uniCharCode(charCodeAt.call(body, position + 1), charCodeAt.call(body, position + 2), charCodeAt.call(body, position + 3), charCodeAt.call(body, position + 4));
              if (charCode < 0) {
                throw syntaxError(source, position, 'Invalid character escape sequence: ' + "\\u".concat(body.slice(position + 1, position + 5), "."));
              }
              value += String.fromCharCode(charCode);
              position += 4;
              break;
            default:
              throw syntaxError(source, position, "Invalid character escape sequence: \\".concat(String.fromCharCode(code), "."));
          }
          ++position;
          chunkStart = position;
        }
      }
      throw syntaxError(source, position, 'Unterminated string.');
    }
function readString ( source , start , line , col , prev ) { var body = source . body ; var position = start + 1 ; var chunkStart = position ; var code = 0 ; var value = '' ; while ( position < body . length && ( code = charCodeAt . call ( body , position ) ) !== null && code !== 0x000a && code !== 0x000d ) { if ( code === 34 ) { value += slice . call ( body , chunkStart , position ) ; return new Tok ( TokenKind . STRING , start , position + 1 , line , col , prev , value ) ; } if ( code < 0x0020 && code !== 0x0009 ) { throw syntaxError ( source , position , "Invalid character within String: " . concat ( printCharCode ( code ) , "." ) ) ; } ++ position ; if ( code === 92 ) { value += slice . call ( body , chunkStart , position - 1 ) ; code = charCodeAt . call ( body , position ) ; switch ( code ) { case 34 : value += '"' ; break ; case 47 : value += '/' ; break ; case 92 : value += '\\' ; break ; case 98 : value += '\b' ; break ; case 102 : value += '\f' ; break ; case 110 : value += '\n' ; break ; case 114 : value += '\r' ; break ; case 116 : value += '\t' ; break ; case 117 : var charCode = uniCharCode ( charCodeAt . call ( body , position + 1 ) , charCodeAt . call ( body , position + 2 ) , charCodeAt . call ( body , position + 3 ) , charCodeAt . call ( body , position + 4 ) ) ; if ( charCode < 0 ) { throw syntaxError ( source , position , 'Invalid character escape sequence: ' + "\\u" . concat ( body . slice ( position + 1 , position + 5 ) , "." ) ) ; } value += String . fromCharCode ( charCode ) ; position += 4 ; break ; default : throw syntaxError ( source , position , "Invalid character escape sequence: \\" . concat ( String . fromCharCode ( code ) , "." ) ) ; } ++ position ; chunkStart = position ; } } throw syntaxError ( source , position , 'Unterminated string.' ) ; }
Reads a string token from the source file.
Reads a string token from the source file .
// not LineTerminator // Closing Quote (") // SourceCharacter // \ // u