Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Binds `this` to functions that are used in timeouts and intervals.
bindTimerFunction() { this.sweepCaches = this.sweepCaches.bind(this); this.sweepOldUpdates = this.sweepOldUpdates.bind(this); this.processGatewayQueue = this.processGatewayQueue.bind(this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "selfAssignHandlerFunctions() {\n this.request = this.api.request.bind(this.api);\n this.addRateLimitService = this.api.addRateLimitService.bind(this.api);\n this.addRequestService = this.api.addRequestService.bind(this.api);\n }", "constructor() {\r\n //So basically there are 4 methods, first it's bin...
[ "0.6188807", "0.5820613", "0.57892394", "0.56886774", "0.5661569", "0.56380963", "0.55863816", "0.5585365", "0.5541125", "0.54820985", "0.5391848", "0.5387918", "0.53832495", "0.53710616", "0.53529066", "0.53425145", "0.53340906", "0.53262675", "0.53235745", "0.5304367", "0.5...
0.6970258
0
Begins the interval that kicks off gateway logins from the queue.
startGatewayLoginInterval() { this.processGatewayQueueInterval = setInterval( this.processGatewayQueue, SECOND_IN_MILLISECONDS, ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async processGatewayQueue() {\n if (this.gatewayLoginQueue.length) {\n if (this.gatewayLoginQueue[0].resumable) {\n const gateway = this.gatewayLoginQueue.shift();\n await gateway.login();\n } else if (\n this.startingGateway === null\n && new Date().getTime() > this.safeGa...
[ "0.67500645", "0.58636904", "0.57406276", "0.5731081", "0.5642221", "0.563432", "0.55879617", "0.55875516", "0.5582932", "0.5556294", "0.55257684", "0.5502653", "0.54466677", "0.54392624", "0.5415736", "0.541324", "0.54127514", "0.54029757", "0.538253", "0.5362475", "0.534748...
0.81499416
0
Takes a gateway off of the queue and logs it in.
async processGatewayQueue() { if (this.gatewayLoginQueue.length) { if (this.gatewayLoginQueue[0].resumable) { const gateway = this.gatewayLoginQueue.shift(); await gateway.login(); } else if ( this.startingGateway === null && new Date().getTime() > this.safeGatewayIdentif...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "startGatewayLoginInterval() {\n this.processGatewayQueueInterval = setInterval(\n this.processGatewayQueue, SECOND_IN_MILLISECONDS,\n );\n }", "function onQueueReady(exchange){\n\tconsole.log(\"queue binding done...........................\");\n}", "function teller(queue) {\n console.log(\"The tel...
[ "0.62263864", "0.54880536", "0.5446053", "0.5440248", "0.5433068", "0.53938097", "0.53503513", "0.53410256", "0.52582437", "0.5248951", "0.51982915", "0.51926976", "0.5190369", "0.51784384", "0.5161793", "0.5157999", "0.51475185", "0.51475185", "0.5117649", "0.5116227", "0.50...
0.7189775
0
Sets up the internal handlers for this client.
init() { if (this.initialized) { throw Error('Client has already been initialized.'); } this.api = this.setUpApi(this.token, this.apiOptions); this.selfAssignHandlerFunctions(); this.initialized = true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setupHandlers () {\n this.rs.on('connected', () => this.eventHandler('connected'));\n this.rs.on('ready', () => this.eventHandler('ready'));\n this.rs.on('disconnected', () => this.eventHandler('disconnected'));\n this.rs.on('network-online', () => this.eventHandler('network-online'));\n this.rs.on(...
[ "0.6795829", "0.67717963", "0.67164385", "0.6679927", "0.63533586", "0.62744117", "0.619277", "0.6190624", "0.61382866", "0.61335516", "0.6104247", "0.60945797", "0.6078221", "0.60094976", "0.59849334", "0.5905171", "0.5905171", "0.5887536", "0.58851707", "0.58495444", "0.584...
0.6291826
5
Begins the intervals that prune caches.
startSweepIntervals() { this.sweepCachesInterval = setInterval( this.sweepCaches, 60 * MINUTE_IN_MILLISECONDS, ); this.sweepOldUpdatesInterval = setInterval( this.sweepOldUpdates, PARACORD_SWEEP_INTERVAL, ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startPruningInterval() {\n return setInterval(async () => {\n if (!PRUNE_IN_PROGRESS) {\n PRUNE_IN_PROGRESS = true\n await pruneOldProofStateDataAsync()\n PRUNE_IN_PROGRESS = false\n }\n }, PRUNE_INTERVAL_SECONDS * 1000)\n}", "startPruning() {\n console.log('initial prune', thi...
[ "0.6378861", "0.54834455", "0.5360628", "0.5229628", "0.5203082", "0.51424456", "0.51197773", "0.5106344", "0.5043815", "0.5039005", "0.5022451", "0.49958023", "0.49775654", "0.4957666", "0.48849183", "0.4868417", "0.48439518", "0.48374987", "0.48340964", "0.4832459", "0.4810...
0.60708594
1
Assigns some public functions from handlers to this client for easier access.
selfAssignHandlerFunctions() { this.request = this.api.request.bind(this.api); this.addRateLimitService = this.api.addRateLimitService.bind(this.api); this.addRequestService = this.api.addRequestService.bind(this.api); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_setupHandlers() {\n this._onAirportChangeHandler = this._onAirportChange.bind(this);\n this._onToggleViewHandler = this._onToggleView.bind(this);\n\n return this;\n }", "_setupHandlers() {\n this._onAirportChangeHandler = this.onAirportChange.bind(this);\n this._onChangeSel...
[ "0.63316596", "0.62350345", "0.6163324", "0.61419076", "0.5985162", "0.5885054", "0.58535296", "0.58347684", "0.58183014", "0.58183014", "0.58183014", "0.58183014", "0.58183014", "0.58183014", "0.58183014", "0.58183014", "0.58183014", "0.58183014", "0.58183014", "0.58124304", ...
0.72547567
0
Removes from presence and user caches users who are no longer in a cached guild.
sweepCaches() { const deleteIds = new Map([...this.presences, ...this.users]); Paracord.trimMembersFromDeleteList(deleteIds, this.guilds.values()); let sweptCount = 0; for (const id of deleteIds.keys()) { this.clearUserFromCaches(id); ++sweptCount; } this.log('INFO', `Swept ${swep...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function cleanUpOldCaches() {\n const currentCaches = [PRECACHE, RUNTIME];\n for (const cacheName of await caches.keys())\n if (!currentCaches.includes(cacheName))\n await caches.delete(cacheName);\n await self.clients.claim();\n}", "async function DeleteGuildCheck() {\n\t\tconst data = await Gu...
[ "0.59621996", "0.59130514", "0.58711594", "0.5825685", "0.5809443", "0.5782436", "0.57428485", "0.5714151", "0.56965345", "0.56965345", "0.5694999", "0.56812465", "0.5681082", "0.56760985", "0.56709135", "0.5663425", "0.5662045", "0.5662045", "0.5647837", "0.5586199", "0.5571...
0.70087385
0
Removes outdated states from the redundancy caches.
sweepOldUpdates() { const now = new Date().getTime(); Paracord.sweepOldEntries(now, this.veryRecentlyUpdatedPresences); Paracord.sweepOldEntries(now, this.veryRecentlyUpdatedUsers); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function cleanUpOldCaches() {\n const currentCaches = [PRECACHE, RUNTIME];\n for (const cacheName of await caches.keys())\n if (!currentCaches.includes(cacheName))\n await caches.delete(cacheName);\n await self.clients.claim();\n}", "function proactiveStalenessCleaner() {\n console.log(\"Swee...
[ "0.6343652", "0.63117474", "0.6178974", "0.6153546", "0.611288", "0.60780734", "0.6077024", "0.6077024", "0.6027146", "0.60025716", "0.60007244", "0.587683", "0.5853439", "0.5853439", "0.58420014", "0.5835556", "0.58212256", "0.58185506", "0.58064747", "0.57912153", "0.579121...
0.0
-1
Remove entries from a map whose timestamp is older than now.
static sweepOldEntries(now, map) { for (const [id, ts] of map.entries()) { if (ts < now) { map.delete(id); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "clearance () {\n mapDoS.forEach((val, key, map) => {\n if (val.at < moment().utc().subtract(val.interval, 'seconds')) {\n map.delete(key)\n }\n })\n }", "__removeOlderEntries() {\n const itemsToClear = Array.from(lastReadTimeForKey.keys()).slice(0, CACHE_ITEMS_TO_CLEAR_COUNT);\n ...
[ "0.686533", "0.6688326", "0.6151687", "0.61190164", "0.6063945", "0.603793", "0.6019428", "0.5963456", "0.57997525", "0.57582796", "0.5698017", "0.5628805", "0.5602516", "0.54860497", "0.5420813", "0.54147375", "0.53752476", "0.5345194", "0.5297651", "0.5280936", "0.5250382",...
0.8215804
0
base64 is 4/3 + up to two characters of the original data
function byteLength (b64) { var lens = getLens(b64) var validLen = lens[0] var placeHoldersLen = lens[1] return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getBase64() {\n var s = this.getDump();\n\n var ch =\n \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\n var c1, c2, c3, e1, e2, e3, e4;\n var l = s.length;\n var i = 0;\n var r = \"\";\n\n do {\n c1 = s.charCodeAt(i);\n e1 = c1 >> 2;\n c2 = s.charCod...
[ "0.77057606", "0.7324507", "0.72870255", "0.7230772", "0.7183817", "0.71231633", "0.7105772", "0.7089243", "0.7062078", "0.6977857", "0.6975599", "0.6933752", "0.6899215", "0.6899215", "0.6893997", "0.6879304", "0.68740326", "0.68740326", "0.68538475", "0.68362004", "0.681601...
0.0
-1
The Buffer constructor returns instances of `Uint8Array` that have their prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of `Uint8Array`, so the returned instances will have all the node `Buffer` methods and the `Uint8Array` methods. Square bracket notation works as expected it returns a si...
function Buffer (arg, encodingOrOffset, length) { // Common case. if (typeof arg === 'number') { if (typeof encodingOrOffset === 'string') { throw new TypeError( 'The "string" argument must be of type string. Received type number' ) } return allocUnsafe(arg) } return from(arg, en...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function BufferToArrayBuffer () {\n return (new Buffer(this)).buffer\n}", "function BufferToArrayBuffer () {\n return (new Buffer(this)).buffer\n}", "function BufferToArrayBuffer () {\n return (new Buffer(this)).buffer\n}", "function BufferToArrayBuffer () {\n return (new Buffer(this)).buffer\n}", "toB...
[ "0.7352709", "0.7352709", "0.7352709", "0.7352709", "0.69731885", "0.68939346", "0.68939346", "0.6847772", "0.6847772", "0.6847772", "0.6847772", "0.6847772", "0.6847772", "0.6847772", "0.6837532", "0.6837532", "0.6837532", "0.6837532", "0.6837532", "0.6837532", "0.6837532", ...
0.0
-1
Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, OR the last index of `val` in `buffer` at offset <= `byteOffset`. Arguments: buffer a Buffer to search val a string, Buffer, or number byteOffset an index into `buffer`; will be clamped to an int32 encoding an optional encoding, relevant is va...
function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) { // Empty buffer means no match if (buffer.length === 0) return -1 // Normalize byteOffset if (typeof byteOffset === 'string') { encoding = byteOffset byteOffset = 0 } else if (byteOffset > 0x7fffffff) { byteOffset = 0x7fffff...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bidirectionalIndexOf(buffer,val,byteOffset,encoding,dir){// Empty buffer means no match\n if(buffer.length===0)return -1;// Normalize byteOffset\n if(typeof byteOffset==='string'){encoding=byteOffset;byteOffset=0;}else if(byteOffset>0x7fffffff){byteOffset=0x7fffffff;}else if(byteOffset<-0x80000000){byte...
[ "0.82824165", "0.8254824", "0.8254824", "0.82529664", "0.82529664", "0.82529664", "0.82529664", "0.82529664", "0.82529664", "0.82529664", "0.82529664", "0.8248324", "0.82459784", "0.82443714", "0.82443714", "0.822776", "0.82196844", "0.8218323", "0.8218323", "0.8218323", "0.8...
0.0
-1
Need to make sure that buffer isn't trying to write out of bounds.
function checkOffset (offset, ext, length) { if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint') if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length') }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function writeBuffer(buffer, pos, src) {\n src.copy(buffer, pos)\n return src.length\n}", "function writeBuffer(buffer, pos, src) {\n src.copy(buffer, pos)\n return src.length\n}", "ensure(n) {\n let minsize = this.pos + n;\n if (minsize > this.capacity) {\n let cap = this.capacity * 2;\n w...
[ "0.6671099", "0.6671099", "0.6633306", "0.65198624", "0.6382912", "0.6277044", "0.62559897", "0.6233742", "0.6233742", "0.61069196", "0.6035995", "0.6019971", "0.59825265", "0.5959368", "0.59508586", "0.59508586", "0.59508586", "0.59508586", "0.59508586", "0.59508586", "0.595...
0.0
-1
ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass the `instanceof` check but they should be treated as of that type. See:
function isInstance (obj, type) { return obj instanceof type || (obj != null && obj.constructor != null && obj.constructor.name != null && obj.constructor.name === type.name) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isArrayBuffer (o) { return o instanceof ArrayBuffer }", "function isArrayBuffer (o) { return o instanceof ArrayBuffer }", "function isArrayBuffer(value) {\n return typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer;\n}", "function isArrayBuffer(value) {\n return typeof ArrayBuf...
[ "0.693081", "0.693081", "0.66421545", "0.66421545", "0.66421545", "0.66421545", "0.66421545", "0.66421545", "0.66421545", "0.66421545", "0.66421545", "0.66421545", "0.66421545", "0.66421545", "0.66421545", "0.661552", "0.6572725", "0.6572725", "0.6562013", "0.65518194", "0.65...
0.0
-1
v8 likes predictible objects
function Item(fun, array) { this.fun = fun; this.array = array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compareLike(a,b){\n var al = a.idLikesProp.length;\n var bl = b.idLikesProp.length;\n if(al > bl) return -1;\n if(bl > al) return 1;\n return 0;\n}", "function lookAround() {\n var objectDescription = \"\"\n tj.see().then(function(objects) {\n objects.forEach(function(each) {\n ...
[ "0.527866", "0.52612406", "0.51951283", "0.518796", "0.51302594", "0.5044646", "0.48934332", "0.4857401", "0.484017", "0.48302925", "0.482028", "0.4812441", "0.4808473", "0.47852293", "0.47828078", "0.47574478", "0.47493434", "0.4739314", "0.47239366", "0.4703992", "0.4703992...
0.0
-1
Strip insignificant whitespace Note that this could do a lot more, such as reorder fields etc.
function normalize(string) { return string.replace(/[\s,]+/g, ' ').trim(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function skipWhitespace() {\n input = input.replace(/^\\s+/, \"\");\n }", "function strip(s) {\n\t\treturn s.replace(/^\\s+|\\s+$/g,'');\n\t}", "function removeWhiteSpace(data) {\n return data.replace(/^\\s*|\\s*$/g, '');\n}", "function stripWhitespace(str) {\n return str.trim().replace(/\\s*\\...
[ "0.7438568", "0.7392154", "0.7259575", "0.723194", "0.7221569", "0.7211619", "0.71841294", "0.71803844", "0.7149323", "0.71104753", "0.7095917", "0.7095917", "0.7095917", "0.707183", "0.707183", "0.7058508", "0.7058071", "0.7048667", "0.7032654", "0.70217896", "0.70217896", ...
0.0
-1
XXX This should eventually disallow arbitrary string interpolation, like Relay does
function gql(/* arguments */) { var args = Array.prototype.slice.call(arguments); var literals = args[0]; // We always get literals[0] and then matching post literals for each arg given var result = (typeof(literals) === "string") ? literals : literals[0]; for (var i = 1; i < args.length; i++) { if (ar...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get BackQuote() {}", "get DoubleQuote() {}", "set BackQuote(value) {}", "function stringsLiteral(){\n const x = \"todos\";\n const y = \"clase\";\n console.log(`Hola a ${x} los de la ${y}`);\n}", "set DoubleQuote(value) {}", "function TemplateStrings() {\n\n\n // Basic literal string creation...
[ "0.61615944", "0.60982186", "0.60802174", "0.59947795", "0.5901933", "0.5848579", "0.56664693", "0.5588851", "0.5588851", "0.5567094", "0.55368435", "0.55368435", "0.55180156", "0.5510564", "0.54561144", "0.54545355", "0.5440889", "0.54285955", "0.54138184", "0.5406695", "0.5...
0.0
-1
Copyright (c) 2015present, Facebook, Inc. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree. strict
function GraphQLError( // eslint-disable-line no-redeclare message, nodes, source, positions, path, originalError, extensions) { // Compute list of blame nodes. var _nodes = Array.isArray(nodes) ? nodes.length !== 0 ? nodes : undefined : nodes ? [nodes] : undefined; // Compute locations in the source for the given ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "private public function m246() {}", "function auth_Facebook()\n{\n authenticate(new firebase.auth.FacebookAuthProvider());\n}", "function facebookLogin()\r\n{\r\n var fb = FBConnect.install();\r\n fb.connect(client_id,redir_url,\"touch\");\r\n fb.onConnect =...
[ "0.53286284", "0.5326925", "0.5315908", "0.5244446", "0.52183735", "0.5126341", "0.5117515", "0.5106957", "0.5087314", "0.50676376", "0.50658154", "0.5065494", "0.50513077", "0.5043975", "0.50391704", "0.5036819", "0.5025374", "0.5020367", "0.50001156", "0.49999058", "0.49956...
0.0
-1
Render a helpful description of the location of the error in the GraphQL Source document.
function highlightSourceAtLocation(source, location) { var firstLineColumnOffset = source.locationOffset.column - 1; var body = whitespace(firstLineColumnOffset) + source.body; var lineIndex = location.line - 1; var lineOffset = source.locationOffset.line - 1; var lineNum = location.line + lineOffset; var c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayError() {\r\n let html = `${addBookmark()}<div id=\"error-message\">${store.error}</div>`;\r\n return html;\r\n}", "customFormatErrorFn(err){\n // original error will be set by express graphql when it detects an error i.e\n // thrown in the code (either by you or any 3rd party pac...
[ "0.5841287", "0.57854533", "0.5782605", "0.57069385", "0.5687602", "0.56578815", "0.5649457", "0.56318486", "0.5541264", "0.55406266", "0.55342686", "0.5484367", "0.5457042", "0.5457042", "0.54358673", "0.54099834", "0.54099834", "0.54099834", "0.54099834", "0.5401408", "0.54...
0.0
-1
Copyright (c) 2015present, Facebook, Inc. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree. strict Used to print values in error messages.
function inspect(value) { switch (_typeof(value)) { case 'string': return JSON.stringify(value); case 'function': return value.name ? "[function ".concat(value.name, "]") : '[function]'; case 'object': if (value) { if (typeof value.inspect === 'function') { return val...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function strict(value,message){if(!value)fail(value,true,message,'==',strict);}", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n }", "function strict(value, message) {\n if (!value) fail(value, true, message, '==', strict);\n}", "function strict(...
[ "0.6707548", "0.6272748", "0.6126861", "0.6126861", "0.6126861", "0.6126861", "0.6126861", "0.6126861", "0.6126861", "0.6126861", "0.6126861", "0.6126861", "0.6126861", "0.6126861", "0.6126861", "0.6126861", "0.6126861", "0.6126861", "0.6126861", "0.6126861", "0.6126861", "...
0.0
-1
Copyright (c) 2015present, Facebook, Inc. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree. strict
function invariant(condition, message) { /* istanbul ignore else */ if (!condition) { throw new Error(message); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "private public function m246() {}", "function auth_Facebook()\n{\n authenticate(new firebase.auth.FacebookAuthProvider());\n}", "function facebookLogin()\r\n{\r\n var fb = FBConnect.install();\r\n fb.connect(client_id,redir_url,\"touch\");\r\n fb.onConnect =...
[ "0.53298956", "0.5328245", "0.5316618", "0.52455264", "0.5218697", "0.512719", "0.5118389", "0.5107385", "0.508811", "0.50679713", "0.50662166", "0.50661635", "0.5051633", "0.5044884", "0.5039429", "0.50370425", "0.5026767", "0.50215137", "0.50006604", "0.5000646", "0.4997066...
0.0
-1
Copyright (c) 2015present, Facebook, Inc. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree. strict Produces the value of a block string from its parsed raw value, similar to CoffeeScript's block string, Python's docstring trim or Ruby's strip_heredoc...
function blockStringValue(rawString) { // Expand a block string's raw value into independent lines. var lines = rawString.split(/\r\n|[\n\r]/g); // Remove common indentation from all lines but first. var commonIndent = null; for (var i = 1; i < lines.length; i++) { var line = lines[i]; var indent = le...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function blockStringValue(rawString) {\n // Expand a block string's raw value into independent lines.\n var lines = rawString.split(/\\r\\n|[\\n\\r]/g);\n\n // Remove common indentation from all lines but first.\n var commonIndent = null;\n for (var i = 1; i < lines.length; i++) {\n var line = lines[i];\n ...
[ "0.6785007", "0.6785007", "0.6785007", "0.6785007", "0.6785007", "0.67303616", "0.6210283", "0.61421895", "0.5959864", "0.5959864", "0.59570426", "0.5930598", "0.5930598", "0.5930598", "0.5930598", "0.5925349", "0.5924994", "0.5923799", "0.59188503", "0.59035283", "0.58915216...
0.68788564
1
Copyright (c) 2015present, Facebook, Inc. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree. strict Given a Source object, this returns a Lexer for that source. A Lexer is a stateful stream generator in that every time it is advanced, it returns the n...
function createLexer(source, options) { var startOfFileToken = new Tok(TokenKind.SOF, 0, 0, 0, 0, null); var lexer = { source: source, options: options, lastToken: startOfFileToken, token: startOfFileToken, line: 1, lineStart: 0, advance: advanceLexer, lookahead: lookahead }; ret...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Lexer(source) {\n var startOfFileToken = new _ast_mjs__WEBPACK_IMPORTED_MODULE_0__.Token(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_1__.TokenKind.SOF, 0, 0, 0, 0, null);\n this.source = source;\n this.lastToken = startOfFileToken;\n this.token = startOfFileToken;\n this.line = 1;\n this.lin...
[ "0.76987857", "0.76987857", "0.76481086", "0.7643329", "0.755277", "0.755277", "0.755277", "0.7420311", "0.7420311", "0.7420311", "0.7420311", "0.7420311", "0.7420311", "0.740795", "0.7400029", "0.73884505", "0.7368178", "0.73656523", "0.73578465", "0.7352792", "0.73190033", ...
0.73027825
28
A helper function to describe a token as a string for debugging
function getTokenDesc(token) { var value = token.value; return value ? "".concat(token.kind, " \"").concat(value, "\"") : token.kind; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function printToken(token) {\r\n\t\tif (token.type === 'quote') {\r\n\t\t\treturn `\"${token.token}\"`;\r\n\t\t} else {\r\n\t\t\treturn token.token;\r\n\t\t}\r\n\t}", "function getTokenDesc(token) {\n var value = token.value;\n return value ? \"\".concat(token.kind, \" \\\"\").concat(value, \"\\\"\") :...
[ "0.73460126", "0.7264702", "0.72487056", "0.72487056", "0.72251856", "0.7214866", "0.7214866", "0.7214866", "0.7214866", "0.7214866", "0.7214866", "0.7214866", "0.7214866", "0.7214866", "0.7214866", "0.7214866", "0.7141012", "0.7137655", "0.707707", "0.7075087", "0.7075087", ...
0.7238877
8
Helper function for constructing the Token object.
function Tok(kind, start, end, line, column, prev, value) { this.kind = kind; this.start = start; this.end = end; this.line = line; this.column = column; this.value = value; this.prev = prev; this.next = null; } // Print a simplified form when appearing in JSON/util.inspect.
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeToken(kind, start, end, value) {\n\t return { kind: kind, start: start, end: end, value: value };\n\t}", "function makeToken(kind, start, end, value) {\n return { kind: kind, start: start, end: end, value: value };\n}", "constructor(token, type) {\n this._token = token; //token object\n ...
[ "0.716749", "0.7155585", "0.706904", "0.7064976", "0.69540286", "0.6936082", "0.6918525", "0.68987185", "0.6793239", "0.67745304", "0.6673528", "0.66003233", "0.659534", "0.649638", "0.6490552", "0.63975376", "0.6384403", "0.6367625", "0.63613516", "0.6276101", "0.6250431", ...
0.0
-1
Gets the next token from the source starting at the given position. This skips over whitespace and comments 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, b...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function readToken(lexer, prev) {\n var source = lexer.source;\n var body = source.body;\n var bodyLength = body.length;\n var pos = positionAfterWhitespace(body, prev.end, lexer);\n var line = lexer.line;\n var col = 1 + pos - lexer.lineStart;\n\n if (pos >= bodyLength) {\n return new _ast_mjs__WEBPACK_...
[ "0.6618624", "0.65106016", "0.6425974", "0.6411329", "0.64084995", "0.63985974", "0.63973576", "0.63973576", "0.63973576", "0.63973576", "0.63973576", "0.63973576", "0.63917154", "0.6375435", "0.63743746", "0.63704515", "0.63704515", "0.63522685", "0.63522685", "0.63522685", ...
0.6263421
30
Report a message that an unexpected character was encountered.
function unexpectedCharacterMessage(code) { if (code < 0x0020 && code !== 0x0009 && code !== 0x000a && code !== 0x000d) { return "Cannot contain the invalid character ".concat(printCharCode(code), "."); } if (code === 39) { // ' return "Unexpected single quote character ('), did you mean to use " + '...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function unexpectedCharacterMessage(code) {\n if (code < 0x0020 && code !== 0x0009 && code !== 0x000a && code !== 0x000d) {\n return \"Cannot contain the invalid character \".concat(printCharCode(code), \".\");\n }\n\n if (code === 39) {\n // '\n return 'Unexpected single quote ...
[ "0.708676", "0.6923222", "0.68756294", "0.68689543", "0.68689543", "0.68689543", "0.68689543", "0.68689543", "0.68689543", "0.68689543", "0.68689543", "0.68689543", "0.68689543", "0.68689543", "0.6818663", "0.6818663", "0.6818663", "0.6818663", "0.6818663", "0.6818663", "0.67...
0.6938613
4
Reads from body starting at startPosition until it finds a nonwhitespace or commented character, then returns the position of that character for lexing.
function positionAfterWhitespace(body, startPosition, lexer) { var bodyLength = body.length; var position = startPosition; while (position < bodyLength) { var code = charCodeAt.call(body, position); // tab | space | comma | BOM if (code === 9 || code === 32 || code === 44 || code === 0xfeff) { ++p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function positionAfterWhitespace(body, startPosition) {\n var bodyLength = body.length;\n var position = startPosition;\n while (position < bodyLength) {\n var code = charCodeAt.call(body, position);\n // Skip Ignored\n if (\n // BOM\n code === 0xFEFF ||\n // White Space\n code === 0x0009 |...
[ "0.69044465", "0.67852926", "0.64861745", "0.64140433", "0.6413281", "0.64088786", "0.64088786", "0.64088786", "0.64088786", "0.64088786", "0.64088786", "0.64088786", "0.64088786", "0.64088786", "0.6317821", "0.6317821", "0.6317821", "0.6317821", "0.6317821", "0.63150394", "0...
0.6285895
26
Reads a comment token from the source file. [\u0009\u0020\uFFFF]
function readComment(source, start, line, col, prev) { var body = source.body; var code; var position = start; do { code = charCodeAt.call(body, ++position); } while (code !== null && ( // SourceCharacter but not LineTerminator code > 0x001f || code === 0x0009)); return new Tok(TokenKind.COMMENT, st...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function readComment(source, start, line, col, prev) {\n var body = source.body;\n var code;\n var position = start;\n\n do {\n code = body.charCodeAt(++position);\n } while (!isNaN(code) && ( // SourceCharacter but not LineTerminator\n code > 0x001f || code === 0x0009));\n\n return new _ast_mjs__WEBPACK...
[ "0.78089947", "0.7801608", "0.7700707", "0.76950777", "0.76794", "0.76794", "0.7574489", "0.7574489", "0.7574489", "0.7533291", "0.75172836", "0.7504664", "0.7504664", "0.7504664", "0.7504664", "0.7504664", "0.7504664", "0.7502775", "0.7501982", "0.7500591", "0.74732065", "...
0.7485389
21
Reads a number token from the source file, either a float or an int depending on whether a decimal point appears. Int: ?(0|[19][09]) Float: ?(0|[19][09])(\.[09]+)?((E|e)(+|)?[09]+)?
function readNumber(source, start, firstCode, line, col, prev) { var body = source.body; var code = firstCode; var position = start; var isFloat = false; if (code === 45) { // - code = charCodeAt.call(body, ++position); } if (code === 48) { // 0 code = charCodeAt.call(body, ++position); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function readNumber(source, start, firstCode, line, col, prev) {\n var body = source.body;\n var code = firstCode;\n var position = start;\n var isFloat = false;\n\n if (code === 45) {\n // -\n code = body.charCodeAt(++position);\n }\n\n if (code === 48) {\n // 0\n code = body.charCodeAt(++posit...
[ "0.7858292", "0.78392285", "0.7837828", "0.78289163", "0.77993715", "0.77993715", "0.7792152", "0.7792152", "0.7792152", "0.77856106", "0.77856106", "0.77700883", "0.7765103", "0.7756806", "0.7740502", "0.7720426", "0.7632626", "0.7632626", "0.7632626", "0.7632626", "0.76139"...
0.7640207
16
Returns the new position in the source after reading digits.
function readDigits(source, start, firstCode) { var body = source.body; var position = start; var code = firstCode; if (code >= 48 && code <= 57) { // 0 - 9 do { code = charCodeAt.call(body, ++position); } while (code >= 48 && code <= 57); // 0 - 9 return position; } throw (0, _err...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function readDigits(source, start, firstCode) {\n var body = source.body;\n var position = start;\n var code = firstCode;\n\n if (code >= 48 && code <= 57) {\n // 0 - 9\n do {\n code = body.charCodeAt(++position);\n } while (code >= 48 && code <= 57); // 0 - 9\n\n\...
[ "0.62889117", "0.6220681", "0.6220681", "0.6196409", "0.6166372", "0.6166372", "0.6148771", "0.61461264", "0.6117102", "0.6117102", "0.60756713", "0.60660464", "0.60437703", "0.60437703", "0.60233366", "0.60233366", "0.60233366", "0.60233366", "0.60049325", "0.6004479", "0.60...
0.59675986
23
Reads a block string token from the source file. """("?"?(\\"""|\\(?!=""")|[^"\\]))"""
function readBlockString(source, start, line, col, prev) { var body = source.body; var position = start + 3; var chunkStart = position; var code = 0; var rawValue = ''; while (position < body.length && (code = charCodeAt.call(body, position)) !== null) { // Closing Triple-Quote (""") if (code === 3...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function readBlockString(source, start, line, col, prev, lexer) {\n var body = source.body;\n var position = start + 3;\n var chunkStart = position;\n var code = 0;\n var rawValue = '';\n\n while (position < body.length && !isNaN(code = body.charCodeAt(position))) {\n // Closing Triple-Quote (\"\"\")\n ...
[ "0.7413868", "0.7413714", "0.7389528", "0.7389528", "0.73712134", "0.73380107", "0.73321456", "0.73238456", "0.73238456", "0.73238456", "0.7308271", "0.7291182", "0.72845966", "0.72845966", "0.72845966", "0.72845966", "0.72692126", "0.72692126", "0.7232332", "0.72266805", "0....
0.7335749
6
Converts four hexadecimal chars to the integer that the string represents. For example, uniCharCode('0','0','0','f') will return 15, and uniCharCode('0','0','f','f') returns 255. Returns a negative number on error, if a char was invalid. This is implemented by noting that char2hex() returns 1 on error, which means the ...
function uniCharCode(a, b, c, d) { return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n }", "function uniCharCode(a, b, c, d) {\n\t return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n\t}", "function uniCharCode(a, b, c, d) {\n\t return char2hex...
[ "0.71255636", "0.7064355", "0.7064355", "0.7064355", "0.62248033", "0.6153411", "0.61170715", "0.61115825", "0.5923352", "0.5911279", "0.5911279", "0.5911279", "0.5911279", "0.5911279", "0.5911279", "0.5911279", "0.5911279", "0.5911279", "0.5911279", "0.5911279", "0.5911279",...
0.7169786
21
Converts a hex character to its integer value. '0' becomes 0, '9' becomes 9 'A' becomes 10, 'F' becomes 15 'a' becomes 10, 'f' becomes 15 Returns 1 on error.
function char2hex(a) { return a >= 48 && a <= 57 ? a - 48 // 0-9 : a >= 65 && a <= 70 ? a - 55 // A-F : a >= 97 && a <= 102 ? a - 87 // a-f : -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hexstr2int(str)\n{\n\tvar i = 0;\n\tif (is_hexdigit(str)==true) i = parseInt(str, [16]);\n\treturn i;\n}", "function hexadecimalToInteger(string) {\n const DIGITS = {1:1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9,\n a: 10, b: 11, c: 12, d: 13, e: 14, f: 15 };\n\n string = string.toLowerCase();...
[ "0.750808", "0.722858", "0.71754754", "0.7169715", "0.70847976", "0.69943583", "0.6982219", "0.6911709", "0.6891876", "0.6803725", "0.67284787", "0.67044544", "0.669964", "0.669964", "0.669964", "0.669964", "0.669964", "0.669964", "0.669964", "0.669964", "0.669964", "0.6699...
0.6586051
73
Reads an alphanumeric + underscore name from the source. [_AZaz][_09AZaz]
function readName(source, start, line, col, prev) { var body = source.body; var bodyLength = body.length; var position = start + 1; var code = 0; while (position !== bodyLength && (code = charCodeAt.call(body, position)) !== null && (code === 95 || // _ code >= 48 && code <= 57 || // 0-9 code >= 65 && co...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tryReadVariableName(input, index) {\t\n\t/* Need to start with a letter or underscore. */\n\tif (!/[A-Za-z_]/.test(input.charAt(index))) return null;\n\n\t/* Keep reading characters while it's possible to do so. */\t\n\tvar result = \"\";\n\twhile (/[A-Za-z_0-9]/.test(input.charAt(index))) {\n\t\tresult +...
[ "0.69242716", "0.69093364", "0.6829715", "0.6829715", "0.6829715", "0.68044996", "0.6583544", "0.6545397", "0.6524183", "0.6524183", "0.6473978", "0.64677435", "0.6454978", "0.64251363", "0.64251363", "0.64251363", "0.63683015", "0.63683015", "0.63683015", "0.63683015", "0.63...
0.6331537
22
Copyright (c) 2015present, Facebook, Inc. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree. strict Represents a location in a Source. Takes a Source and a UTF8 character offset, and returns the corresponding line and column as a SourceLocation.
function getLocation(source, position) { var lineRegexp = /\r\n|[\n\r]/g; var line = 1; var column = position + 1; var match; while ((match = lineRegexp.exec(source.body)) && match.index < position) { line += 1; column = position + 1 - (match.index + match[0].length); } return { line: line, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getLocation(source, position) {\n\t var lineRegexp = /\\r\\n|[\\n\\r]/g;\n\t var line = 1;\n\t var column = position + 1;\n\t var match = void 0;\n\t while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n\t line += 1;\n\t column = position + 1 - (match.index + match[0].len...
[ "0.6382335", "0.6382335", "0.63726586", "0.63726586", "0.63726586", "0.63726586", "0.63726586", "0.63726586", "0.63726586", "0.63726586", "0.63726586", "0.63726586", "0.63726586", "0.63627046", "0.6362423", "0.634063", "0.6268909", "0.6105974", "0.6105974", "0.6105974", "0.59...
0.6265469
31
Converts a name lex token into a name parse node.
function parseName(lexer) { var token = expect(lexer, _lexer.TokenKind.NAME); return { kind: _kinds.Kind.NAME, value: token.value, loc: loc(lexer, token) }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseName() {\n const token = this.expectToken(TokenKind.NAME);\n return this.node(token, {\n kind: Kind.NAME,\n value: token.value,\n });\n }", "function parseName(lexer) {\n\t var token = expect(lexer, _lexer.TokenKind.NAME);\n\t return {\n\t kind: _kinds.NAME,\n\t value: token.valu...
[ "0.78040475", "0.7478694", "0.7478694", "0.74547267", "0.74547267", "0.74547267", "0.74547267", "0.74547267", "0.74547267", "0.7436509", "0.7434923", "0.7361506", "0.7329967", "0.7329967", "0.7211023", "0.71690416", "0.70296836", "0.5992738", "0.5884825", "0.5857028", "0.5760...
0.74510324
13
Implements the parsing rules in the Document section. Document : Definition+
function parseDocument(lexer) { var start = lexer.token; return { kind: _kinds.Kind.DOCUMENT, definitions: many(lexer, _lexer.TokenKind.SOF, parseDefinition, _lexer.TokenKind.EOF), loc: loc(lexer, start) }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseDocument() {\n return this.node(this._lexer.token, {\n kind: Kind.DOCUMENT,\n definitions: this.many(\n TokenKind.SOF,\n this.parseDefinition,\n TokenKind.EOF,\n ),\n });\n }", "constructor(schema, rules) {\n this.schema = schema;\n this.rules = rules;\n t...
[ "0.62960064", "0.5888885", "0.5772888", "0.5736046", "0.56977725", "0.56977725", "0.568532", "0.5638602", "0.5627307", "0.56254566", "0.5625318", "0.5585372", "0.55778307", "0.55778307", "0.55778307", "0.55778307", "0.5551567", "0.5545718", "0.5545718", "0.5545718", "0.554571...
0.57425183
3
Definition : ExecutableDefinition TypeSystemDefinition TypeSystemExtension
function parseDefinition(lexer) { if (peek(lexer, _lexer.TokenKind.NAME)) { switch (lexer.token.value) { case 'query': case 'mutation': case 'subscription': case 'fragment': return parseExecutableDefinition(lexer); case 'schema': case 'scalar': case 'type': ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseDefinition(lexer) {\n if (peek(lexer, TokenKind.NAME)) {\n switch (lexer.token.value) {\n case 'query':\n case 'mutation':\n case 'subscription':\n case 'fragment':\n return parseExecutableDefinition(lexer);\n\n case 'schema':\n case 'scalar':\n case 'typ...
[ "0.5873064", "0.5628583", "0.5588968", "0.5587208", "0.55546975", "0.5547226", "0.5547226", "0.5547226", "0.5547226", "0.5547226", "0.5547226", "0.55428934", "0.5521188", "0.5505745", "0.5497905", "0.54487175", "0.54487175", "0.54337996", "0.542171", "0.5388335", "0.5388335",...
0.58387035
1
ExecutableDefinition : OperationDefinition FragmentDefinition
function parseExecutableDefinition(lexer) { if (peek(lexer, _lexer.TokenKind.NAME)) { switch (lexer.token.value) { case 'query': case 'mutation': case 'subscription': return parseOperationDefinition(lexer); case 'fragment': return parseFragmentDefinition(lexer); } } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseExecutableDefinition(lexer) {\n if (peek(lexer, TokenKind.NAME)) {\n switch (lexer.token.value) {\n case 'query':\n case 'mutation':\n case 'subscription':\n return parseOperationDefinition(lexer);\n\n case 'fragment':\n return parseFragmentDefinition(lexer);\n ...
[ "0.71995175", "0.71126485", "0.7008891", "0.68877995", "0.6758143", "0.6758143", "0.6752346", "0.5846321", "0.5846321", "0.5846321", "0.5681944", "0.5605237", "0.5605237", "0.53706014", "0.52786595", "0.52525294", "0.51921415", "0.50820076", "0.5052637", "0.50092316", "0.4922...
0.7156642
5
Implements the parsing rules in the Operations section. OperationDefinition : SelectionSet OperationType Name? VariableDefinitions? Directives? SelectionSet
function parseOperationDefinition(lexer) { var start = lexer.token; if (peek(lexer, _lexer.TokenKind.BRACE_L)) { return { kind: _kinds.Kind.OPERATION_DEFINITION, operation: 'query', name: undefined, variableDefinitions: [], directives: [], selectionSet: parseSelectionSet(lex...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseOperationDefinition() {\n const start = this._lexer.token;\n\n if (this.peek(TokenKind.BRACE_L)) {\n return this.node(start, {\n kind: Kind.OPERATION_DEFINITION,\n operation: OperationTypeNode.QUERY,\n name: undefined,\n variableDefinitions: [],\n directives: [],\...
[ "0.7476916", "0.69623595", "0.69474083", "0.69474083", "0.69474083", "0.69474083", "0.69104946", "0.6903744", "0.6859207", "0.6859207", "0.6859207", "0.6859207", "0.6859207", "0.6859207", "0.684353", "0.6835592", "0.6835592", "0.6823561", "0.67332864", "0.6572285", "0.6567994...
0.69581324
2
OperationType : one of query mutation subscription
function parseOperationType(lexer) { var operationToken = expect(lexer, _lexer.TokenKind.NAME); switch (operationToken.value) { case 'query': return 'query'; case 'mutation': return 'mutation'; case 'subscription': return 'subscription'; } throw unexpected(lexer, operationToken...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseOperationType() {\n const operationToken = this.expectToken(TokenKind.NAME);\n\n switch (operationToken.value) {\n case 'query':\n return OperationTypeNode.QUERY;\n\n case 'mutation':\n return OperationTypeNode.MUTATION;\n\n case 'subscription':\n return OperationType...
[ "0.6767044", "0.6696435", "0.6696435", "0.6696435", "0.6696435", "0.6696435", "0.6696435", "0.66750133", "0.6667136", "0.66366386", "0.66044563", "0.66044563", "0.66044563", "0.66044563", "0.6600803", "0.64355683", "0.64009553", "0.63313407", "0.63313407", "0.625439", "0.6230...
0.65488625
15
VariableDefinitions : ( VariableDefinition+ )
function parseVariableDefinitions(lexer) { return peek(lexer, _lexer.TokenKind.PAREN_L) ? many(lexer, _lexer.TokenKind.PAREN_L, parseVariableDefinition, _lexer.TokenKind.PAREN_R) : []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseVariableDefinitions() {\n return this.optionalMany(\n TokenKind.PAREN_L,\n this.parseVariableDefinition,\n TokenKind.PAREN_R,\n );\n }", "function parseVariableDefinitions(lexer$$1) {\n return peek(lexer$$1, lexer.TokenKind.PAREN_L) ? many(lexer$$1, lexer.TokenKind.PAREN_L, parseVaria...
[ "0.7294105", "0.7109119", "0.7006673", "0.7006673", "0.6995079", "0.68373275", "0.6801801", "0.6702027", "0.66963965", "0.669627", "0.669627", "0.66889995", "0.6667154", "0.66397494", "0.66358685", "0.6611495", "0.6594916", "0.6592061", "0.6567994", "0.6567994", "0.6567994", ...
0.69709283
14
VariableDefinition : Variable : Type DefaultValue? Directives[Const]?
function parseVariableDefinition(lexer) { var start = lexer.token; if (lexer.options.experimentalVariableDefinitionDirectives) { return { kind: _kinds.Kind.VARIABLE_DEFINITION, variable: parseVariable(lexer), type: (expect(lexer, _lexer.TokenKind.COLON), parseTypeReference(lexer)), defa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseVariableDefinition() {\n return this.node(this._lexer.token, {\n kind: Kind.VARIABLE_DEFINITION,\n variable: this.parseVariable(),\n type: (this.expectToken(TokenKind.COLON), this.parseTypeReference()),\n defaultValue: this.expectOptionalToken(TokenKind.EQUALS)\n ? this.parseCons...
[ "0.7363293", "0.65698636", "0.65311277", "0.65280056", "0.65061957", "0.65061957", "0.65061957", "0.65061957", "0.64891255", "0.64891255", "0.64891255", "0.64891255", "0.64891255", "0.64891255", "0.63214314", "0.6296092", "0.6293347", "0.62812454", "0.6254818", "0.6252298", "...
0.63012534
15
Variable : $ Name
function parseVariable(lexer) { var start = lexer.token; expect(lexer, _lexer.TokenKind.DOLLAR); return { kind: _kinds.Kind.VARIABLE, name: parseName(lexer), loc: loc(lexer, start) }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createVariable() {\n var id = nextVariableId++;\n var name = '$V';\n\n do {\n name += variableTokens[id % variableTokensLength];\n id = ~~(id / variableTokensLength);\n } while (id !== 0);\n\n return name;\n }", "function makeVar(root, name) {\n name = name.toLowerCase().rep...
[ "0.6945701", "0.6884038", "0.6858726", "0.6830075", "0.6722742", "0.669976", "0.66969347", "0.6647729", "0.6564104", "0.65095234", "0.6448056", "0.6433639", "0.6406728", "0.6377274", "0.63718086", "0.63441086", "0.6315028", "0.6285289", "0.62734824", "0.62667507", "0.62561864...
0.0
-1
Selection : Field FragmentSpread InlineFragment
function parseSelection(lexer) { return peek(lexer, _lexer.TokenKind.SPREAD) ? parseFragment(lexer) : parseField(lexer); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseSelection() {\n return this.peek(TokenKind.SPREAD)\n ? this.parseFragment()\n : this.parseField();\n }", "function parseSelection(lexer) {\n return peek(lexer, TokenKind.SPREAD) ? parseFragment(lexer) : parseField(lexer);\n}", "function parseSelection(lexer) {\n\t return peek(lexer, _lexer...
[ "0.69309527", "0.6277677", "0.6232537", "0.6232537", "0.61205184", "0.6051091", "0.6038953", "0.6020248", "0.5971852", "0.5954627", "0.5865732", "0.58636636", "0.58636636", "0.57569814", "0.5751134", "0.5751134", "0.57143056", "0.5691664", "0.5689914", "0.5689914", "0.5689914...
0.622574
12
Field : Alias? Name Arguments? Directives? SelectionSet? Alias : Name :
function parseField(lexer) { var start = lexer.token; var nameOrAlias = parseName(lexer); var alias; var name; if (skip(lexer, _lexer.TokenKind.COLON)) { alias = nameOrAlias; name = parseName(lexer); } else { name = nameOrAlias; } return { kind: _kinds.Kind.FIELD, alias: alias, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function $Alias() {\n\t\treturn Field.apply(this, arguments);\n\t}", "field (field, alias = null, options = {}) {\n alias = alias ? this._sanitizeFieldAlias(alias) : alias;\n field = this._sanitizeField(field);\n\n // if field-alias combo already present then don't add\n let existingField = t...
[ "0.67461413", "0.5861788", "0.583103", "0.5825715", "0.57540786", "0.5662482", "0.5464285", "0.54340297", "0.5398831", "0.53741914", "0.53367126", "0.53101426", "0.5289533", "0.5271213", "0.5269528", "0.5256967", "0.5246766", "0.5243333", "0.5239582", "0.52185047", "0.5181147...
0.49982423
47
Arguments[Const] : ( Argument[?Const]+ )
function parseArguments(lexer, isConst) { var item = isConst ? parseConstArgument : parseArgument; return peek(lexer, _lexer.TokenKind.PAREN_L) ? many(lexer, _lexer.TokenKind.PAREN_L, item, _lexer.TokenKind.PAREN_R) : []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseArguments(lexer$$1, isConst) {\n var item = isConst ? parseConstArgument : parseArgument;\n return peek(lexer$$1, lexer.TokenKind.PAREN_L) ? many(lexer$$1, lexer.TokenKind.PAREN_L, item, lexer.TokenKind.PAREN_R) : [];\n}", "function parseArguments(lexer, isConst) {\n var item = isConst ? parseCo...
[ "0.73318607", "0.70604515", "0.6964395", "0.68930596", "0.6815486", "0.67990893", "0.67990893", "0.67933124", "0.6222683", "0.6222683", "0.6155149", "0.6151707", "0.6061678", "0.60596824", "0.60206187", "0.6001688", "0.59549505", "0.5896403", "0.5852592", "0.5852592", "0.5852...
0.7011207
6
Argument[Const] : Name : Value[?Const]
function parseArgument(lexer) { var start = lexer.token; return { kind: _kinds.Kind.ARGUMENT, name: parseName(lexer), value: (expect(lexer, _lexer.TokenKind.COLON), parseValueLiteral(lexer, false)), loc: loc(lexer, start) }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseArgument(isConst = false) {\n const start = this._lexer.token;\n const name = this.parseName();\n this.expectToken(TokenKind.COLON);\n return this.node(start, {\n kind: Kind.ARGUMENT,\n name,\n value: this.parseValueLiteral(isConst),\n });\n }", "function NamedArgument(nameArg...
[ "0.6395982", "0.5930205", "0.5851479", "0.58199084", "0.58199084", "0.5765345", "0.5699502", "0.5660462", "0.56136733", "0.5590907", "0.5549947", "0.5533223", "0.5533223", "0.5533223", "0.5533223", "0.5517433", "0.55103564", "0.55008775", "0.55008775", "0.5491392", "0.5477752...
0.0
-1
Implements the parsing rules in the Fragments section. Corresponds to both FragmentSpread and InlineFragment in the spec. FragmentSpread : ... FragmentName Directives? InlineFragment : ... TypeCondition? Directives? SelectionSet
function parseFragment(lexer) { var start = lexer.token; expect(lexer, _lexer.TokenKind.SPREAD); if (peek(lexer, _lexer.TokenKind.NAME) && lexer.token.value !== 'on') { return { kind: _kinds.Kind.FRAGMENT_SPREAD, name: parseFragmentName(lexer), directives: parseDirectives(lexer, false), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseFragment() {\n const start = this._lexer.token;\n this.expectToken(TokenKind.SPREAD);\n const hasTypeCondition = this.expectOptionalKeyword('on');\n\n if (!hasTypeCondition && this.peek(TokenKind.NAME)) {\n return this.node(start, {\n kind: Kind.FRAGMENT_SPREAD,\n name: this.par...
[ "0.7205319", "0.71663576", "0.6913211", "0.69115084", "0.69115084", "0.690976", "0.6887504", "0.6878689", "0.6876424", "0.68613744", "0.68613744", "0.68613744", "0.68613744", "0.6858702", "0.6796408", "0.67817134", "0.67817134", "0.6726783", "0.6709635", "0.66997665", "0.6699...
0.65999293
36
FragmentDefinition : fragment FragmentName on TypeCondition Directives? SelectionSet TypeCondition : NamedType
function parseFragmentDefinition(lexer) { var start = lexer.token; expectKeyword(lexer, 'fragment'); // Experimental support for defining variables within fragments changes // the grammar of FragmentDefinition: // - fragment FragmentName VariableDefinitions? on TypeCondition Directives? SelectionSet if (le...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseFragment() {\n const start = this._lexer.token;\n this.expectToken(TokenKind.SPREAD);\n const hasTypeCondition = this.expectOptionalKeyword('on');\n\n if (!hasTypeCondition && this.peek(TokenKind.NAME)) {\n return this.node(start, {\n kind: Kind.FRAGMENT_SPREAD,\n name: this.par...
[ "0.7478656", "0.74603605", "0.7071043", "0.70084333", "0.70084333", "0.70084333", "0.70084333", "0.70084333", "0.70084333", "0.69281197", "0.6904951", "0.6901346", "0.6901346", "0.6901346", "0.6901346", "0.6859692", "0.68549776", "0.6853555", "0.6853555", "0.685011", "0.68494...
0.6888519
15
FragmentName : Name but not `on`
function parseFragmentName(lexer) { if (lexer.token.value === 'on') { throw unexpected(lexer); } return parseName(lexer); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseFragmentName() {\n if (this._lexer.token.value === 'on') {\n throw this.unexpected();\n }\n\n return this.parseName();\n }", "function parseFragmentName(parser) {\n\t if (parser.token.value === 'on') {\n\t throw unexpected(parser);\n\t }\n\t return parseName(parser);\n\t}", "function ...
[ "0.7955697", "0.7753926", "0.772816", "0.772816", "0.76217604", "0.76182735", "0.76182735", "0.76182735", "0.76182735", "0.76182735", "0.76182735", "0.76182735", "0.76182735", "0.76182735", "0.76182735", "0.7442255", "0.66166544", "0.6572035", "0.6560661", "0.6560386", "0.654...
0.7585373
20
Implements the parsing rules in the Values section. Value[Const] : [~Const] Variable IntValue FloatValue StringValue BooleanValue NullValue EnumValue ListValue[?Const] ObjectValue[?Const] BooleanValue : one of `true` `false` NullValue : `null` EnumValue : Name but not `true`, `false` or `null`
function parseValueLiteral(lexer, isConst) { var token = lexer.token; switch (token.kind) { case _lexer.TokenKind.BRACKET_L: return parseList(lexer, isConst); case _lexer.TokenKind.BRACE_L: return parseObject(lexer, isConst); case _lexer.TokenKind.INT: lexer.advance(); return ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseValueLiteral(isConst) {\n const token = this._lexer.token;\n\n switch (token.kind) {\n case TokenKind.BRACKET_L:\n return this.parseList(isConst);\n\n case TokenKind.BRACE_L:\n return this.parseObject(isConst);\n\n case TokenKind.INT:\n this._lexer.advance();\n\n ...
[ "0.7055661", "0.66836554", "0.66825485", "0.66568327", "0.66568327", "0.66568327", "0.66568327", "0.66568327", "0.66568327", "0.6649536", "0.6649536", "0.6649536", "0.6649536", "0.6567846", "0.6564514", "0.6561201", "0.6561201", "0.65557545", "0.65545034", "0.64891374", "0.64...
0.66321737
13
ListValue[Const] : [ ] [ Value[?Const]+ ]
function parseList(lexer, isConst) { var start = lexer.token; var item = isConst ? parseConstValue : parseValueValue; return { kind: _kinds.Kind.LIST, values: any(lexer, _lexer.TokenKind.BRACKET_L, item, _lexer.TokenKind.BRACKET_R), loc: loc(lexer, start) }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseList(isConst) {\n const item = () => this.parseValueLiteral(isConst);\n\n return this.node(this._lexer.token, {\n kind: Kind.LIST,\n values: this.any(TokenKind.BRACKET_L, item, TokenKind.BRACKET_R),\n });\n }", "function parseList(lexer$$1, isConst) {\n var start = lexer$$1.token;\n va...
[ "0.68530875", "0.67082024", "0.6670494", "0.661275", "0.661275", "0.66044474", "0.66044474", "0.66044474", "0.66044474", "0.66044474", "0.66044474", "0.65464705", "0.6488943", "0.6437807", "0.64054286", "0.64054286", "0.6404618", "0.6157263", "0.5797986", "0.5725365", "0.5670...
0.663753
7
ObjectField[Const] : Name : Value[?Const]
function parseObjectField(lexer, isConst) { var start = lexer.token; return { kind: _kinds.Kind.OBJECT_FIELD, name: parseName(lexer), value: (expect(lexer, _lexer.TokenKind.COLON), parseValueLiteral(lexer, isConst)), loc: loc(lexer, start) }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseObjectField(lexer$$1, isConst) {\n var start = lexer$$1.token;\n return {\n kind: kinds.OBJECT_FIELD,\n name: parseName(lexer$$1),\n value: (expect(lexer$$1, lexer.TokenKind.COLON), parseValueLiteral(lexer$$1, isConst)),\n loc: loc(lexer$$1, start)\n };\n}", "function parseObjectFiel...
[ "0.7566483", "0.74207675", "0.7412592", "0.7334251", "0.7334251", "0.73163164", "0.73163164", "0.73163164", "0.73163164", "0.73163164", "0.73163164", "0.7045878", "0.7023354", "0.70039093", "0.6991812", "0.6977889", "0.6977889", "0.59030527", "0.5814423", "0.5783798", "0.5783...
0.7317285
9
Implements the parsing rules in the Directives section. Directives[Const] : Directive[?Const]+
function parseDirectives(lexer, isConst) { var directives = []; while (peek(lexer, _lexer.TokenKind.AT)) { directives.push(parseDirective(lexer, isConst)); } return directives; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseDirectives(lexer$$1, isConst) {\n var directives = [];\n while (peek(lexer$$1, lexer.TokenKind.AT)) {\n directives.push(parseDirective(lexer$$1, isConst));\n }\n return directives;\n}", "function parseDirectives(lexer, isConst) {\n\t var directives = [];\n\t while (peek(lexer, _lexer.Token...
[ "0.7255498", "0.72354496", "0.7199441", "0.7184046", "0.7184046", "0.7184046", "0.7184046", "0.70306146", "0.6945071", "0.6945071", "0.6930557", "0.6799212", "0.6365018", "0.56563574", "0.5529977", "0.5496353", "0.5489037", "0.5366485", "0.5348178", "0.5348178", "0.5347175", ...
0.71775305
7
Implements the parsing rules in the Types section. Type : NamedType ListType NonNullType
function parseTypeReference(lexer) { var start = lexer.token; var type; if (skip(lexer, _lexer.TokenKind.BRACKET_L)) { type = parseTypeReference(lexer); expect(lexer, _lexer.TokenKind.BRACKET_R); type = { kind: _kinds.Kind.LIST_TYPE, type: type, loc: loc(lexer, start) }; } els...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseType(parser) {\n\t var start = parser.token.start;\n\t var type = undefined;\n\t if (skip(parser, _lexer.TokenKind.BRACKET_L)) {\n\t type = parseType(parser);\n\t expect(parser, _lexer.TokenKind.BRACKET_R);\n\t type = {\n\t kind: _kinds.LIST_TYPE,\n\t type: type,\n\t loc: l...
[ "0.67047906", "0.65751076", "0.64174753", "0.62971085", "0.622324", "0.6208432", "0.6162876", "0.6067359", "0.6064202", "0.6039736", "0.6039736", "0.60260767", "0.60260767", "0.60260767", "0.60260767", "0.60260767", "0.60260767", "0.6012136", "0.6010879", "0.59628564", "0.596...
0.5816551
26
Implements the parsing rules in the Type Definition section. TypeSystemDefinition : SchemaDefinition TypeDefinition DirectiveDefinition TypeDefinition : ScalarTypeDefinition ObjectTypeDefinition InterfaceTypeDefinition UnionTypeDefinition EnumTypeDefinition InputObjectTypeDefinition
function parseTypeSystemDefinition(lexer) { // Many definitions begin with a description and require a lookahead. var keywordToken = peekDescription(lexer) ? lexer.lookahead() : lexer.token; if (keywordToken.kind === _lexer.TokenKind.NAME) { switch (keywordToken.value) { case 'schema': return p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseTypeSystemDefinition(lexer) {\n if (peek(lexer, _lexer.TokenKind.NAME)) {\n switch (lexer.token.value) {\n case 'schema':\n return parseSchemaDefinition(lexer);\n case 'scalar':\n return parseScalarTypeDefinition(lexer);\n case 'type':\n return parseObjectTypeD...
[ "0.76519895", "0.76519895", "0.76519895", "0.76519895", "0.76519895", "0.76519895", "0.7650947", "0.7428804", "0.74210054", "0.74210054", "0.74210054", "0.74210054", "0.7338064", "0.7269386", "0.72518307", "0.7246204", "0.7246204", "0.7239923", "0.63081646", "0.61394525", "0....
0.740793
12
OperationTypeDefinition : OperationType : NamedType
function parseOperationTypeDefinition(lexer) { var start = lexer.token; var operation = parseOperationType(lexer); expect(lexer, _lexer.TokenKind.COLON); var type = parseNamedType(lexer); return { kind: _kinds.Kind.OPERATION_TYPE_DEFINITION, operation: operation, type: type, loc: loc(lexer, st...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseOperationTypeDefinition() {\n const start = this._lexer.token;\n const operation = this.parseOperationType();\n this.expectToken(TokenKind.COLON);\n const type = this.parseNamedType();\n return this.node(start, {\n kind: Kind.OPERATION_TYPE_DEFINITION,\n operation,\n type,\n }...
[ "0.83943063", "0.80674225", "0.79171854", "0.77349615", "0.76647806", "0.76647806", "0.7528038", "0.7520787", "0.6559186", "0.65340006", "0.6188843", "0.6184098", "0.6146576", "0.612933", "0.612933", "0.612933", "0.612933", "0.60575813", "0.60575813", "0.60575813", "0.6057581...
0.7892767
7
ScalarTypeDefinition : Description? scalar Name Directives[Const]?
function parseScalarTypeDefinition(lexer) { var start = lexer.token; var description = parseDescription(lexer); expectKeyword(lexer, 'scalar'); var name = parseName(lexer); var directives = parseDirectives(lexer, true); return { kind: _kinds.Kind.SCALAR_TYPE_DEFINITION, description: description, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseScalarTypeDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('scalar');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n return this.node(start, {\n kind: Kind.SCALAR_TYPE_DEFINITION,\...
[ "0.84124744", "0.7994362", "0.7977784", "0.79746634", "0.7907524", "0.7907524", "0.7907524", "0.7907524", "0.7907524", "0.7907524", "0.78954875", "0.78934467", "0.78934467", "0.78929204", "0.7877458", "0.77453184", "0.76672184", "0.6365995", "0.62724894", "0.6269948", "0.6266...
0.7940587
8
ObjectTypeDefinition : Description? type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition?
function parseObjectTypeDefinition(lexer) { var start = lexer.token; var description = parseDescription(lexer); expectKeyword(lexer, 'type'); var name = parseName(lexer); var interfaces = parseImplementsInterfaces(lexer); var directives = parseDirectives(lexer, true); var fields = parseFieldsDefinition(le...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseObjectTypeDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('type');\n const name = this.parseName();\n const interfaces = this.parseImplementsInterfaces();\n const directives = this.parseConstDirectives();\n const fields...
[ "0.8001638", "0.7670163", "0.76303816", "0.7565307", "0.7563719", "0.7562424", "0.7562424", "0.74665797", "0.67552143", "0.65202653", "0.64482945", "0.64300156", "0.64300156", "0.64300156", "0.64300156", "0.64300156", "0.62473637", "0.6245989", "0.6245651", "0.6245651", "0.62...
0.76303434
7
ImplementsInterfaces : implements `&`? NamedType ImplementsInterfaces & NamedType
function parseImplementsInterfaces(lexer) { var types = []; if (lexer.token.value === 'implements') { lexer.advance(); // Optional leading ampersand skip(lexer, _lexer.TokenKind.AMP); do { types.push(parseNamedType(lexer)); } while (skip(lexer, _lexer.TokenKind.AMP) || // Legacy support for...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseImplementsInterfaces(lexer) {\n var types = [];\n\n if (expectOptionalKeyword(lexer, 'implements')) {\n // Optional leading ampersand\n expectOptionalToken(lexer, TokenKind.AMP);\n\n do {\n types.push(parseNamedType(lexer));\n } while (expectOptionalToken(lexer, TokenKind.AMP) || /...
[ "0.7547813", "0.7545547", "0.7521685", "0.7521685", "0.7495221", "0.7495221", "0.7495221", "0.7495221", "0.7495221", "0.7495221", "0.74411047", "0.7431042", "0.7431042", "0.7431042", "0.7431042", "0.7387536", "0.73074704", "0.73074704", "0.7220446", "0.7212402", "0.7107219", ...
0.7448668
10
FieldDefinition : Description? Name ArgumentsDefinition? : Type Directives[Const]?
function parseFieldDefinition(lexer) { var start = lexer.token; var description = parseDescription(lexer); var name = parseName(lexer); var args = parseArgumentDefs(lexer); expect(lexer, _lexer.TokenKind.COLON); var type = parseTypeReference(lexer); var directives = parseDirectives(lexer, true); return ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseFieldDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n const name = this.parseName();\n const args = this.parseArgumentDefs();\n this.expectToken(TokenKind.COLON);\n const type = this.parseTypeReference();\n const directives = this.parseCon...
[ "0.7748093", "0.70829904", "0.6906932", "0.68805027", "0.6879352", "0.6879352", "0.6879352", "0.6879352", "0.6879352", "0.6879352", "0.68410045", "0.68111277", "0.67675704", "0.67675704", "0.6679028", "0.6547652", "0.6508213", "0.64957374", "0.64789903", "0.6189179", "0.60534...
0.6935052
6
ArgumentsDefinition : ( InputValueDefinition+ )
function parseArgumentDefs(lexer) { if (!peek(lexer, _lexer.TokenKind.PAREN_L)) { return []; } return many(lexer, _lexer.TokenKind.PAREN_L, parseInputValueDef, _lexer.TokenKind.PAREN_R); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseArgumentDefs() {\n return this.optionalMany(\n TokenKind.PAREN_L,\n this.parseInputValueDef,\n TokenKind.PAREN_R,\n );\n }", "function parseArgumentDefs(lexer$$1) {\n if (!peek(lexer$$1, lexer.TokenKind.PAREN_L)) {\n return [];\n }\n return many(lexer$$1, lexer.TokenKind.PAREN_L,...
[ "0.64581543", "0.6176695", "0.6175851", "0.6090139", "0.6090139", "0.6067658", "0.6067658", "0.59601176", "0.5928385", "0.5928385", "0.5928385", "0.5928385", "0.5928385", "0.5928385", "0.5928385", "0.5928385", "0.5928385", "0.5928385", "0.59281677", "0.58825344", "0.5831647",...
0.5894009
19
InputValueDefinition : Description? Name : Type DefaultValue? Directives[Const]?
function parseInputValueDef(lexer) { var start = lexer.token; var description = parseDescription(lexer); var name = parseName(lexer); expect(lexer, _lexer.TokenKind.COLON); var type = parseTypeReference(lexer); var defaultValue; if (skip(lexer, _lexer.TokenKind.EQUALS)) { defaultValue = parseConstVal...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseInputValueDef() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n const name = this.parseName();\n this.expectToken(TokenKind.COLON);\n const type = this.parseTypeReference();\n let defaultValue;\n\n if (this.expectOptionalToken(TokenKind.EQUALS)) {\n ...
[ "0.79227453", "0.7474389", "0.73625594", "0.73625594", "0.73625594", "0.73625594", "0.7342761", "0.72712636", "0.7251867", "0.7235011", "0.7235011", "0.7235011", "0.7235011", "0.7235011", "0.7235011", "0.72127914", "0.71586096", "0.71586096", "0.7051636", "0.6977883", "0.6934...
0.7365844
2
InterfaceTypeDefinition : Description? interface Name Directives[Const]? FieldsDefinition?
function parseInterfaceTypeDefinition(lexer) { var start = lexer.token; var description = parseDescription(lexer); expectKeyword(lexer, 'interface'); var name = parseName(lexer); var directives = parseDirectives(lexer, true); var fields = parseFieldsDefinition(lexer); return { kind: _kinds.Kind.INTERF...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseInterfaceTypeDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('interface');\n const name = this.parseName();\n const interfaces = this.parseImplementsInterfaces();\n const directives = this.parseConstDirectives();\n cons...
[ "0.7973073", "0.7704892", "0.7673024", "0.76692116", "0.7669019", "0.76654154", "0.76654154", "0.7483703", "0.6633259", "0.6581793", "0.6581793", "0.6468472", "0.64038366", "0.6336793", "0.5729618", "0.57230526", "0.57209885", "0.5717001", "0.5717001", "0.5700792", "0.5700792...
0.764558
11
UnionTypeDefinition : Description? union Name Directives[Const]? UnionMemberTypes?
function parseUnionTypeDefinition(lexer) { var start = lexer.token; var description = parseDescription(lexer); expectKeyword(lexer, 'union'); var name = parseName(lexer); var directives = parseDirectives(lexer, true); var types = parseUnionMemberTypes(lexer); return { kind: _kinds.Kind.UNION_TYPE_DEFI...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseUnionTypeDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('union');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const types = this.parseUnionMemberTypes();\n return this.node(star...
[ "0.8731564", "0.8291724", "0.82611036", "0.82416266", "0.82396096", "0.8236936", "0.8236936", "0.8088634", "0.80799925", "0.80799925", "0.80799925", "0.80799925", "0.80799925", "0.80799925", "0.7912688", "0.7779032", "0.77730244", "0.6834759", "0.6767398", "0.67394966", "0.67...
0.8259903
7
UnionMemberTypes : = `|`? NamedType UnionMemberTypes | NamedType
function parseUnionMemberTypes(lexer) { var types = []; if (skip(lexer, _lexer.TokenKind.EQUALS)) { // Optional leading pipe skip(lexer, _lexer.TokenKind.PIPE); do { types.push(parseNamedType(lexer)); } while (skip(lexer, _lexer.TokenKind.PIPE)); } return types; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseUnionMemberTypes(lexer) {\n var types = [];\n\n if (expectOptionalToken(lexer, TokenKind.EQUALS)) {\n // Optional leading pipe\n expectOptionalToken(lexer, TokenKind.PIPE);\n\n do {\n types.push(parseNamedType(lexer));\n } while (expectOptionalToken(lexer, TokenKind.PIPE));\n }\n\...
[ "0.8160076", "0.8105468", "0.80810785", "0.80810785", "0.80810785", "0.80810785", "0.8078582", "0.79971683", "0.79971683", "0.786316", "0.7599626", "0.7599626", "0.7599626", "0.7599626", "0.7587655", "0.7587655", "0.74873537", "0.7414662", "0.7348052", "0.7166815", "0.6751948...
0.80607855
7
EnumTypeDefinition : Description? enum Name Directives[Const]? EnumValuesDefinition?
function parseEnumTypeDefinition(lexer) { var start = lexer.token; var description = parseDescription(lexer); expectKeyword(lexer, 'enum'); var name = parseName(lexer); var directives = parseDirectives(lexer, true); var values = parseEnumValuesDefinition(lexer); return { kind: _kinds.Kind.ENUM_TYPE_DE...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseEnumTypeDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('enum');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const values = this.parseEnumValuesDefinition();\n return this.node(s...
[ "0.8461598", "0.7851613", "0.77735835", "0.77477807", "0.7662104", "0.76597327", "0.76573926", "0.76573926", "0.75868785", "0.7232849", "0.71988666", "0.71856594", "0.71856594", "0.71856594", "0.71856594", "0.71856594", "0.70768327", "0.70529515", "0.70491743", "0.704276", "0...
0.7709302
8
EnumValueDefinition : Description? EnumValue Directives[Const]? EnumValue : Name
function parseEnumValueDefinition(lexer) { var start = lexer.token; var description = parseDescription(lexer); var name = parseName(lexer); var directives = parseDirectives(lexer, true); return { kind: _kinds.Kind.ENUM_VALUE_DEFINITION, description: description, name: name, directives: directi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseEnumValueDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n const name = this.parseEnumValueName();\n const directives = this.parseConstDirectives();\n return this.node(start, {\n kind: Kind.ENUM_VALUE_DEFINITION,\n description,\n n...
[ "0.8741834", "0.8081175", "0.80596673", "0.7965319", "0.78878", "0.78844345", "0.78844345", "0.78844345", "0.78844345", "0.78844345", "0.78844345", "0.7841735", "0.78339535", "0.78277975", "0.78277975", "0.7777325", "0.7615425", "0.73300856", "0.701931", "0.662745", "0.655975...
0.8031719
7
InputObjectTypeDefinition : Description? input Name Directives[Const]? InputFieldsDefinition?
function parseInputObjectTypeDefinition(lexer) { var start = lexer.token; var description = parseDescription(lexer); expectKeyword(lexer, 'input'); var name = parseName(lexer); var directives = parseDirectives(lexer, true); var fields = parseInputFieldsDefinition(lexer); return { kind: _kinds.Kind.INP...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseInputObjectTypeDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('input');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const fields = this.parseInputFieldsDefinition();\n return th...
[ "0.84310955", "0.7931814", "0.7880839", "0.7752444", "0.7750537", "0.7747884", "0.7747884", "0.7724999", "0.7377299", "0.60488296", "0.6035411", "0.6009256", "0.60075295", "0.60063696", "0.60063696", "0.59779453", "0.58502877", "0.5840044", "0.5833568", "0.5828962", "0.582896...
0.7860475
7
TypeSystemExtension : SchemaExtension TypeExtension TypeExtension : ScalarTypeExtension ObjectTypeExtension InterfaceTypeExtension UnionTypeExtension EnumTypeExtension InputObjectTypeDefinition
function parseTypeSystemExtension(lexer) { var keywordToken = lexer.lookahead(); if (keywordToken.kind === _lexer.TokenKind.NAME) { switch (keywordToken.value) { case 'schema': return parseSchemaExtension(lexer); case 'scalar': return parseScalarTypeExtension(lexer); case 't...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseTypeSystemExtension(lexer) {\n var keywordToken = lexer.lookahead();\n\n if (keywordToken.kind === TokenKind.NAME) {\n switch (keywordToken.value) {\n case 'schema':\n return parseSchemaExtension(lexer);\n\n case 'scalar':\n return parseScalarTypeExtension(lexer);\n\n ...
[ "0.68252563", "0.6702732", "0.6685989", "0.6602507", "0.65869474", "0.65869474", "0.6580412", "0.6524879", "0.6524879", "0.65244114", "0.65244114", "0.6374235", "0.6336614", "0.6323752", "0.6314398", "0.63119304", "0.63119304", "0.63119304", "0.63119304", "0.63119304", "0.631...
0.67845553
1
ScalarTypeExtension : extend scalar Name Directives[Const]
function parseScalarTypeExtension(lexer) { var start = lexer.token; expectKeyword(lexer, 'extend'); expectKeyword(lexer, 'scalar'); var name = parseName(lexer); var directives = parseDirectives(lexer, true); if (directives.length === 0) { throw unexpected(lexer); } return { kind: _kinds.Kind.S...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseScalarTypeExtension() {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('scalar');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n\n if (directives.length === 0) {\n throw this.unexpected();\n }\n\n retur...
[ "0.7957774", "0.7645257", "0.76173556", "0.76173556", "0.76173556", "0.76173556", "0.7581831", "0.7552385", "0.74966514", "0.7496257", "0.74927706", "0.74927706", "0.5790059", "0.5632069", "0.5288938", "0.5278076", "0.51106924", "0.50701165", "0.50701165", "0.50671786", "0.50...
0.7608531
6
ObjectTypeExtension : extend type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition extend type Name ImplementsInterfaces? Directives[Const] extend type Name ImplementsInterfaces
function parseObjectTypeExtension(lexer) { var start = lexer.token; expectKeyword(lexer, 'extend'); expectKeyword(lexer, 'type'); var name = parseName(lexer); var interfaces = parseImplementsInterfaces(lexer); var directives = parseDirectives(lexer, true); var fields = parseFieldsDefinition(lexer); if ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseObjectTypeExtension() {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('type');\n const name = this.parseName();\n const interfaces = this.parseImplementsInterfaces();\n const directives = this.parseConstDirectives();\n const fields = this.parseFie...
[ "0.75061303", "0.72697264", "0.7229903", "0.7229903", "0.7229903", "0.7229903", "0.7227485", "0.7225752", "0.72245854", "0.72245854", "0.7170688", "0.7118077", "0.66244584", "0.64240116", "0.63902", "0.6380768", "0.6374907", "0.6374907", "0.6374907", "0.6374907", "0.63102484"...
0.7255819
2
InterfaceTypeExtension : extend interface Name Directives[Const]? FieldsDefinition extend interface Name Directives[Const]
function parseInterfaceTypeExtension(lexer) { var start = lexer.token; expectKeyword(lexer, 'extend'); expectKeyword(lexer, 'interface'); var name = parseName(lexer); var directives = parseDirectives(lexer, true); var fields = parseFieldsDefinition(lexer); if (directives.length === 0 && fields.length ===...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseInterfaceTypeExtension(lexer) {\n var start = lexer.token;\n expectKeyword(lexer, 'extend');\n expectKeyword(lexer, 'interface');\n var name = parseName(lexer);\n var directives = parseDirectives(lexer, true);\n var fields = parseFieldsDefinition(lexer);\n\n if (directives.length === 0 && fiel...
[ "0.75327325", "0.7501439", "0.7501439", "0.7501439", "0.7501439", "0.74600834", "0.74577034", "0.74552834", "0.74516946", "0.74516946", "0.7414408", "0.73317724", "0.6054081", "0.60387725", "0.5941714", "0.5941714", "0.57579243", "0.57072496", "0.57072496", "0.57072496", "0.5...
0.7503121
1
UnionTypeExtension : extend union Name Directives[Const]? UnionMemberTypes extend union Name Directives[Const]
function parseUnionTypeExtension(lexer) { var start = lexer.token; expectKeyword(lexer, 'extend'); expectKeyword(lexer, 'union'); var name = parseName(lexer); var directives = parseDirectives(lexer, true); var types = parseUnionMemberTypes(lexer); if (directives.length === 0 && types.length === 0) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseUnionTypeExtension() {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('union');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const types = this.parseUnionMemberTypes();\n\n if (directives.length === 0 && type...
[ "0.7945255", "0.7613907", "0.75859904", "0.75859904", "0.75859904", "0.75859904", "0.7527838", "0.7525285", "0.7520956", "0.7516969", "0.7516969", "0.72357434", "0.59781456", "0.59781456", "0.5880313", "0.5662516", "0.56177825", "0.55935496", "0.55509764", "0.55509764", "0.55...
0.75788444
6
EnumTypeExtension : extend enum Name Directives[Const]? EnumValuesDefinition extend enum Name Directives[Const]
function parseEnumTypeExtension(lexer) { var start = lexer.token; expectKeyword(lexer, 'extend'); expectKeyword(lexer, 'enum'); var name = parseName(lexer); var directives = parseDirectives(lexer, true); var values = parseEnumValuesDefinition(lexer); if (directives.length === 0 && values.length === 0) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseEnumTypeExtension() {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('enum');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const values = this.parseEnumValuesDefinition();\n\n if (directives.length === 0 && v...
[ "0.8342753", "0.8038782", "0.798621", "0.798621", "0.798621", "0.798621", "0.79552686", "0.7949649", "0.79480535", "0.79430884", "0.79430884", "0.788338", "0.6710607", "0.6419208", "0.641568", "0.641568", "0.6414679", "0.6414679", "0.63909525", "0.63434774", "0.63351285", "...
0.800925
2
InputObjectTypeExtension : extend input Name Directives[Const]? InputFieldsDefinition extend input Name Directives[Const]
function parseInputObjectTypeExtension(lexer) { var start = lexer.token; expectKeyword(lexer, 'extend'); expectKeyword(lexer, 'input'); var name = parseName(lexer); var directives = parseDirectives(lexer, true); var fields = parseInputFieldsDefinition(lexer); if (directives.length === 0 && fields.length ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseInputObjectTypeExtension() {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('input');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const fields = this.parseInputFieldsDefinition();\n\n if (directives.length =...
[ "0.77224934", "0.74134797", "0.73963296", "0.73963296", "0.73963296", "0.73963296", "0.73897004", "0.7388679", "0.7385791", "0.7385791", "0.73586434", "0.73030066", "0.6640263", "0.62144965", "0.62115127", "0.62106407", "0.62106407", "0.6198305", "0.6185935", "0.6185935", "0....
0.738839
8
DirectiveLocations : `|`? DirectiveLocation DirectiveLocations | DirectiveLocation
function parseDirectiveLocations(lexer) { // Optional leading pipe skip(lexer, _lexer.TokenKind.PIPE); var locations = []; do { locations.push(parseDirectiveLocation(lexer)); } while (skip(lexer, _lexer.TokenKind.PIPE)); return locations; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseDirectiveLocations(lexer) {\n // Optional leading pipe\n expectOptionalToken(lexer, TokenKind.PIPE);\n var locations = [];\n\n do {\n locations.push(parseDirectiveLocation(lexer));\n } while (expectOptionalToken(lexer, TokenKind.PIPE));\n\n return locations;\n}", "function parseDirectiveLo...
[ "0.7881363", "0.77547574", "0.7676766", "0.7676766", "0.7621344", "0.7619415", "0.7619415", "0.7619415", "0.7619415", "0.75098306", "0.75098306", "0.75098306", "0.75098306", "0.750941", "0.750941", "0.7505226", "0.74823904", "0.7440218", "0.739005", "0.5977693", "0.597613", ...
0.761385
9
DirectiveLocation : ExecutableDirectiveLocation TypeSystemDirectiveLocation ExecutableDirectiveLocation : one of `QUERY` `MUTATION` `SUBSCRIPTION` `FIELD` `FRAGMENT_DEFINITION` `FRAGMENT_SPREAD` `INLINE_FRAGMENT` TypeSystemDirectiveLocation : one of `SCHEMA` `SCALAR` `OBJECT` `FIELD_DEFINITION` `ARGUMENT_DEFINITION` `I...
function parseDirectiveLocation(lexer) { var start = lexer.token; var name = parseName(lexer); if (_directiveLocation.DirectiveLocation.hasOwnProperty(name.value)) { return name; } throw unexpected(lexer, start); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseDirectiveLocation(lexer) {\n var start = lexer.token;\n var name = parseName(lexer);\n\n if (_directiveLocation__WEBPACK_IMPORTED_MODULE_7__[\"DirectiveLocation\"][name.value] !== undefined) {\n return name;\n }\n\n throw unexpected(lexer, start);\n}", "function parseDirectiveLocation(lexer...
[ "0.5758902", "0.5753095", "0.56966335", "0.5676537", "0.55618453", "0.5480655", "0.54416156", "0.5375438", "0.53711736", "0.53711736", "0.5367622", "0.5367622", "0.5367622", "0.5367622", "0.5364138", "0.53288925", "0.52661747", "0.52010286", "0.51863086", "0.51863086", "0.518...
0.53156954
16
Core parsing utility functions Returns a location object, used to identify the place in the source that created a given parsed object.
function loc(lexer, startToken) { if (!lexer.options.noLocation) { return new Loc(startToken, lexer.lastToken, lexer.source); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loc(parser, start) {\n\t if (parser.options.noLocation) {\n\t return null;\n\t }\n\t if (parser.options.noSource) {\n\t return { start: start, end: parser.prevEnd };\n\t }\n\t return { start: start, end: parser.prevEnd, source: parser.source };\n\t}", "function loc(parser, start) {\n if (par...
[ "0.7424774", "0.737512", "0.6481873", "0.6481873", "0.6481873", "0.6481873", "0.6481873", "0.6481873", "0.6481873", "0.6481873", "0.6481873", "0.6481873", "0.6465274", "0.6465274", "0.6461631", "0.642518", "0.6147506", "0.61040294", "0.6103592", "0.6103592", "0.6103592", "0...
0.645348
29
Determines if the next token is of a given kind
function peek(lexer, kind) { return lexer.token.kind === kind; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "match(tokenKind) {\n if (this.check(tokenKind)) {\n this.current++; //advance\n return true;\n }\n return false;\n }", "isToken(type) { return this.tokenizer.isTokenType(type) }", "peek(kind) {\n return this._lexer.token.kind === kind;\n }", "isTokenType(type...
[ "0.7669077", "0.7138985", "0.71243644", "0.6991784", "0.6981886", "0.6981886", "0.69696575", "0.6958934", "0.6938066", "0.6907717", "0.6870581", "0.68650633", "0.6751013", "0.67288613", "0.6719839", "0.6683571", "0.6593374", "0.64219314", "0.636494", "0.636494", "0.63374966",...
0.70372933
17
If the next token is of the given kind, return true after advancing the lexer. Otherwise, do not change the parser state and return false.
function skip(lexer, kind) { var match = lexer.token.kind === kind; if (match) { lexer.advance(); } return match; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "match(tokenKind) {\n if (this.check(tokenKind)) {\n this.current++; //advance\n return true;\n }\n return false;\n }", "peek(kind) {\n return this._lexer.token.kind === kind;\n }", "expectOptionalToken(kind) {\n const token = this._lexer.token;\n\n if (to...
[ "0.7885567", "0.6892723", "0.67037976", "0.66510785", "0.66510785", "0.66510785", "0.66510785", "0.66510785", "0.66510785", "0.66510785", "0.66510785", "0.66510785", "0.66510785", "0.66510785", "0.66510785", "0.66510785", "0.66510785", "0.66510785", "0.66510785", "0.65263903", ...
0.5617902
64
If the next token is of the given kind, return that token after advancing the lexer. Otherwise, do not change the parser state and throw an error.
function expect(lexer, kind) { var token = lexer.token; if (token.kind === kind) { lexer.advance(); return token; } throw (0, _error.syntaxError)(lexer.source, token.start, "Expected ".concat(kind, ", found ").concat((0, _lexer.getTokenDesc)(token))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function expectToken(lexer, kind) {\n var token = lexer.token;\n\n if (token.kind === kind) {\n lexer.advance();\n return token;\n }\n\n throw syntaxError(lexer.source, token.start, \"Expected \".concat(kind, \", found \").concat(getTokenDesc(token)));\n}", "function expectToken(lexer, kind) {\n var t...
[ "0.7572335", "0.75560683", "0.7541697", "0.7541697", "0.75008905", "0.74869084", "0.74869084", "0.74869084", "0.74869084", "0.74869084", "0.74869084", "0.74869084", "0.74869084", "0.74869084", "0.74869084", "0.7457325", "0.7457325", "0.738344", "0.72548056", "0.72143227", "0....
0.7447874
17
If the next token is a keyword with the given value, return that token after advancing the lexer. Otherwise, do not change the parser state and return false.
function expectKeyword(lexer, value) { var token = lexer.token; if (token.kind === _lexer.TokenKind.NAME && token.value === value) { lexer.advance(); return token; } throw (0, _error.syntaxError)(lexer.source, token.start, "Expected \"".concat(value, "\", found ").concat((0, _lexer.getTokenDesc)(token...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function expectKeyword(lexer, value) {\n var token = lexer.token;\n\n if (token.kind === _lexer__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].NAME && token.value === value) {\n lexer.advance();\n return token;\n }\n\n throw Object(_error__WEBPACK_IMPORTED_MODULE_3__[\"syntaxError\"])(lexer.source, token.st...
[ "0.7183732", "0.7183732", "0.71797234", "0.70966864", "0.6973109", "0.6973109", "0.6973109", "0.6973109", "0.6973109", "0.6973109", "0.6973109", "0.6973109", "0.6973109", "0.6973109", "0.69365615", "0.69234824", "0.69234824", "0.6919082", "0.6919082", "0.69039816", "0.6903981...
0.69436073
14
Helper function for creating an error when an unexpected lexed token is encountered.
function unexpected(lexer, atToken) { var token = atToken || lexer.token; return (0, _error.syntaxError)(lexer.source, token.start, "Unexpected ".concat((0, _lexer.getTokenDesc)(token))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function unexpectedTokenError(token, message)\n\t\t{\n\t\t\tvar msg = Messages.UnexpectedToken;\n\t\t\tif (token)\n\t\t\t{\n\t\t\t\tmsg = message ? message : (token.type === Token.EOF) ? Messages.UnexpectedEOS : (token.type === Token.Identifier) ? Messages.UnexpectedIdentifier : (token.type === Token.NumericLitera...
[ "0.7421297", "0.73534113", "0.7337508", "0.7335112", "0.7335112", "0.7331919", "0.7302289", "0.7281797", "0.72380084", "0.72380084", "0.72380084", "0.72380084", "0.72380084", "0.7206929", "0.72068286", "0.72068286", "0.72068286", "0.72068286", "0.72068286", "0.72068286", "0.7...
0.72845167
7
Returns a possibly empty list of parse nodes, determined by the parseFn. This list begins with a lex token of openKind and ends with a lex token of closeKind. Advances the parser to the next lex token after the closing token.
function any(lexer, openKind, parseFn, closeKind) { expect(lexer, openKind); var nodes = []; while (!skip(lexer, closeKind)) { nodes.push(parseFn(lexer)); } return nodes; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "many(openKind, parseFn, closeKind) {\n this.expectToken(openKind);\n const nodes = [];\n\n do {\n nodes.push(parseFn.call(this));\n } while (!this.expectOptionalToken(closeKind));\n\n return nodes;\n }", "function many(parser, openKind, parseFn, closeKind) {\n\t expect(parser, openKind);\n\...
[ "0.7557073", "0.7245133", "0.7104669", "0.7073318", "0.7047257", "0.7047257", "0.70177674", "0.69966984", "0.69444", "0.69444", "0.6895927", "0.6895927", "0.6895927", "0.6895927", "0.6895927", "0.6895927", "0.6895927", "0.6895927", "0.6895927", "0.6895927", "0.68919057", "0...
0.6865888
23
Returns a nonempty list of parse nodes, determined by the parseFn. This list begins with a lex token of openKind and ends with a lex token of closeKind. Advances the parser to the next lex token after the closing token.
function many(lexer, openKind, parseFn, closeKind) { expect(lexer, openKind); var nodes = [parseFn(lexer)]; while (!skip(lexer, closeKind)) { nodes.push(parseFn(lexer)); } return nodes; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "many(openKind, parseFn, closeKind) {\n this.expectToken(openKind);\n const nodes = [];\n\n do {\n nodes.push(parseFn.call(this));\n } while (!this.expectOptionalToken(closeKind));\n\n return nodes;\n }", "function many(parser, openKind, parseFn, closeKind) {\n\t expect(parser, openKind);\n\...
[ "0.7481275", "0.7183148", "0.70387834", "0.70002943", "0.70002943", "0.6978514", "0.68941516", "0.6872669", "0.684812", "0.684812", "0.684812", "0.684812", "0.684812", "0.684812", "0.684812", "0.684812", "0.684812", "0.684812", "0.68133646", "0.68133646", "0.6785136", "0.67...
0.6897994
7
Update the last written byte offset
_updateLastWrittenByte() { if (this.offset > this._lastWrittenByte) { this._lastWrittenByte = this.offset; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_updateLastWrittenByte () {\n if (this.offset > this._lastWrittenByte) {\n this._lastWrittenByte = this.offset\n }\n }", "outputSeek(pos) {\n this.bufPos = pos;\n }", "function update(chunk) {\n if (typeof chunk === \"string\") return updateString(chunk);\n var length = chunk.length...
[ "0.8697628", "0.6344886", "0.58493793", "0.58493793", "0.58493793", "0.5728844", "0.5638669", "0.56129515", "0.5584805", "0.5570992", "0.5569149", "0.556791", "0.5556969", "0.55103236", "0.5464688", "0.5418126", "0.5417785", "0.54176384", "0.54005784", "0.53938603", "0.538186...
0.85348445
1
Build a destructive iterator for the value list
function iteratorFor(items) { var iterator = { next: function() { var value = items.shift() return {done: value === undefined, value: value} } } if (support.iterable) { iterator[Symbol.iterator] = function() { return iterator } } return iterator }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static createIteratorFromValue(value){\n return (function(){\n let used = false;\n\n return {\n next: function(){\n try {\n return used ? {done: true} : {value: value, done: false};\n ...
[ "0.6567051", "0.61971587", "0.6129268", "0.60959846", "0.6081213", "0.6081213", "0.60518825", "0.60518825", "0.60518825", "0.60518825", "0.60518825", "0.60395825", "0.6019784", "0.6000144", "0.593555", "0.59003186", "0.5864537", "0.58550805", "0.57782644", "0.57182074", "0.56...
0.0
-1
DIVESITE SPECIFIC DATA ANALYSIS
function diversWhoSawAndDidNotSeeDivesiteSpecific() { console.log("diversWhoSaw-/diversWhoDidNotSee- DivesiteSpecific"); sightingsThisMonth.get().then(snapshot => { var diverData = {} // looping through all the sightings snapshot.forEach(sighting_doc => { const divesite_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function doLogic(data){\n var mag5 = 0;\n var mag6 = 0;\n var mag7 = 0;\n var mag8 = 0;\n var mag9 = 0;\n var year1900 = 0;\n var year1920 = 0;\n var year1940 = 0;\n var year1960 = 0;\n var year1980 = 0;\n var year2000 = 0;\n\n incidentsByMag = [];\n incidentsByYear = [];\n\n var eventsByCountry={};\...
[ "0.62455505", "0.62208736", "0.6217611", "0.6139672", "0.6107638", "0.59676486", "0.5944834", "0.5941741", "0.59361804", "0.59348434", "0.5901862", "0.58718425", "0.58600134", "0.5838759", "0.5822884", "0.58025986", "0.5764161", "0.5762569", "0.57589996", "0.5754743", "0.5717...
0.0
-1
Invoke virtual alexa with constructed skill request
call(skillRequest, skill/*, skillInteractor*/) { console.log("skillRequest: " + JSON.stringify(skillRequest.json(), null, 2)); //this._interactor = skillInteractor; return this._interactor.callSkill(skillRequest, skill); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "request() {\n return new SkillRequest(this._context);\n }", "function xapistatement(verb,activitytype,shortdesc,longdesc,showresult,completion,success,score,response) { \r\nconsole.log(\"xAPI called\");\r\n//This gets the player object from Articulate so we can get any of the variables we set\r\nvar pl...
[ "0.5816202", "0.5550612", "0.5424233", "0.54219204", "0.5392647", "0.53172415", "0.5316406", "0.53003085", "0.52777493", "0.52549934", "0.5164245", "0.5111915", "0.5096789", "0.5049191", "0.5032221", "0.49860147", "0.49646035", "0.49630052", "0.49590835", "0.49522775", "0.492...
0.6853051
0
Get skill request instance to build a request from scratch. Useful for highly customized JSON requests
request() { return new SkillRequest(this._context); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function new_test_request() {\n return new Request(test_url)\n}", "getRequest() {\n return {\n type: this.type,\n payload: {}\n };\n }", "makeRequest() {\r\n // Get Parameter Values\r\n let requestString = [];\r\n\r\n // Make Request\r\n this....
[ "0.61342514", "0.6087232", "0.604648", "0.602745", "0.5987677", "0.59732616", "0.5931433", "0.5844888", "0.5795096", "0.57076114", "0.5688991", "0.56837046", "0.56744593", "0.5663162", "0.5650972", "0.56366473", "0.562036", "0.56029934", "0.5584316", "0.5569914", "0.5551685",...
0.8145441
0
GEOLOCALIZATION FUNC. // // Geolocalisation
function GetLocSuccess(pos) { let crd = pos.coords; if(latitude != "" && longitude != "" && zoomLevel != ""){ mapOptions.center = [latitude, longitude]; mapOptions.zoom = zoomLevel; }else{ mapOptions.center = [crd.latitude,crd.longitude]; } GenerateMap(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function obtenirLocalisation() {\r\n if (navigator.geolocation) {\r\n navigator.geolocation.getCurrentPosition(determinerPosition, annulerAffichage);\r\n } else {\r\n alert(\"Geolocalisation non implementee.\");\r\n }\r\n}", "function ArithGeo(arr) {}", "function load_geolocalisation() {\n\t if (...
[ "0.6887528", "0.68197995", "0.67644274", "0.6531035", "0.6499466", "0.61518496", "0.6101934", "0.60528225", "0.5994422", "0.5988886", "0.59425443", "0.5904958", "0.58934265", "0.58527434", "0.5828965", "0.58204013", "0.58157676", "0.57952005", "0.5767997", "0.5765405", "0.575...
0.0
-1
On error on geolocalisation Rouen is aimed
function GetLocError(err) { console.warn(`ERREUR (${err.code}): ${err.message}`); if(latitude != "" && longitude != "" && zoomLevel != ""){ mapOptions.center = [latitude,longitude]; mapOptions.zoom = zoomLevel; } GenerateMap(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleGeoError() {\n console.log(\"Can't access geolocation\");\n }", "function geolocError(){\n console.log(\"Error getting user's location :(\");\n}", "function erreurGeo(error){\n var e='';\n switch(error.cod...
[ "0.7438499", "0.74085975", "0.73410594", "0.7242244", "0.712087", "0.7028418", "0.70064336", "0.6959457", "0.6772846", "0.67576", "0.67465216", "0.6728676", "0.6727098", "0.6710999", "0.66958433", "0.66846156", "0.66369957", "0.66307414", "0.659112", "0.657148", "0.6552511", ...
0.68117833
8
FONCTIONS INTERAC. MARKER //
function displayMarkerInfo(e){ GetSellerInformationFromIdPromise = GetSellerInformationFromId(e.target.options.sellerId); GetSellerInformationFromIdPromise.then((result) => { result =JSON.parse(result); if(result["SELL_ID"] != 0){ sellerId = result["SELL_ID"]; window.loca...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Annotate() {\r\n}", "function pt(e,t,a){var n=e.markedSpans,r=e.text,f=0;if(n)for(var o,i,s,c,u,l,d,_=r.length,m=0,p=1,g=\"\",h=0;;){if(h==m){// Update current marker set\n s=c=u=l=i=\"\",d=null,h=1/0;for(var b=[],y=void 0,v=0;v<n.length;++v){var w=n[v],x=w.marker;\"bookmark\"==x.type&&w.from==m&&x.w...
[ "0.6254357", "0.59406656", "0.5818901", "0.57459974", "0.57389677", "0.5695866", "0.5630787", "0.55242103", "0.5501065", "0.54798967", "0.54677635", "0.54415697", "0.5378796", "0.5317078", "0.5307671", "0.52990925", "0.52830195", "0.52808946", "0.52570087", "0.5250065", "0.52...
0.0
-1
FONCTIONS INTERAC. BACK //
function GetSellerLocation(){ let method = "GET"; let url = "/Seller/GetAllSellerLocationAndIdAndName"; return SendRequestReturnAPromise(method, url); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function backOne(){\n\t\tif (i>0){i = i - 1}\n\t\telse {i=(featureInfo.length - 1)};\n\t\tinfo.update(featureInfo[i].properties);\n\t\t}", "back () {\n // realization in Class\n }", "back() {\n this._treatNoValues();\n return this.storage[this.storage.length - 1];\n }", "function backGradien...
[ "0.6165822", "0.61518365", "0.58203065", "0.56708974", "0.56668556", "0.56235075", "0.5584904", "0.55646265", "0.5564597", "0.55358785", "0.5504713", "0.54846203", "0.5472056", "0.5452629", "0.5449431", "0.5441773", "0.5440846", "0.54372793", "0.54359347", "0.5425804", "0.541...
0.0
-1
MAP EVENTS HANDLER //
function MapChangedHandler(map){ let pos = { 'latitude' : map.getCenter()['lat'], 'longitude': map.getCenter()['lng'], 'zoomLevel': map.getZoom() }; let method = "PUT"; let url = `/map/RegisterMapPos/${JSON.stringify(pos)}`; let headers = [{'name':'Content-Type', 'value':'app...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_attachMapMoveHandlers() {\n this._maps.forEach((map, index) => {\n map.events.add('move', this._syncEvents[index]);\n });\n }", "bindEvents() {\n this.AMapEventListeners = [];\n\n /**\n * Construct event callbacks.\n */\n const eventCallbacks = this.parseEvents();\n\...
[ "0.6817577", "0.67753583", "0.67070776", "0.64694476", "0.64139974", "0.63955104", "0.6295894", "0.6282205", "0.62004524", "0.6180429", "0.61689335", "0.6163899", "0.61504257", "0.6139784", "0.6138811", "0.60399455", "0.60345864", "0.6014338", "0.6011041", "0.5943426", "0.592...
0.0
-1
Current value set back to 0.
function resetButton() { var r = getProgress(); setProgress(r = 0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resetValue() {\n\treturn 0;\n}", "function resetValue() {\n\t\t\t}", "setZero() {\n _instance.setZero()\n }", "reset() {\n this.currentOperand = '0';\n this.previousOperand = '';\n this.operation = undefined;\n }", "function clearValue(){\n value = 0;\n draw();\n}...
[ "0.76273763", "0.7354822", "0.72763705", "0.67301947", "0.6626897", "0.6613312", "0.6576802", "0.65568405", "0.65011394", "0.6480693", "0.640015", "0.6381142", "0.6336066", "0.62870866", "0.6244682", "0.62268627", "0.6211757", "0.620818", "0.61792487", "0.61765707", "0.615939...
0.0
-1
Stop Auto complete value at current value when button is pressed.
function stopProgress(){ /* Update: Stop id interval */ clearInterval(id) id = '' }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "cancel() {\n this._inputController.$commandInput.prop('selectionStart', this.initialRange.start);\n this._inputController.$commandInput.prop('selectionEnd', this.initialRange.end);\n this._inputController.$commandInput.focus();\n\n this.initialRange = {};\n this.targetRange = {};...
[ "0.65421814", "0.6388571", "0.6346939", "0.61897933", "0.6025466", "0.6018154", "0.596122", "0.59295964", "0.59149766", "0.5913632", "0.58940697", "0.58940697", "0.58940697", "0.58940697", "0.5892497", "0.5892497", "0.5892497", "0.58468163", "0.58446896", "0.58141744", "0.580...
0.0
-1