sample-proxies/graphql-sample/graphql-proxy/apiproxy/resources/jsc/graphql.jsc.js
/**
     * Gets the next token from the source starting at the given position.
     *
     * This skips over whitespace until it finds the next lexable token, then lexes
     * punctuators immediately or calls the appropriate helper function for more
     * complicated tokens.
     */
Gets the next token from the source starting at the given position.
This skips over whitespace until it finds the next lexable token, then lexes
punctuators immediately or calls the appropriate helper function for more
complicated tokens.
Gets the next token from the source starting at the given position . This skips over whitespace until it finds the next lexable token then lexes punctuators immediately or calls the appropriate helper function for more complicated tokens .
function readToken(lexer, prev) {
      var source = lexer.source;
      var body = source.body;
      var bodyLength = body.length;
      var pos = positionAfterWhitespace(body, prev.end, lexer);
      var line = lexer.line;
      var col = 1 + pos - lexer.lineStart;
      if (pos >= bodyLength) {
        return new Tok(TokenKind.EOF, bodyLength, bodyLength, line, col, prev);
      }
      var code = charCodeAt.call(body, pos); 
      switch (code) {
        case 33:
          return new Tok(TokenKind.BANG, pos, pos + 1, line, col, prev);
        case 35:
          return readComment(source, pos, line, col, prev);
        case 36:
          return new Tok(TokenKind.DOLLAR, pos, pos + 1, line, col, prev);
        case 38:
          return new Tok(TokenKind.AMP, pos, pos + 1, line, col, prev);
        case 40:
          return new Tok(TokenKind.PAREN_L, pos, pos + 1, line, col, prev);
        case 41:
          return new Tok(TokenKind.PAREN_R, pos, pos + 1, line, col, prev);
        case 46:
          if (charCodeAt.call(body, pos + 1) === 46 && charCodeAt.call(body, pos + 2) === 46) {
            return new Tok(TokenKind.SPREAD, pos, pos + 3, line, col, prev);
          }
          break;
        case 58:
          return new Tok(TokenKind.COLON, pos, pos + 1, line, col, prev);
        case 61:
          return new Tok(TokenKind.EQUALS, pos, pos + 1, line, col, prev);
        case 64:
          return new Tok(TokenKind.AT, pos, pos + 1, line, col, prev);
        case 91:
          return new Tok(TokenKind.BRACKET_L, pos, pos + 1, line, col, prev);
        case 93:
          return new Tok(TokenKind.BRACKET_R, pos, pos + 1, line, col, prev);
        case 123:
          return new Tok(TokenKind.BRACE_L, pos, pos + 1, line, col, prev);
        case 124:
          return new Tok(TokenKind.PIPE, pos, pos + 1, line, col, prev);
        case 125:
          return new Tok(TokenKind.BRACE_R, pos, pos + 1, line, col, prev);
        case 65:
        case 66:
        case 67:
        case 68:
        case 69:
        case 70:
        case 71:
        case 72:
        case 73:
        case 74:
        case 75:
        case 76:
        case 77:
        case 78:
        case 79:
        case 80:
        case 81:
        case 82:
        case 83:
        case 84:
        case 85:
        case 86:
        case 87:
        case 88:
        case 89:
        case 90:
        case 95:
        case 97:
        case 98:
        case 99:
        case 100:
        case 101:
        case 102:
        case 103:
        case 104:
        case 105:
        case 106:
        case 107:
        case 108:
        case 109:
        case 110:
        case 111:
        case 112:
        case 113:
        case 114:
        case 115:
        case 116:
        case 117:
        case 118:
        case 119:
        case 120:
        case 121:
        case 122:
          return readName(source, pos, line, col, prev);
        case 45:
        case 48:
        case 49:
        case 50:
        case 51:
        case 52:
        case 53:
        case 54:
        case 55:
        case 56:
        case 57:
          return readNumber(source, pos, code, line, col, prev);
        case 34:
          if (charCodeAt.call(body, pos + 1) === 34 && charCodeAt.call(body, pos + 2) === 34) {
            return readBlockString(source, pos, line, col, prev, lexer);
          }
          return readString(source, pos, line, col, prev);
      }
      throw syntaxError(source, pos, unexpectedCharacterMessage(code));
    }
function readToken ( lexer , prev ) { var source = lexer . source ; var body = source . body ; var bodyLength = body . length ; var pos = positionAfterWhitespace ( body , prev . end , lexer ) ; var line = lexer . line ; var col = 1 + pos - lexer . lineStart ; if ( pos >= bodyLength ) { return new Tok ( TokenKind . EOF , bodyLength , bodyLength , line , col , prev ) ; } var code = charCodeAt . call ( body , pos ) ; switch ( code ) { case 33 : return new Tok ( TokenKind . BANG , pos , pos + 1 , line , col , prev ) ; case 35 : return readComment ( source , pos , line , col , prev ) ; case 36 : return new Tok ( TokenKind . DOLLAR , pos , pos + 1 , line , col , prev ) ; case 38 : return new Tok ( TokenKind . AMP , pos , pos + 1 , line , col , prev ) ; case 40 : return new Tok ( TokenKind . PAREN_L , pos , pos + 1 , line , col , prev ) ; case 41 : return new Tok ( TokenKind . PAREN_R , pos , pos + 1 , line , col , prev ) ; case 46 : if ( charCodeAt . call ( body , pos + 1 ) === 46 && charCodeAt . call ( body , pos + 2 ) === 46 ) { return new Tok ( TokenKind . SPREAD , pos , pos + 3 , line , col , prev ) ; } break ; case 58 : return new Tok ( TokenKind . COLON , pos , pos + 1 , line , col , prev ) ; case 61 : return new Tok ( TokenKind . EQUALS , pos , pos + 1 , line , col , prev ) ; case 64 : return new Tok ( TokenKind . AT , pos , pos + 1 , line , col , prev ) ; case 91 : return new Tok ( TokenKind . BRACKET_L , pos , pos + 1 , line , col , prev ) ; case 93 : return new Tok ( TokenKind . BRACKET_R , pos , pos + 1 , line , col , prev ) ; case 123 : return new Tok ( TokenKind . BRACE_L , pos , pos + 1 , line , col , prev ) ; case 124 : return new Tok ( TokenKind . PIPE , pos , pos + 1 , line , col , prev ) ; case 125 : return new Tok ( TokenKind . BRACE_R , pos , pos + 1 , line , col , prev ) ; case 65 : case 66 : case 67 : case 68 : case 69 : case 70 : case 71 : case 72 : case 73 : case 74 : case 75 : case 76 : case 77 : case 78 : case 79 : case 80 : case 81 : case 82 : case 83 : case 84 : case 85 : case 86 : case 87 : case 88 : case 89 : case 90 : case 95 : case 97 : case 98 : case 99 : case 100 : case 101 : case 102 : case 103 : case 104 : case 105 : case 106 : case 107 : case 108 : case 109 : case 110 : case 111 : case 112 : case 113 : case 114 : case 115 : case 116 : case 117 : case 118 : case 119 : case 120 : case 121 : case 122 : return readName ( source , pos , line , col , prev ) ; case 45 : case 48 : case 49 : case 50 : case 51 : case 52 : case 53 : case 54 : case 55 : case 56 : case 57 : return readNumber ( source , pos , code , line , col , prev ) ; case 34 : if ( charCodeAt . call ( body , pos + 1 ) === 34 && charCodeAt . call ( body , pos + 2 ) === 34 ) { return readBlockString ( source , pos , line , col , prev , lexer ) ; } return readString ( source , pos , line , col , prev ) ; } throw syntaxError ( source , pos , unexpectedCharacterMessage ( code ) ) ; }
Gets the next token from the source starting at the given position.
Gets the next token from the source starting at the given position .
// SourceCharacter // ! // # // $ // & // ( // ) // . // : // = // @ // [ // ] // { // | // } // A-Z _ a-z // - 0-9 // "