repo stringlengths 5 67 | path stringlengths 4 116 | func_name stringlengths 0 58 | original_string stringlengths 52 373k | language stringclasses 1
value | code stringlengths 52 373k | code_tokens list | docstring stringlengths 4 11.8k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 86 226 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
IceCreamYou/THREE.Terrain | src/gaussian.js | gaussian | function gaussian(src, s, kernelSize) {
if (typeof s === 'undefined') s = 1;
if (typeof kernelSize === 'undefined') kernelSize = 7;
var kernel = gaussianKernel1D(s, kernelSize),
l = kernelSize || kernel.length,
kernelH = [kernel],
kernelV = new Array(l);
for (var i = 0; i < l; i+... | javascript | function gaussian(src, s, kernelSize) {
if (typeof s === 'undefined') s = 1;
if (typeof kernelSize === 'undefined') kernelSize = 7;
var kernel = gaussianKernel1D(s, kernelSize),
l = kernelSize || kernel.length,
kernelH = [kernel],
kernelV = new Array(l);
for (var i = 0; i < l; i+... | [
"function",
"gaussian",
"(",
"src",
",",
"s",
",",
"kernelSize",
")",
"{",
"if",
"(",
"typeof",
"s",
"===",
"'undefined'",
")",
"s",
"=",
"1",
";",
"if",
"(",
"typeof",
"kernelSize",
"===",
"'undefined'",
")",
"kernelSize",
"=",
"7",
";",
"var",
"ker... | Perform Gaussian smoothing.
@param {Number[][]} src
The source array to convolve. A nonzero-sized rectangular array of numbers.
@param {Number} [s=1]
The standard deviation of the Gaussian kernel to use. Higher values result
in smoothing across more cells of the src matrix.
@param {Number} [kernelSize=7]
The size of t... | [
"Perform",
"Gaussian",
"smoothing",
"."
] | 1896bd23eb3e0372096d75fa3e46d96eb1a56317 | https://github.com/IceCreamYou/THREE.Terrain/blob/1896bd23eb3e0372096d75fa3e46d96eb1a56317/src/gaussian.js#L119-L130 | train |
sympmarc/SPServices | src/core/SPServices.utils.js | function(SOAPEnvelope, siteDataOperation) {
var siteDataOp = siteDataOperation.substring(8);
SOAPEnvelope.opheader = SOAPEnvelope.opheader.replace(siteDataOperation, siteDataOp);
SOAPEnvelope.opfooter = SOAPEnvelope.opfooter.replace(siteDataOperation, siteDataOp);
return ... | javascript | function(SOAPEnvelope, siteDataOperation) {
var siteDataOp = siteDataOperation.substring(8);
SOAPEnvelope.opheader = SOAPEnvelope.opheader.replace(siteDataOperation, siteDataOp);
SOAPEnvelope.opfooter = SOAPEnvelope.opfooter.replace(siteDataOperation, siteDataOp);
return ... | [
"function",
"(",
"SOAPEnvelope",
",",
"siteDataOperation",
")",
"{",
"var",
"siteDataOp",
"=",
"siteDataOperation",
".",
"substring",
"(",
"8",
")",
";",
"SOAPEnvelope",
".",
"opheader",
"=",
"SOAPEnvelope",
".",
"opheader",
".",
"replace",
"(",
"siteDataOperati... | The SiteData operations have the same names as other Web Service operations. To make them easy to call and unique, I'm using the SiteData prefix on their names. This function replaces that name with the right name in the SPServices.SOAPEnvelope. | [
"The",
"SiteData",
"operations",
"have",
"the",
"same",
"names",
"as",
"other",
"Web",
"Service",
"operations",
".",
"To",
"make",
"them",
"easy",
"to",
"call",
"and",
"unique",
"I",
"m",
"using",
"the",
"SiteData",
"prefix",
"on",
"their",
"names",
".",
... | 7ff0d24658d1d354a937bc82ab21cb6352025ea3 | https://github.com/sympmarc/SPServices/blob/7ff0d24658d1d354a937bc82ab21cb6352025ea3/src/core/SPServices.utils.js#L240-L245 | train | |
sympmarc/SPServices | dist/jquery.SPServices.js | getScriptAttribute | function getScriptAttribute(source, attribute) {
var matches;
var regex = RegExp(attribute + "=(\"([^\"]*)\")|('([^']*)')", "gi");
if (matches = regex.exec(source)) {
return matches[2];
}
return null;
} | javascript | function getScriptAttribute(source, attribute) {
var matches;
var regex = RegExp(attribute + "=(\"([^\"]*)\")|('([^']*)')", "gi");
if (matches = regex.exec(source)) {
return matches[2];
}
return null;
} | [
"function",
"getScriptAttribute",
"(",
"source",
",",
"attribute",
")",
"{",
"var",
"matches",
";",
"var",
"regex",
"=",
"RegExp",
"(",
"attribute",
"+",
"\"=(\\\"([^\\\"]*)\\\")|('([^']*)')\"",
",",
"\"gi\"",
")",
";",
"if",
"(",
"matches",
"=",
"regex",
".",... | End of function SPScriptAuditPage | [
"End",
"of",
"function",
"SPScriptAuditPage"
] | 7ff0d24658d1d354a937bc82ab21cb6352025ea3 | https://github.com/sympmarc/SPServices/blob/7ff0d24658d1d354a937bc82ab21cb6352025ea3/dist/jquery.SPServices.js#L3149-L3156 | train |
sympmarc/SPServices | dist/jquery.SPServices.js | showAttrs | function showAttrs(node) {
var i;
var out = "<table class='ms-vb' width='100%'>";
for (i = 0; i < node.attributes.length; i++) {
out += "<tr><td width='10px' style='font-weight:bold;'>" + i + "</td><td width='100px'>" +
node.attributes.item(i).nodeName + "</td><td>" + che... | javascript | function showAttrs(node) {
var i;
var out = "<table class='ms-vb' width='100%'>";
for (i = 0; i < node.attributes.length; i++) {
out += "<tr><td width='10px' style='font-weight:bold;'>" + i + "</td><td width='100px'>" +
node.attributes.item(i).nodeName + "</td><td>" + che... | [
"function",
"showAttrs",
"(",
"node",
")",
"{",
"var",
"i",
";",
"var",
"out",
"=",
"\"<table class='ms-vb' width='100%'>\"",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"node",
".",
"attributes",
".",
"length",
";",
"i",
"++",
")",
"{",
"out",
"+... | Show a single attribute of a node, enclosed in a table node The XML node opt The current set of options | [
"Show",
"a",
"single",
"attribute",
"of",
"a",
"node",
"enclosed",
"in",
"a",
"table",
"node",
"The",
"XML",
"node",
"opt",
"The",
"current",
"set",
"of",
"options"
] | 7ff0d24658d1d354a937bc82ab21cb6352025ea3 | https://github.com/sympmarc/SPServices/blob/7ff0d24658d1d354a937bc82ab21cb6352025ea3/dist/jquery.SPServices.js#L4325-L4334 | train |
sympmarc/SPServices | dist/jquery.SPServices.js | errBox | function errBox(func, param, msg) {
var errMsg = "<b>Error in function</b><br/>" + func + "<br/>" +
"<b>Parameter</b><br/>" + param + "<br/>" +
"<b>Message</b><br/>" + msg + "<br/><br/>" +
"<span onmouseover='this.style.cursor=\"hand\";' onmouseout='this.style.cursor=\"inheri... | javascript | function errBox(func, param, msg) {
var errMsg = "<b>Error in function</b><br/>" + func + "<br/>" +
"<b>Parameter</b><br/>" + param + "<br/>" +
"<b>Message</b><br/>" + msg + "<br/><br/>" +
"<span onmouseover='this.style.cursor=\"hand\";' onmouseout='this.style.cursor=\"inheri... | [
"function",
"errBox",
"(",
"func",
",",
"param",
",",
"msg",
")",
"{",
"var",
"errMsg",
"=",
"\"<b>Error in function</b><br/>\"",
"+",
"func",
"+",
"\"<br/>\"",
"+",
"\"<b>Parameter</b><br/>\"",
"+",
"param",
"+",
"\"<br/>\"",
"+",
"\"<b>Message</b><br/>\"",
"+",
... | End of function getDropdownSelected Build an error message based on passed parameters | [
"End",
"of",
"function",
"getDropdownSelected",
"Build",
"an",
"error",
"message",
"based",
"on",
"passed",
"parameters"
] | 7ff0d24658d1d354a937bc82ab21cb6352025ea3 | https://github.com/sympmarc/SPServices/blob/7ff0d24658d1d354a937bc82ab21cb6352025ea3/dist/jquery.SPServices.js#L4374-L4380 | train |
sympmarc/SPServices | dist/jquery.SPServices.js | modalBox | function modalBox(msg) {
var boxCSS = "position:absolute;width:300px;height:150px;padding:10px;background-color:#000000;color:#ffffff;z-index:30;font-family:'Arial';font-size:12px;display:none;";
$("#aspnetForm").parent().append("<div id='SPServices_msgBox' style=" + boxCSS + ">" + msg);
var msg... | javascript | function modalBox(msg) {
var boxCSS = "position:absolute;width:300px;height:150px;padding:10px;background-color:#000000;color:#ffffff;z-index:30;font-family:'Arial';font-size:12px;display:none;";
$("#aspnetForm").parent().append("<div id='SPServices_msgBox' style=" + boxCSS + ">" + msg);
var msg... | [
"function",
"modalBox",
"(",
"msg",
")",
"{",
"var",
"boxCSS",
"=",
"\"position:absolute;width:300px;height:150px;padding:10px;background-color:#000000;color:#ffffff;z-index:30;font-family:'Arial';font-size:12px;display:none;\"",
";",
"$",
"(",
"\"#aspnetForm\"",
")",
".",
"parent",
... | End of function errBox Call this function to pop up a branded modal msgBox | [
"End",
"of",
"function",
"errBox",
"Call",
"this",
"function",
"to",
"pop",
"up",
"a",
"branded",
"modal",
"msgBox"
] | 7ff0d24658d1d354a937bc82ab21cb6352025ea3 | https://github.com/sympmarc/SPServices/blob/7ff0d24658d1d354a937bc82ab21cb6352025ea3/dist/jquery.SPServices.js#L4383-L4400 | train |
sympmarc/SPServices | dist/jquery.SPServices.js | genContainerId | function genContainerId(funcname, columnName, listName) {
var l = listName !== undefined ? listName : $().SPServices.SPListNameFromUrl();
return funcname + "_" + $().SPServices.SPGetStaticFromDisplay({
listName: l,
columnDisplayName: columnName
});
} | javascript | function genContainerId(funcname, columnName, listName) {
var l = listName !== undefined ? listName : $().SPServices.SPListNameFromUrl();
return funcname + "_" + $().SPServices.SPGetStaticFromDisplay({
listName: l,
columnDisplayName: columnName
});
} | [
"function",
"genContainerId",
"(",
"funcname",
",",
"columnName",
",",
"listName",
")",
"{",
"var",
"l",
"=",
"listName",
"!==",
"undefined",
"?",
"listName",
":",
"$",
"(",
")",
".",
"SPServices",
".",
"SPListNameFromUrl",
"(",
")",
";",
"return",
"funcna... | End of function modalBox Generate a unique id for a containing div using the function name and the column display name | [
"End",
"of",
"function",
"modalBox",
"Generate",
"a",
"unique",
"id",
"for",
"a",
"containing",
"div",
"using",
"the",
"function",
"name",
"and",
"the",
"column",
"display",
"name"
] | 7ff0d24658d1d354a937bc82ab21cb6352025ea3 | https://github.com/sympmarc/SPServices/blob/7ff0d24658d1d354a937bc82ab21cb6352025ea3/dist/jquery.SPServices.js#L4403-L4409 | train |
sympmarc/SPServices | dist/jquery.SPServices.js | getListFormUrl | function getListFormUrl(l, f) {
var u;
$().SPServices({
operation: "GetFormCollection",
async: false,
listName: l,
completefunc: function (xData) {
u = $(xData.responseXML).find("Form[Type='" + f + "']").attr("Url");
}
... | javascript | function getListFormUrl(l, f) {
var u;
$().SPServices({
operation: "GetFormCollection",
async: false,
listName: l,
completefunc: function (xData) {
u = $(xData.responseXML).find("Form[Type='" + f + "']").attr("Url");
}
... | [
"function",
"getListFormUrl",
"(",
"l",
",",
"f",
")",
"{",
"var",
"u",
";",
"$",
"(",
")",
".",
"SPServices",
"(",
"{",
"operation",
":",
"\"GetFormCollection\"",
",",
"async",
":",
"false",
",",
"listName",
":",
"l",
",",
"completefunc",
":",
"functi... | End of function genContainerId Get the URL for a specified form for a list | [
"End",
"of",
"function",
"genContainerId",
"Get",
"the",
"URL",
"for",
"a",
"specified",
"form",
"for",
"a",
"list"
] | 7ff0d24658d1d354a937bc82ab21cb6352025ea3 | https://github.com/sympmarc/SPServices/blob/7ff0d24658d1d354a937bc82ab21cb6352025ea3/dist/jquery.SPServices.js#L4412-L4425 | train |
sympmarc/SPServices | dist/jquery.SPServices.js | checkLink | function checkLink(s) {
return ((s.indexOf("http") === 0) || (s.indexOf(SLASH) === 0)) ? "<a href='" + s + "'>" + s + "</a>" : s;
} | javascript | function checkLink(s) {
return ((s.indexOf("http") === 0) || (s.indexOf(SLASH) === 0)) ? "<a href='" + s + "'>" + s + "</a>" : s;
} | [
"function",
"checkLink",
"(",
"s",
")",
"{",
"return",
"(",
"(",
"s",
".",
"indexOf",
"(",
"\"http\"",
")",
"===",
"0",
")",
"||",
"(",
"s",
".",
"indexOf",
"(",
"SLASH",
")",
"===",
"0",
")",
")",
"?",
"\"<a href='\"",
"+",
"s",
"+",
"\"'>\"",
... | If a string is a URL, format it as a link, else return the string as-is | [
"If",
"a",
"string",
"is",
"a",
"URL",
"format",
"it",
"as",
"a",
"link",
"else",
"return",
"the",
"string",
"as",
"-",
"is"
] | 7ff0d24658d1d354a937bc82ab21cb6352025ea3 | https://github.com/sympmarc/SPServices/blob/7ff0d24658d1d354a937bc82ab21cb6352025ea3/dist/jquery.SPServices.js#L4497-L4499 | train |
sympmarc/SPServices | src/value-added/SPScriptAudit.js | coreScript | function coreScript(src) {
var coreScriptLocations = ["WebResource.axd", "_layouts"];
for (var i = 0; i < coreScriptLocations.length; i++) {
if (src.indexOf(coreScriptLocations[i]) > -1) {
return true;
}
}
return false;
} | javascript | function coreScript(src) {
var coreScriptLocations = ["WebResource.axd", "_layouts"];
for (var i = 0; i < coreScriptLocations.length; i++) {
if (src.indexOf(coreScriptLocations[i]) > -1) {
return true;
}
}
return false;
} | [
"function",
"coreScript",
"(",
"src",
")",
"{",
"var",
"coreScriptLocations",
"=",
"[",
"\"WebResource.axd\"",
",",
"\"_layouts\"",
"]",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"coreScriptLocations",
".",
"length",
";",
"i",
"++",
")",
"{",... | End of function getScriptAttribute Check to see if the script reference is part of SharePoint core so that we can ignore it | [
"End",
"of",
"function",
"getScriptAttribute",
"Check",
"to",
"see",
"if",
"the",
"script",
"reference",
"is",
"part",
"of",
"SharePoint",
"core",
"so",
"that",
"we",
"can",
"ignore",
"it"
] | 7ff0d24658d1d354a937bc82ab21cb6352025ea3 | https://github.com/sympmarc/SPServices/blob/7ff0d24658d1d354a937bc82ab21cb6352025ea3/src/value-added/SPScriptAudit.js#L248-L256 | train |
jantimon/iconfont-webpack-plugin | lib/icons-to-woff.js | getSvgHeight | function getSvgHeight (svg, filename) {
const parseSvg = /<svg[^>]+height\s*=\s*["']?(\d+)\s*(pt|px|)["']?/i.exec(svg);
if (!parseSvg) {
throw new Error(`could not read height for '${filename}'.`);
}
return parseSvg[1];
} | javascript | function getSvgHeight (svg, filename) {
const parseSvg = /<svg[^>]+height\s*=\s*["']?(\d+)\s*(pt|px|)["']?/i.exec(svg);
if (!parseSvg) {
throw new Error(`could not read height for '${filename}'.`);
}
return parseSvg[1];
} | [
"function",
"getSvgHeight",
"(",
"svg",
",",
"filename",
")",
"{",
"const",
"parseSvg",
"=",
"/",
"<svg[^>]+height\\s*=\\s*[\"']?(\\d+)\\s*(pt|px|)[\"']?",
"/",
"i",
".",
"exec",
"(",
"svg",
")",
";",
"if",
"(",
"!",
"parseSvg",
")",
"{",
"throw",
"new",
"Er... | Reads the height of the svg
@param {String} svg the svg content
@param {String} filename the file name for error reporting
@return {Number} height | [
"Reads",
"the",
"height",
"of",
"the",
"svg"
] | c180d5218b8173f80d65f9779f880487bc172a5a | https://github.com/jantimon/iconfont-webpack-plugin/blob/c180d5218b8173f80d65f9779f880487bc172a5a/lib/icons-to-woff.js#L76-L82 | train |
ssbc/secret-stack | core.js | function (address, cb) {
setupMultiserver()
ms_client.client(coearseAddress(address), function (err, stream) {
return err ? cb(err) : cb(null, setupRPC(stream, null, true))
})
} | javascript | function (address, cb) {
setupMultiserver()
ms_client.client(coearseAddress(address), function (err, stream) {
return err ? cb(err) : cb(null, setupRPC(stream, null, true))
})
} | [
"function",
"(",
"address",
",",
"cb",
")",
"{",
"setupMultiserver",
"(",
")",
"ms_client",
".",
"client",
"(",
"coearseAddress",
"(",
"address",
")",
",",
"function",
"(",
"err",
",",
"stream",
")",
"{",
"return",
"err",
"?",
"cb",
"(",
"err",
")",
... | cannot be called remote. | [
"cannot",
"be",
"called",
"remote",
"."
] | 195151ad97b0c5e8954e72f35c4cca193fb47e60 | https://github.com/ssbc/secret-stack/blob/195151ad97b0c5e8954e72f35c4cca193fb47e60/core.js#L216-L221 | train | |
yyx990803/pod | lib/api.js | function (done) {
fs.readdir(globalConfig.root, function (err, files) {
if (err) return callback(err)
async.map(files, function (f, next) {
if (f !== 'apps' && f !== 'repos') {
f = globalConfig.root + '/' + f
... | javascript | function (done) {
fs.readdir(globalConfig.root, function (err, files) {
if (err) return callback(err)
async.map(files, function (f, next) {
if (f !== 'apps' && f !== 'repos') {
f = globalConfig.root + '/' + f
... | [
"function",
"(",
"done",
")",
"{",
"fs",
".",
"readdir",
"(",
"globalConfig",
".",
"root",
",",
"function",
"(",
"err",
",",
"files",
")",
"{",
"if",
"(",
"err",
")",
"return",
"callback",
"(",
"err",
")",
"async",
".",
"map",
"(",
"files",
",",
... | clean root dir | [
"clean",
"root",
"dir"
] | 97a546c2c632466898947a6ad3480ce6e7e4f99e | https://github.com/yyx990803/pod/blob/97a546c2c632466898947a6ad3480ce6e7e4f99e/lib/api.js#L276-L289 | train | |
edimuj/cordova-plugin-audioinput | src/browser/AudioInputCaptureProxy.js | initialize | function initialize(success, error, opts) {
console.log("AudioInputCaptureProxy: initialize: " + JSON.stringify(opts));
onInitialized = success;
if (!intialized) {
sampleRate = opts[0] || sampleRate;
bufferSize = opts[1] || bufferSize;
channels = opts[2] || channels;
format =... | javascript | function initialize(success, error, opts) {
console.log("AudioInputCaptureProxy: initialize: " + JSON.stringify(opts));
onInitialized = success;
if (!intialized) {
sampleRate = opts[0] || sampleRate;
bufferSize = opts[1] || bufferSize;
channels = opts[2] || channels;
format =... | [
"function",
"initialize",
"(",
"success",
",",
"error",
",",
"opts",
")",
"{",
"console",
".",
"log",
"(",
"\"AudioInputCaptureProxy: initialize: \"",
"+",
"JSON",
".",
"stringify",
"(",
"opts",
")",
")",
";",
"onInitialized",
"=",
"success",
";",
"if",
"(",... | 2017-10-29 robert@fromont.net.nz Implement as a Cordova plugin for the 'browser' platform Public: | [
"2017",
"-",
"10",
"-",
"29",
"robert"
] | 9458b48584e7538483c5e4fa049bd441c1ee9d7c | https://github.com/edimuj/cordova-plugin-audioinput/blob/9458b48584e7538483c5e4fa049bd441c1ee9d7c/src/browser/AudioInputCaptureProxy.js#L24-L72 | train |
edimuj/cordova-plugin-audioinput | src/browser/AudioInputCaptureProxy.js | gotBuffers | function gotBuffers(wav) {
if (channels == 1) {
audioRecorder.exportMonoWAV(doneEncoding, wav);
}
else {
audioRecorder.exportWAV(doneEncoding, wav);
}
} | javascript | function gotBuffers(wav) {
if (channels == 1) {
audioRecorder.exportMonoWAV(doneEncoding, wav);
}
else {
audioRecorder.exportWAV(doneEncoding, wav);
}
} | [
"function",
"gotBuffers",
"(",
"wav",
")",
"{",
"if",
"(",
"channels",
"==",
"1",
")",
"{",
"audioRecorder",
".",
"exportMonoWAV",
"(",
"doneEncoding",
",",
"wav",
")",
";",
"}",
"else",
"{",
"audioRecorder",
".",
"exportWAV",
"(",
"doneEncoding",
",",
"... | callback from recorder invoked when recordin is finished | [
"callback",
"from",
"recorder",
"invoked",
"when",
"recordin",
"is",
"finished"
] | 9458b48584e7538483c5e4fa049bd441c1ee9d7c | https://github.com/edimuj/cordova-plugin-audioinput/blob/9458b48584e7538483c5e4fa049bd441c1ee9d7c/src/browser/AudioInputCaptureProxy.js#L218-L225 | train |
edimuj/cordova-plugin-audioinput | demo/file-demo.js | function () {
if (window.cordova && window.cordova.file && window.audioinput) {
initUIEvents();
consoleMessage("Use 'Start Capture' to begin...");
// Subscribe to audioinput events
//
window.addEventListener('audioinput', onAudioInputCapture, false);
window.addEve... | javascript | function () {
if (window.cordova && window.cordova.file && window.audioinput) {
initUIEvents();
consoleMessage("Use 'Start Capture' to begin...");
// Subscribe to audioinput events
//
window.addEventListener('audioinput', onAudioInputCapture, false);
window.addEve... | [
"function",
"(",
")",
"{",
"if",
"(",
"window",
".",
"cordova",
"&&",
"window",
".",
"cordova",
".",
"file",
"&&",
"window",
".",
"audioinput",
")",
"{",
"initUIEvents",
"(",
")",
";",
"consoleMessage",
"(",
"\"Use 'Start Capture' to begin...\"",
")",
";",
... | When cordova fires the deviceready event, we initialize everything needed for audio input. | [
"When",
"cordova",
"fires",
"the",
"deviceready",
"event",
"we",
"initialize",
"everything",
"needed",
"for",
"audio",
"input",
"."
] | 9458b48584e7538483c5e4fa049bd441c1ee9d7c | https://github.com/edimuj/cordova-plugin-audioinput/blob/9458b48584e7538483c5e4fa049bd441c1ee9d7c/demo/file-demo.js#L168-L185 | train | |
edimuj/cordova-plugin-audioinput | demo/utils.js | function (bufferSize, numberOfIterations) {
var bufSize = bufferSize || 16000,
iterations = numberOfIterations || 100;
for (var i = 0; i < iterations; i++) {
var data = [];
for (var k = 0; k < bufSize; k++) {
data.push((parseFloat(Math.random() * 1.0) - 0.5));
}
... | javascript | function (bufferSize, numberOfIterations) {
var bufSize = bufferSize || 16000,
iterations = numberOfIterations || 100;
for (var i = 0; i < iterations; i++) {
var data = [];
for (var k = 0; k < bufSize; k++) {
data.push((parseFloat(Math.random() * 1.0) - 0.5));
}
... | [
"function",
"(",
"bufferSize",
",",
"numberOfIterations",
")",
"{",
"var",
"bufSize",
"=",
"bufferSize",
"||",
"16000",
",",
"iterations",
"=",
"numberOfIterations",
"||",
"100",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"iterations",
";",
"i... | Generates some random audio input data and dispatches an audioinput event for each buffer
@param bufferSize
@param numberOfIterations | [
"Generates",
"some",
"random",
"audio",
"input",
"data",
"and",
"dispatches",
"an",
"audioinput",
"event",
"for",
"each",
"buffer"
] | 9458b48584e7538483c5e4fa049bd441c1ee9d7c | https://github.com/edimuj/cordova-plugin-audioinput/blob/9458b48584e7538483c5e4fa049bd441c1ee9d7c/demo/utils.js#L35-L52 | train | |
edimuj/cordova-plugin-audioinput | demo/events-demo.js | function () {
var duration = 50;
// Check if there is any data in the queue
if (audioDataQueue.length > 0) {
// Concatenate up to concatenateMaxChunks data arrays from the queue
var concatenatedData = [];
for (var i = 0; i < concatenateMaxChunks; i++) {
if (audioDataQue... | javascript | function () {
var duration = 50;
// Check if there is any data in the queue
if (audioDataQueue.length > 0) {
// Concatenate up to concatenateMaxChunks data arrays from the queue
var concatenatedData = [];
for (var i = 0; i < concatenateMaxChunks; i++) {
if (audioDataQue... | [
"function",
"(",
")",
"{",
"var",
"duration",
"=",
"50",
";",
"// Check if there is any data in the queue",
"if",
"(",
"audioDataQueue",
".",
"length",
">",
"0",
")",
"{",
"// Concatenate up to concatenateMaxChunks data arrays from the queue",
"var",
"concatenatedData",
"... | Consume data from the audioinput queue and calls the playAudio method | [
"Consume",
"data",
"from",
"the",
"audioinput",
"queue",
"and",
"calls",
"the",
"playAudio",
"method"
] | 9458b48584e7538483c5e4fa049bd441c1ee9d7c | https://github.com/edimuj/cordova-plugin-audioinput/blob/9458b48584e7538483c5e4fa049bd441c1ee9d7c/demo/events-demo.js#L56-L79 | train | |
edimuj/cordova-plugin-audioinput | demo/events-demo.js | function (data) {
try {
// Create an audio buffer to hold the data
var audioBuffer = audioContext.createBuffer(captureCfg.channels, (data.length / captureCfg.channels),
captureCfg.sampleRate);
// Initialize the audio buffer with the data
if (captureCfg.channels > 1) {
... | javascript | function (data) {
try {
// Create an audio buffer to hold the data
var audioBuffer = audioContext.createBuffer(captureCfg.channels, (data.length / captureCfg.channels),
captureCfg.sampleRate);
// Initialize the audio buffer with the data
if (captureCfg.channels > 1) {
... | [
"function",
"(",
"data",
")",
"{",
"try",
"{",
"// Create an audio buffer to hold the data",
"var",
"audioBuffer",
"=",
"audioContext",
".",
"createBuffer",
"(",
"captureCfg",
".",
"channels",
",",
"(",
"data",
".",
"length",
"/",
"captureCfg",
".",
"channels",
... | Play audio from data using the Web Audio API | [
"Play",
"audio",
"from",
"data",
"using",
"the",
"Web",
"Audio",
"API"
] | 9458b48584e7538483c5e4fa049bd441c1ee9d7c | https://github.com/edimuj/cordova-plugin-audioinput/blob/9458b48584e7538483c5e4fa049bd441c1ee9d7c/demo/events-demo.js#L85-L131 | train | |
edimuj/cordova-plugin-audioinput | demo/events-demo.js | function () {
try {
window.AudioContext = window.AudioContext || window.webkitAudioContext;
audioContext = new window.AudioContext();
consoleMessage("Web Audio Context is ready");
}
catch (e) {
consoleMessage('Web Audio API is not supported in this browser: ' + e);
re... | javascript | function () {
try {
window.AudioContext = window.AudioContext || window.webkitAudioContext;
audioContext = new window.AudioContext();
consoleMessage("Web Audio Context is ready");
}
catch (e) {
consoleMessage('Web Audio API is not supported in this browser: ' + e);
re... | [
"function",
"(",
")",
"{",
"try",
"{",
"window",
".",
"AudioContext",
"=",
"window",
".",
"AudioContext",
"||",
"window",
".",
"webkitAudioContext",
";",
"audioContext",
"=",
"new",
"window",
".",
"AudioContext",
"(",
")",
";",
"consoleMessage",
"(",
"\"Web ... | Creates the Web Audio Context and audio nodes for output. | [
"Creates",
"the",
"Web",
"Audio",
"Context",
"and",
"audio",
"nodes",
"for",
"output",
"."
] | 9458b48584e7538483c5e4fa049bd441c1ee9d7c | https://github.com/edimuj/cordova-plugin-audioinput/blob/9458b48584e7538483c5e4fa049bd441c1ee9d7c/demo/events-demo.js#L137-L155 | train | |
m-e-conroy/angular-dialog-service | dist/dialogs.js | function(header,msg,opts){
opts = _setOpts(opts);
return $uibModal.open({
templateUrl : '/dialogs/notify.html',
controller : 'notifyDialogCtrl',
backdrop: opts.bd,
backdropClass: opts.bdc,
keyboard: opts.kb,
windowClass: opts.wc,
size: opts.ws,
animation: opts.... | javascript | function(header,msg,opts){
opts = _setOpts(opts);
return $uibModal.open({
templateUrl : '/dialogs/notify.html',
controller : 'notifyDialogCtrl',
backdrop: opts.bd,
backdropClass: opts.bdc,
keyboard: opts.kb,
windowClass: opts.wc,
size: opts.ws,
animation: opts.... | [
"function",
"(",
"header",
",",
"msg",
",",
"opts",
")",
"{",
"opts",
"=",
"_setOpts",
"(",
"opts",
")",
";",
"return",
"$uibModal",
".",
"open",
"(",
"{",
"templateUrl",
":",
"'/dialogs/notify.html'",
",",
"controller",
":",
"'notifyDialogCtrl'",
",",
"ba... | end wait
Notify Dialog
@param header string
@param msg string
@param opts object | [
"end",
"wait",
"Notify",
"Dialog"
] | e5425c0fbc82536ebc90c1bf43eb06eab505e1c0 | https://github.com/m-e-conroy/angular-dialog-service/blob/e5425c0fbc82536ebc90c1bf43eb06eab505e1c0/dist/dialogs.js#L387-L410 | train | |
m-e-conroy/angular-dialog-service | dist/dialogs.js | function(url,ctrlr,data,opts,ctrlAs){
var copy = (opts && angular.isDefined(opts.copy)) ? opts.copy : _copy;
opts = _setOpts(opts);
return $uibModal.open({
templateUrl : url,
controller : ctrlr,
controllerAs : ctrlAs,
keyboard : opts.kb,
backdrop : opts.bd,
backdropCl... | javascript | function(url,ctrlr,data,opts,ctrlAs){
var copy = (opts && angular.isDefined(opts.copy)) ? opts.copy : _copy;
opts = _setOpts(opts);
return $uibModal.open({
templateUrl : url,
controller : ctrlr,
controllerAs : ctrlAs,
keyboard : opts.kb,
backdrop : opts.bd,
backdropCl... | [
"function",
"(",
"url",
",",
"ctrlr",
",",
"data",
",",
"opts",
",",
"ctrlAs",
")",
"{",
"var",
"copy",
"=",
"(",
"opts",
"&&",
"angular",
".",
"isDefined",
"(",
"opts",
".",
"copy",
")",
")",
"?",
"opts",
".",
"copy",
":",
"_copy",
";",
"opts",
... | end confirm
Create Custom Dialog
@param url string
@param ctrlr string
@param data object
@param opts object | [
"end",
"confirm",
"Create",
"Custom",
"Dialog"
] | e5425c0fbc82536ebc90c1bf43eb06eab505e1c0 | https://github.com/m-e-conroy/angular-dialog-service/blob/e5425c0fbc82536ebc90c1bf43eb06eab505e1c0/dist/dialogs.js#L452-L475 | train | |
m-e-conroy/angular-dialog-service | src/dialogs-services.js | function(component, data, opts) {
var copy = (opts && angular.isDefined(opts.copy)) ? opts.copy : _copy;
opts = _setOpts(opts);
return $uibModal.open({
component : component,
keyboard : opts.kb,
backdrop : opts.bd,
backdropClass: opts.bdc,
windowClass: opts.wc,
size: ... | javascript | function(component, data, opts) {
var copy = (opts && angular.isDefined(opts.copy)) ? opts.copy : _copy;
opts = _setOpts(opts);
return $uibModal.open({
component : component,
keyboard : opts.kb,
backdrop : opts.bd,
backdropClass: opts.bdc,
windowClass: opts.wc,
size: ... | [
"function",
"(",
"component",
",",
"data",
",",
"opts",
")",
"{",
"var",
"copy",
"=",
"(",
"opts",
"&&",
"angular",
".",
"isDefined",
"(",
"opts",
".",
"copy",
")",
")",
"?",
"opts",
".",
"copy",
":",
"_copy",
";",
"opts",
"=",
"_setOpts",
"(",
"... | end confirm
Create Custom Dialog specifying a component
@param component string
@param data object
@param opts object | [
"end",
"confirm",
"Create",
"Custom",
"Dialog",
"specifying",
"a",
"component"
] | e5425c0fbc82536ebc90c1bf43eb06eab505e1c0 | https://github.com/m-e-conroy/angular-dialog-service/blob/e5425c0fbc82536ebc90c1bf43eb06eab505e1c0/src/dialogs-services.js#L263-L284 | train | |
tonyganch/gonzales-pe | src/scss/tokenizer.js | pushToken | function pushToken(type, value, column) {
tokens.push({
tn: tn++,
ln: ln,
col: column,
type: type,
value: value
});
} | javascript | function pushToken(type, value, column) {
tokens.push({
tn: tn++,
ln: ln,
col: column,
type: type,
value: value
});
} | [
"function",
"pushToken",
"(",
"type",
",",
"value",
",",
"column",
")",
"{",
"tokens",
".",
"push",
"(",
"{",
"tn",
":",
"tn",
"++",
",",
"ln",
":",
"ln",
",",
"col",
":",
"column",
",",
"type",
":",
"type",
",",
"value",
":",
"value",
"}",
")"... | Add a token to the token list
@param {string} type
@param {string} value | [
"Add",
"a",
"token",
"to",
"the",
"token",
"list"
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/scss/tokenizer.js#L60-L68 | train |
tonyganch/gonzales-pe | src/scss/tokenizer.js | parseMLComment | function parseMLComment(css) {
var start = pos;
// Read the string until we meet `*/`.
// Since we already know first 2 characters (`/*`), start reading
// from `pos + 2`:
for (pos += 2; pos < css.length; pos++) {
if (css.charAt(pos) === '*' && css.charAt(pos + 1) === '/') {
pos++;
... | javascript | function parseMLComment(css) {
var start = pos;
// Read the string until we meet `*/`.
// Since we already know first 2 characters (`/*`), start reading
// from `pos + 2`:
for (pos += 2; pos < css.length; pos++) {
if (css.charAt(pos) === '*' && css.charAt(pos + 1) === '/') {
pos++;
... | [
"function",
"parseMLComment",
"(",
"css",
")",
"{",
"var",
"start",
"=",
"pos",
";",
"// Read the string until we meet `*/`.",
"// Since we already know first 2 characters (`/*`), start reading",
"// from `pos + 2`:",
"for",
"(",
"pos",
"+=",
"2",
";",
"pos",
"<",
"css",
... | Parse a multiline comment
@param {string} css Unparsed part of CSS string | [
"Parse",
"a",
"multiline",
"comment"
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/scss/tokenizer.js#L186-L210 | train |
tonyganch/gonzales-pe | src/scss/tokenizer.js | parseSLComment | function parseSLComment(css) {
var start = pos;
// Read the string until we meet line break.
// Since we already know first 2 characters (`//`), start reading
// from `pos + 2`:
for (pos += 2; pos < css.length; pos++) {
if (css.charAt(pos) === '\n' || css.charAt(pos) === '\r') {
break... | javascript | function parseSLComment(css) {
var start = pos;
// Read the string until we meet line break.
// Since we already know first 2 characters (`//`), start reading
// from `pos + 2`:
for (pos += 2; pos < css.length; pos++) {
if (css.charAt(pos) === '\n' || css.charAt(pos) === '\r') {
break... | [
"function",
"parseSLComment",
"(",
"css",
")",
"{",
"var",
"start",
"=",
"pos",
";",
"// Read the string until we meet line break.",
"// Since we already know first 2 characters (`//`), start reading",
"// from `pos + 2`:",
"for",
"(",
"pos",
"+=",
"2",
";",
"pos",
"<",
"... | Parse a single line comment
@param {string} css Unparsed part of CSS string | [
"Parse",
"a",
"single",
"line",
"comment"
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/scss/tokenizer.js#L216-L231 | train |
tonyganch/gonzales-pe | src/scss/tokenizer.js | getTokens | function getTokens(css) {
// Parse string, character by character:
for (pos = 0; pos < css.length; col++, pos++) {
c = css.charAt(pos);
cn = css.charAt(pos + 1);
// If we meet `/*`, it's a start of a multiline comment.
// Parse following characters as a multiline comment:
if (c ==... | javascript | function getTokens(css) {
// Parse string, character by character:
for (pos = 0; pos < css.length; col++, pos++) {
c = css.charAt(pos);
cn = css.charAt(pos + 1);
// If we meet `/*`, it's a start of a multiline comment.
// Parse following characters as a multiline comment:
if (c ==... | [
"function",
"getTokens",
"(",
"css",
")",
"{",
"// Parse string, character by character:",
"for",
"(",
"pos",
"=",
"0",
";",
"pos",
"<",
"css",
".",
"length",
";",
"col",
"++",
",",
"pos",
"++",
")",
"{",
"c",
"=",
"css",
".",
"charAt",
"(",
"pos",
"... | Convert a CSS string to a list of tokens
@param {string} css CSS string
@returns {Array} List of tokens
@private | [
"Convert",
"a",
"CSS",
"string",
"to",
"a",
"list",
"of",
"tokens"
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/scss/tokenizer.js#L239-L319 | train |
tonyganch/gonzales-pe | src/sass/parse.js | checkArgument | function checkArgument(i) {
let l;
if (l = checkBrackets(i)) tokens[i].argument_child = 1;
else if (l = checkParentheses(i)) tokens[i].argument_child = 2;
else if (l = checkSingleValueDeclaration(i)) tokens[i].argument_child = 3;
else if (l = checkFunctionsList(i)) tokens[i].argument_child = 4;
else if (l ... | javascript | function checkArgument(i) {
let l;
if (l = checkBrackets(i)) tokens[i].argument_child = 1;
else if (l = checkParentheses(i)) tokens[i].argument_child = 2;
else if (l = checkSingleValueDeclaration(i)) tokens[i].argument_child = 3;
else if (l = checkFunctionsList(i)) tokens[i].argument_child = 4;
else if (l ... | [
"function",
"checkArgument",
"(",
"i",
")",
"{",
"let",
"l",
";",
"if",
"(",
"l",
"=",
"checkBrackets",
"(",
"i",
")",
")",
"tokens",
"[",
"i",
"]",
".",
"argument_child",
"=",
"1",
";",
"else",
"if",
"(",
"l",
"=",
"checkParentheses",
"(",
"i",
... | Checks if token is valid to be part of arguments list
@param {number} i Token's index number
@return {number} Length of argument | [
"Checks",
"if",
"token",
"is",
"valid",
"to",
"be",
"part",
"of",
"arguments",
"list"
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/sass/parse.js#L473-L504 | train |
tonyganch/gonzales-pe | src/sass/parse.js | getClass | function getClass() {
const type = NodeType.ClassType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
const end = token.classEnd;
let content = [];
// Skip `.`
pos++;
while (pos < end) {
if (checkIdentOrInterpolation(pos)) {
content = content.concat(getIdentOrI... | javascript | function getClass() {
const type = NodeType.ClassType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
const end = token.classEnd;
let content = [];
// Skip `.`
pos++;
while (pos < end) {
if (checkIdentOrInterpolation(pos)) {
content = content.concat(getIdentOrI... | [
"function",
"getClass",
"(",
")",
"{",
"const",
"type",
"=",
"NodeType",
".",
"ClassType",
";",
"const",
"token",
"=",
"tokens",
"[",
"pos",
"]",
";",
"const",
"line",
"=",
"token",
".",
"ln",
";",
"const",
"column",
"=",
"token",
".",
"col",
";",
... | Gets node with a class selector.
@return {!Node} | [
"Gets",
"node",
"with",
"a",
"class",
"selector",
"."
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/sass/parse.js#L1285-L1303 | train |
tonyganch/gonzales-pe | src/sass/parse.js | getCommentSL | function getCommentSL() {
const type = NodeType.CommentSLType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
const content = tokens[pos++].value.substring(2);
const end = !content ? [line, column + 1]
: getLastPosition(content, line, column + 2);
return newNode(type, con... | javascript | function getCommentSL() {
const type = NodeType.CommentSLType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
const content = tokens[pos++].value.substring(2);
const end = !content ? [line, column + 1]
: getLastPosition(content, line, column + 2);
return newNode(type, con... | [
"function",
"getCommentSL",
"(",
")",
"{",
"const",
"type",
"=",
"NodeType",
".",
"CommentSLType",
";",
"const",
"token",
"=",
"tokens",
"[",
"pos",
"]",
";",
"const",
"line",
"=",
"token",
".",
"ln",
";",
"const",
"column",
"=",
"token",
".",
"col",
... | Get node with a single-line comment.
@return {Array} `['commentSL', x]` where `x` is comment's message
(without `//`) | [
"Get",
"node",
"with",
"a",
"single",
"-",
"line",
"comment",
"."
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/sass/parse.js#L1517-L1527 | train |
tonyganch/gonzales-pe | src/sass/parse.js | checkDeclDelim | function checkDeclDelim(i) {
if (i >= tokensLength) return 0;
return (tokens[i].type === TokenType.Newline ||
tokens[i].type === TokenType.Semicolon) ? 1 : 0;
} | javascript | function checkDeclDelim(i) {
if (i >= tokensLength) return 0;
return (tokens[i].type === TokenType.Newline ||
tokens[i].type === TokenType.Semicolon) ? 1 : 0;
} | [
"function",
"checkDeclDelim",
"(",
"i",
")",
"{",
"if",
"(",
"i",
">=",
"tokensLength",
")",
"return",
"0",
";",
"return",
"(",
"tokens",
"[",
"i",
"]",
".",
"type",
"===",
"TokenType",
".",
"Newline",
"||",
"tokens",
"[",
"i",
"]",
".",
"type",
"=... | Check if token is a semicolon
@param {number} i Token's index number
@return {number} `1` if token is a semicolon, otherwise `0` | [
"Check",
"if",
"token",
"is",
"a",
"semicolon"
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/sass/parse.js#L1819-L1824 | train |
tonyganch/gonzales-pe | src/sass/parse.js | getDeclDelim | function getDeclDelim() {
const type = NodeType.DeclDelimType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
const content = '\n';
pos++;
return newNode(type, content, line, column);
} | javascript | function getDeclDelim() {
const type = NodeType.DeclDelimType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
const content = '\n';
pos++;
return newNode(type, content, line, column);
} | [
"function",
"getDeclDelim",
"(",
")",
"{",
"const",
"type",
"=",
"NodeType",
".",
"DeclDelimType",
";",
"const",
"token",
"=",
"tokens",
"[",
"pos",
"]",
";",
"const",
"line",
"=",
"token",
".",
"ln",
";",
"const",
"column",
"=",
"token",
".",
"col",
... | Get node with a semicolon
@return {Array} `['declDelim']` | [
"Get",
"node",
"with",
"a",
"semicolon"
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/sass/parse.js#L1830-L1840 | train |
tonyganch/gonzales-pe | src/sass/parse.js | getDefault | function getDefault() {
const type = NodeType.DefaultType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
const content = joinValues(pos, token.defaultEnd);
pos = token.defaultEnd + 1;
return newNode(type, content, line, column);
} | javascript | function getDefault() {
const type = NodeType.DefaultType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
const content = joinValues(pos, token.defaultEnd);
pos = token.defaultEnd + 1;
return newNode(type, content, line, column);
} | [
"function",
"getDefault",
"(",
")",
"{",
"const",
"type",
"=",
"NodeType",
".",
"DefaultType",
";",
"const",
"token",
"=",
"tokens",
"[",
"pos",
"]",
";",
"const",
"line",
"=",
"token",
".",
"ln",
";",
"const",
"column",
"=",
"token",
".",
"col",
";"... | Get node with a `!default` word
@return {Array} `['default', sc]` where `sc` is optional whitespace | [
"Get",
"node",
"with",
"a",
"!default",
"word"
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/sass/parse.js#L1868-L1878 | train |
tonyganch/gonzales-pe | src/sass/parse.js | getDelim | function getDelim() {
const type = NodeType.DelimType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
const content = ',';
pos++;
return newNode(type, content, line, column);
} | javascript | function getDelim() {
const type = NodeType.DelimType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
const content = ',';
pos++;
return newNode(type, content, line, column);
} | [
"function",
"getDelim",
"(",
")",
"{",
"const",
"type",
"=",
"NodeType",
".",
"DelimType",
";",
"const",
"token",
"=",
"tokens",
"[",
"pos",
"]",
";",
"const",
"line",
"=",
"token",
".",
"ln",
";",
"const",
"column",
"=",
"token",
".",
"col",
";",
... | Get node with a comma
@return {Array} `['delim']` | [
"Get",
"node",
"with",
"a",
"comma"
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/sass/parse.js#L1893-L1903 | train |
tonyganch/gonzales-pe | src/sass/parse.js | getDimension | function getDimension() {
const type = NodeType.DimensionType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
const content = [
getNumber(),
getUnit()
];
return newNode(type, content, line, column);
} | javascript | function getDimension() {
const type = NodeType.DimensionType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
const content = [
getNumber(),
getUnit()
];
return newNode(type, content, line, column);
} | [
"function",
"getDimension",
"(",
")",
"{",
"const",
"type",
"=",
"NodeType",
".",
"DimensionType",
";",
"const",
"token",
"=",
"tokens",
"[",
"pos",
"]",
";",
"const",
"line",
"=",
"token",
".",
"ln",
";",
"const",
"column",
"=",
"token",
".",
"col",
... | Get node of a number with dimension unit
@return {Node} | [
"Get",
"node",
"of",
"a",
"number",
"with",
"dimension",
"unit"
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/sass/parse.js#L1925-L1936 | train |
tonyganch/gonzales-pe | src/sass/parse.js | getFunctionsList | function getFunctionsList() {
const type = NodeType.FunctionsListType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
const content = [getFunction()];
const end = getLastPosition(content, line, column, 3);
// Skip `...`.
pos += 3;
return newNode(type, content, line, colu... | javascript | function getFunctionsList() {
const type = NodeType.FunctionsListType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
const content = [getFunction()];
const end = getLastPosition(content, line, column, 3);
// Skip `...`.
pos += 3;
return newNode(type, content, line, colu... | [
"function",
"getFunctionsList",
"(",
")",
"{",
"const",
"type",
"=",
"NodeType",
".",
"FunctionsListType",
";",
"const",
"token",
"=",
"tokens",
"[",
"pos",
"]",
";",
"const",
"line",
"=",
"token",
".",
"ln",
";",
"const",
"column",
"=",
"token",
".",
... | Get node with a functions list
@returns {Array} | [
"Get",
"node",
"with",
"a",
"functions",
"list"
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/sass/parse.js#L2134-L2146 | train |
tonyganch/gonzales-pe | src/sass/parse.js | getIdent | function getIdent() {
const type = NodeType.IdentType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
const content = joinValues(pos, tokens[pos].ident_last);
pos = tokens[pos].ident_last + 1;
return newNode(type, content, line, column);
} | javascript | function getIdent() {
const type = NodeType.IdentType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
const content = joinValues(pos, tokens[pos].ident_last);
pos = tokens[pos].ident_last + 1;
return newNode(type, content, line, column);
} | [
"function",
"getIdent",
"(",
")",
"{",
"const",
"type",
"=",
"NodeType",
".",
"IdentType",
";",
"const",
"token",
"=",
"tokens",
"[",
"pos",
"]",
";",
"const",
"line",
"=",
"token",
".",
"ln",
";",
"const",
"column",
"=",
"token",
".",
"col",
";",
... | Get node with an identifier
@return {Array} `['ident', x]` where `x` is identifier's name | [
"Get",
"node",
"with",
"an",
"identifier"
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/sass/parse.js#L2226-L2236 | train |
tonyganch/gonzales-pe | src/sass/parse.js | checkImportant | function checkImportant(i) {
const start = i;
let l;
if (i >= tokensLength ||
tokens[i++].type !== TokenType.ExclamationMark) return 0;
if (l = checkSC(i)) i += l;
if (tokens[i].value === 'important') {
tokens[start].importantEnd = i;
return i - start + 1;
} else {
return 0;
}
} | javascript | function checkImportant(i) {
const start = i;
let l;
if (i >= tokensLength ||
tokens[i++].type !== TokenType.ExclamationMark) return 0;
if (l = checkSC(i)) i += l;
if (tokens[i].value === 'important') {
tokens[start].importantEnd = i;
return i - start + 1;
} else {
return 0;
}
} | [
"function",
"checkImportant",
"(",
"i",
")",
"{",
"const",
"start",
"=",
"i",
";",
"let",
"l",
";",
"if",
"(",
"i",
">=",
"tokensLength",
"||",
"tokens",
"[",
"i",
"++",
"]",
".",
"type",
"!==",
"TokenType",
".",
"ExclamationMark",
")",
"return",
"0"... | Check if token is part of `!important` word
@param {number} i Token's index number
@return {number} | [
"Check",
"if",
"token",
"is",
"part",
"of",
"!important",
"word"
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/sass/parse.js#L2309-L2324 | train |
tonyganch/gonzales-pe | src/sass/parse.js | checkInclude | function checkInclude(i) {
let l;
if (i >= tokensLength) return 0;
if (l = checkIncludeWithKeyframes1(i)) tokens[i].include_type = 9;
else if (l = checkInclude1(i)) tokens[i].include_type = 1;
else if (l = checkInclude2(i)) tokens[i].include_type = 2;
else if (l = checkInclude3(i)) tokens[i].include_type ... | javascript | function checkInclude(i) {
let l;
if (i >= tokensLength) return 0;
if (l = checkIncludeWithKeyframes1(i)) tokens[i].include_type = 9;
else if (l = checkInclude1(i)) tokens[i].include_type = 1;
else if (l = checkInclude2(i)) tokens[i].include_type = 2;
else if (l = checkInclude3(i)) tokens[i].include_type ... | [
"function",
"checkInclude",
"(",
"i",
")",
"{",
"let",
"l",
";",
"if",
"(",
"i",
">=",
"tokensLength",
")",
"return",
"0",
";",
"if",
"(",
"l",
"=",
"checkIncludeWithKeyframes1",
"(",
"i",
")",
")",
"tokens",
"[",
"i",
"]",
".",
"include_type",
"=",
... | Check if token is part of an included mixin (`@include` or `@extend`
directive).
@param {number} i Token's index number
@return {number} Length of the included mixin | [
"Check",
"if",
"token",
"is",
"part",
"of",
"an",
"included",
"mixin",
"("
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/sass/parse.js#L2348-L2365 | train |
tonyganch/gonzales-pe | src/sass/parse.js | getInterpolation | function getInterpolation() {
const type = NodeType.InterpolationType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
let content = [];
// Skip `#{`:
pos += 2;
while (pos < tokensLength &&
tokens[pos].type !== TokenType.RightCurlyBracket) {
const body = getArgume... | javascript | function getInterpolation() {
const type = NodeType.InterpolationType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
let content = [];
// Skip `#{`:
pos += 2;
while (pos < tokensLength &&
tokens[pos].type !== TokenType.RightCurlyBracket) {
const body = getArgume... | [
"function",
"getInterpolation",
"(",
")",
"{",
"const",
"type",
"=",
"NodeType",
".",
"InterpolationType",
";",
"const",
"token",
"=",
"tokens",
"[",
"pos",
"]",
";",
"const",
"line",
"=",
"token",
".",
"ln",
";",
"const",
"column",
"=",
"token",
".",
... | Get node with an interpolated variable
@return {Array} `['interpolation', x]` | [
"Get",
"node",
"with",
"an",
"interpolated",
"variable"
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/sass/parse.js#L2896-L2919 | train |
tonyganch/gonzales-pe | src/sass/parse.js | checkKeyframesRule | function checkKeyframesRule(i) {
const start = i;
let l;
if (i >= tokensLength) return 0;
if (l = checkAtkeyword(i)) i += l;
else return 0;
const atruleName = joinValues2(i - l, l);
if (atruleName.toLowerCase().indexOf('keyframes') === -1) return 0;
if (l = checkSC(i)) i += l;
else return 0;
if... | javascript | function checkKeyframesRule(i) {
const start = i;
let l;
if (i >= tokensLength) return 0;
if (l = checkAtkeyword(i)) i += l;
else return 0;
const atruleName = joinValues2(i - l, l);
if (atruleName.toLowerCase().indexOf('keyframes') === -1) return 0;
if (l = checkSC(i)) i += l;
else return 0;
if... | [
"function",
"checkKeyframesRule",
"(",
"i",
")",
"{",
"const",
"start",
"=",
"i",
";",
"let",
"l",
";",
"if",
"(",
"i",
">=",
"tokensLength",
")",
"return",
"0",
";",
"if",
"(",
"l",
"=",
"checkAtkeyword",
"(",
"i",
")",
")",
"i",
"+=",
"l",
";",... | Check if token is part of a @keyframes rule.
@param {number} i Token's index number
@return {number} Length of the @keyframes rule | [
"Check",
"if",
"token",
"is",
"part",
"of",
"a"
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/sass/parse.js#L3018-L3042 | train |
tonyganch/gonzales-pe | src/sass/parse.js | checkKeyframesSelector | function checkKeyframesSelector(i) {
const start = i;
let l;
if (i >= tokensLength) return 0;
if (l = checkIdent(i)) {
// Valid selectors are only `from` and `to`.
const selector = joinValues2(i, l);
if (selector !== 'from' && selector !== 'to') return 0;
i += l;
tokens[start].keyframesSe... | javascript | function checkKeyframesSelector(i) {
const start = i;
let l;
if (i >= tokensLength) return 0;
if (l = checkIdent(i)) {
// Valid selectors are only `from` and `to`.
const selector = joinValues2(i, l);
if (selector !== 'from' && selector !== 'to') return 0;
i += l;
tokens[start].keyframesSe... | [
"function",
"checkKeyframesSelector",
"(",
"i",
")",
"{",
"const",
"start",
"=",
"i",
";",
"let",
"l",
";",
"if",
"(",
"i",
">=",
"tokensLength",
")",
"return",
"0",
";",
"if",
"(",
"l",
"=",
"checkIdent",
"(",
"i",
")",
")",
"{",
"// Valid selectors... | Check a single keyframe selector - `5%`, `from` etc
@param {Number} i
@return {Number} | [
"Check",
"a",
"single",
"keyframe",
"selector",
"-",
"5%",
"from",
"etc"
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/sass/parse.js#L3076-L3100 | train |
tonyganch/gonzales-pe | src/sass/parse.js | getLoop | function getLoop() {
const type = NodeType.LoopType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
let content = [];
content.push(getAtkeyword());
while (pos < tokensLength) {
if (checkBlock(pos)) {
content.push(getBlock());
break;
}
else if (checkVa... | javascript | function getLoop() {
const type = NodeType.LoopType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
let content = [];
content.push(getAtkeyword());
while (pos < tokensLength) {
if (checkBlock(pos)) {
content.push(getBlock());
break;
}
else if (checkVa... | [
"function",
"getLoop",
"(",
")",
"{",
"const",
"type",
"=",
"NodeType",
".",
"LoopType",
";",
"const",
"token",
"=",
"tokens",
"[",
"pos",
"]",
";",
"const",
"line",
"=",
"token",
".",
"ln",
";",
"const",
"column",
"=",
"token",
".",
"col",
";",
"l... | Get node with a loop.
@return {Array} `['loop', x]` | [
"Get",
"node",
"with",
"a",
"loop",
"."
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/sass/parse.js#L3246-L3271 | train |
tonyganch/gonzales-pe | src/sass/parse.js | getNamespace | function getNamespace() {
const type = NodeType.NamespaceType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
const content = '|';
pos++;
return newNode(type, content, line, column);
} | javascript | function getNamespace() {
const type = NodeType.NamespaceType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
const content = '|';
pos++;
return newNode(type, content, line, column);
} | [
"function",
"getNamespace",
"(",
")",
"{",
"const",
"type",
"=",
"NodeType",
".",
"NamespaceType",
";",
"const",
"token",
"=",
"tokens",
"[",
"pos",
"]",
";",
"const",
"line",
"=",
"token",
".",
"ln",
";",
"const",
"column",
"=",
"token",
".",
"col",
... | Get node with a namespace sign
@return {Array} `['namespace']` | [
"Get",
"node",
"with",
"a",
"namespace",
"sign"
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/sass/parse.js#L3433-L3443 | train |
tonyganch/gonzales-pe | src/sass/parse.js | checkNumber | function checkNumber(i) {
if (i >= tokensLength) return 0;
if (tokens[i].number_l) return tokens[i].number_l;
// `10`:
if (i < tokensLength && tokens[i].type === TokenType.DecimalNumber &&
(!tokens[i + 1] ||
(tokens[i + 1] && tokens[i + 1].type !== TokenType.FullStop))) {
tokens[i].number_l = ... | javascript | function checkNumber(i) {
if (i >= tokensLength) return 0;
if (tokens[i].number_l) return tokens[i].number_l;
// `10`:
if (i < tokensLength && tokens[i].type === TokenType.DecimalNumber &&
(!tokens[i + 1] ||
(tokens[i + 1] && tokens[i + 1].type !== TokenType.FullStop))) {
tokens[i].number_l = ... | [
"function",
"checkNumber",
"(",
"i",
")",
"{",
"if",
"(",
"i",
">=",
"tokensLength",
")",
"return",
"0",
";",
"if",
"(",
"tokens",
"[",
"i",
"]",
".",
"number_l",
")",
"return",
"tokens",
"[",
"i",
"]",
".",
"number_l",
";",
"// `10`:",
"if",
"(",
... | Check if token is part of a number
@param {number} i Token's index number
@return {number} Length of number | [
"Check",
"if",
"token",
"is",
"part",
"of",
"a",
"number"
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/sass/parse.js#L3476-L3516 | train |
tonyganch/gonzales-pe | src/sass/parse.js | getNumber | function getNumber() {
const type = NodeType.NumberType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
const l = tokens[pos].number_l;
let content = '';
for (let j = 0; j < l; j++) {
content += tokens[pos + j].value;
}
pos += l;
return newNode(type, content, line... | javascript | function getNumber() {
const type = NodeType.NumberType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
const l = tokens[pos].number_l;
let content = '';
for (let j = 0; j < l; j++) {
content += tokens[pos + j].value;
}
pos += l;
return newNode(type, content, line... | [
"function",
"getNumber",
"(",
")",
"{",
"const",
"type",
"=",
"NodeType",
".",
"NumberType",
";",
"const",
"token",
"=",
"tokens",
"[",
"pos",
"]",
";",
"const",
"line",
"=",
"token",
".",
"ln",
";",
"const",
"column",
"=",
"token",
".",
"col",
";",
... | Get node with number
@return {Array} `['number', x]` where `x` is a number converted
to string. | [
"Get",
"node",
"with",
"number"
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/sass/parse.js#L3523-L3538 | train |
tonyganch/gonzales-pe | src/sass/parse.js | getOperator | function getOperator() {
const type = NodeType.OperatorType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
const content = token.value;
pos++;
return newNode(type, content, line, column);
} | javascript | function getOperator() {
const type = NodeType.OperatorType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
const content = token.value;
pos++;
return newNode(type, content, line, column);
} | [
"function",
"getOperator",
"(",
")",
"{",
"const",
"type",
"=",
"NodeType",
".",
"OperatorType",
";",
"const",
"token",
"=",
"tokens",
"[",
"pos",
"]",
";",
"const",
"line",
"=",
"token",
".",
"ln",
";",
"const",
"column",
"=",
"token",
".",
"col",
"... | Get node with an operator
@return {Array} `['operator', x]` where `x` is an operator converted
to string. | [
"Get",
"node",
"with",
"an",
"operator"
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/sass/parse.js#L3570-L3580 | train |
tonyganch/gonzales-pe | src/sass/parse.js | getParentSelector | function getParentSelector() {
const type = NodeType.ParentSelectorType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
const content = '&';
pos++;
return newNode(type, content, line, column);
} | javascript | function getParentSelector() {
const type = NodeType.ParentSelectorType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
const content = '&';
pos++;
return newNode(type, content, line, column);
} | [
"function",
"getParentSelector",
"(",
")",
"{",
"const",
"type",
"=",
"NodeType",
".",
"ParentSelectorType",
";",
"const",
"token",
"=",
"tokens",
"[",
"pos",
"]",
";",
"const",
"line",
"=",
"token",
".",
"ln",
";",
"const",
"column",
"=",
"token",
".",
... | Get node with a parent selector
@return {Node} | [
"Get",
"node",
"with",
"a",
"parent",
"selector"
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/sass/parse.js#L3686-L3696 | train |
tonyganch/gonzales-pe | src/sass/parse.js | getPercentage | function getPercentage() {
const type = NodeType.PercentageType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
const content = getNumberOrInterpolation();
const end = getLastPosition(content, line, column, 1);
// Skip `%`.
pos++;
return newNode(type, content, line, colu... | javascript | function getPercentage() {
const type = NodeType.PercentageType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
const content = getNumberOrInterpolation();
const end = getLastPosition(content, line, column, 1);
// Skip `%`.
pos++;
return newNode(type, content, line, colu... | [
"function",
"getPercentage",
"(",
")",
"{",
"const",
"type",
"=",
"NodeType",
".",
"PercentageType",
";",
"const",
"token",
"=",
"tokens",
"[",
"pos",
"]",
";",
"const",
"line",
"=",
"token",
".",
"ln",
";",
"const",
"column",
"=",
"token",
".",
"col",... | Get a percentage node that contains either a number or an interpolation
@return {Object} The percentage node | [
"Get",
"a",
"percentage",
"node",
"that",
"contains",
"either",
"a",
"number",
"or",
"an",
"interpolation"
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/sass/parse.js#L3799-L3811 | train |
tonyganch/gonzales-pe | src/sass/parse.js | checkNumberOrInterpolation | function checkNumberOrInterpolation(i) {
const start = i;
let l;
while (i < tokensLength) {
if (l = checkInterpolation(i) || checkNumber(i)) i += l;
else break;
}
return i - start;
} | javascript | function checkNumberOrInterpolation(i) {
const start = i;
let l;
while (i < tokensLength) {
if (l = checkInterpolation(i) || checkNumber(i)) i += l;
else break;
}
return i - start;
} | [
"function",
"checkNumberOrInterpolation",
"(",
"i",
")",
"{",
"const",
"start",
"=",
"i",
";",
"let",
"l",
";",
"while",
"(",
"i",
"<",
"tokensLength",
")",
"{",
"if",
"(",
"l",
"=",
"checkInterpolation",
"(",
"i",
")",
"||",
"checkNumber",
"(",
"i",
... | Check if token is a number or an interpolation
@param {number} i Token's index number
@return {number} | [
"Check",
"if",
"token",
"is",
"a",
"number",
"or",
"an",
"interpolation"
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/sass/parse.js#L3818-L3828 | train |
tonyganch/gonzales-pe | src/sass/parse.js | getPlaceholder | function getPlaceholder() {
const type = NodeType.PlaceholderType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
let content = [];
// Skip `%`.
pos++;
content = content.concat(getIdentOrInterpolation());
return newNode(type, content, line, column);
} | javascript | function getPlaceholder() {
const type = NodeType.PlaceholderType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
let content = [];
// Skip `%`.
pos++;
content = content.concat(getIdentOrInterpolation());
return newNode(type, content, line, column);
} | [
"function",
"getPlaceholder",
"(",
")",
"{",
"const",
"type",
"=",
"NodeType",
".",
"PlaceholderType",
";",
"const",
"token",
"=",
"tokens",
"[",
"pos",
"]",
";",
"const",
"line",
"=",
"token",
".",
"ln",
";",
"const",
"column",
"=",
"token",
".",
"col... | Get node with a placeholder selector
@return {Array} `['placeholder', ['ident', x]]` where x is a placeholder's
identifier (without `%`, e.g. `abc`). | [
"Get",
"node",
"with",
"a",
"placeholder",
"selector"
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/sass/parse.js#L3876-L3889 | train |
tonyganch/gonzales-pe | src/sass/parse.js | checkCustomProperty | function checkCustomProperty(i) {
const start = i;
let l;
if (i >= tokensLength) return 0;
if (tokens[i].type !== TokenType.HyphenMinus ||
tokens[i + 1] && tokens[i + 1].type !== TokenType.HyphenMinus) return 0;
// Skip `--`
i += 2;
if (l = checkIdentOrInterpolation(i)) i += l;
else return 0;
... | javascript | function checkCustomProperty(i) {
const start = i;
let l;
if (i >= tokensLength) return 0;
if (tokens[i].type !== TokenType.HyphenMinus ||
tokens[i + 1] && tokens[i + 1].type !== TokenType.HyphenMinus) return 0;
// Skip `--`
i += 2;
if (l = checkIdentOrInterpolation(i)) i += l;
else return 0;
... | [
"function",
"checkCustomProperty",
"(",
"i",
")",
"{",
"const",
"start",
"=",
"i",
";",
"let",
"l",
";",
"if",
"(",
"i",
">=",
"tokensLength",
")",
"return",
"0",
";",
"if",
"(",
"tokens",
"[",
"i",
"]",
".",
"type",
"!==",
"TokenType",
".",
"Hyphe... | Check if token is part of a custom property
@param {Number} i Token's index number
@return {Number} Length of the property | [
"Check",
"if",
"token",
"is",
"part",
"of",
"a",
"custom",
"property"
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/sass/parse.js#L4049-L4065 | train |
tonyganch/gonzales-pe | src/sass/parse.js | getCustomProperty | function getCustomProperty() {
const type = NodeType.CustomPropertyType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
// Skip `--`
pos += 2;
const content = getIdentOrInterpolation();
return newNode(type, content, line, column);
} | javascript | function getCustomProperty() {
const type = NodeType.CustomPropertyType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
// Skip `--`
pos += 2;
const content = getIdentOrInterpolation();
return newNode(type, content, line, column);
} | [
"function",
"getCustomProperty",
"(",
")",
"{",
"const",
"type",
"=",
"NodeType",
".",
"CustomPropertyType",
";",
"const",
"token",
"=",
"tokens",
"[",
"pos",
"]",
";",
"const",
"line",
"=",
"token",
".",
"ln",
";",
"const",
"column",
"=",
"token",
".",
... | Get node with a custom property
@return {Node} | [
"Get",
"node",
"with",
"a",
"custom",
"property"
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/sass/parse.js#L4071-L4083 | train |
tonyganch/gonzales-pe | src/sass/parse.js | getPropertyDelim | function getPropertyDelim() {
const type = NodeType.PropertyDelimType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
const content = ':';
// Skip `:`.
pos++;
return newNode(type, content, line, column);
} | javascript | function getPropertyDelim() {
const type = NodeType.PropertyDelimType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
const content = ':';
// Skip `:`.
pos++;
return newNode(type, content, line, column);
} | [
"function",
"getPropertyDelim",
"(",
")",
"{",
"const",
"type",
"=",
"NodeType",
".",
"PropertyDelimType",
";",
"const",
"token",
"=",
"tokens",
"[",
"pos",
"]",
";",
"const",
"line",
"=",
"token",
".",
"ln",
";",
"const",
"column",
"=",
"token",
".",
... | Get node with a colon
@return {Array} `['propertyDelim']` | [
"Get",
"node",
"with",
"a",
"colon"
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/sass/parse.js#L4098-L4109 | train |
tonyganch/gonzales-pe | src/sass/parse.js | getS | function getS() {
const type = NodeType.SType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
const content = joinValues(pos, tokens[pos].ws_last);
pos = tokens[pos].ws_last + 1;
return newNode(type, content, line, column);
} | javascript | function getS() {
const type = NodeType.SType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
const content = joinValues(pos, tokens[pos].ws_last);
pos = tokens[pos].ws_last + 1;
return newNode(type, content, line, column);
} | [
"function",
"getS",
"(",
")",
"{",
"const",
"type",
"=",
"NodeType",
".",
"SType",
";",
"const",
"token",
"=",
"tokens",
"[",
"pos",
"]",
";",
"const",
"line",
"=",
"token",
".",
"ln",
";",
"const",
"column",
"=",
"token",
".",
"col",
";",
"const",... | Get node with spaces
@return {Array} `['s', x]` where `x` is a string containing spaces | [
"Get",
"node",
"with",
"spaces"
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/sass/parse.js#L4816-L4826 | train |
tonyganch/gonzales-pe | src/sass/parse.js | checkMultilineSC | function checkMultilineSC(i) {
if (!tokens[i]) return 0;
let l;
let lsc = 0;
while (i < tokensLength) {
if (!(l = checkS(i)) &&
!(l = checkCommentML(i)) &&
!(l = checkCommentSL(i))) break;
i += l;
lsc += l;
}
return lsc || 0;
} | javascript | function checkMultilineSC(i) {
if (!tokens[i]) return 0;
let l;
let lsc = 0;
while (i < tokensLength) {
if (!(l = checkS(i)) &&
!(l = checkCommentML(i)) &&
!(l = checkCommentSL(i))) break;
i += l;
lsc += l;
}
return lsc || 0;
} | [
"function",
"checkMultilineSC",
"(",
"i",
")",
"{",
"if",
"(",
"!",
"tokens",
"[",
"i",
"]",
")",
"return",
"0",
";",
"let",
"l",
";",
"let",
"lsc",
"=",
"0",
";",
"while",
"(",
"i",
"<",
"tokensLength",
")",
"{",
"if",
"(",
"!",
"(",
"l",
"=... | Check if token is a space, newline, or a comment.
@param {number} i Token's index number
@return {number} Number of similar (space, newline, or comment) tokens
in a row starting with the given token. | [
"Check",
"if",
"token",
"is",
"a",
"space",
"newline",
"or",
"a",
"comment",
"."
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/sass/parse.js#L4834-L4850 | train |
tonyganch/gonzales-pe | src/sass/parse.js | getString | function getString() {
const type = NodeType.StringType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
const content = token.value;
pos++;
return newNode(type, content, line, column);
} | javascript | function getString() {
const type = NodeType.StringType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
const content = token.value;
pos++;
return newNode(type, content, line, column);
} | [
"function",
"getString",
"(",
")",
"{",
"const",
"type",
"=",
"NodeType",
".",
"StringType",
";",
"const",
"token",
"=",
"tokens",
"[",
"pos",
"]",
";",
"const",
"line",
"=",
"token",
".",
"ln",
";",
"const",
"column",
"=",
"token",
".",
"col",
";",
... | Get string's node
@return {Array} `['string', x]` where `x` is a string (including
quotes). | [
"Get",
"string",
"s",
"node"
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/sass/parse.js#L5003-L5013 | train |
tonyganch/gonzales-pe | src/sass/parse.js | getUnicodeRange | function getUnicodeRange() {
const type = NodeType.UnicodeRangeType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
let content = [];
while (pos < tokensLength) {
if (checkSC(pos)) content = content.concat(getSC());
else if (checkDelim(pos)) content.push(getDelim());
... | javascript | function getUnicodeRange() {
const type = NodeType.UnicodeRangeType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
let content = [];
while (pos < tokensLength) {
if (checkSC(pos)) content = content.concat(getSC());
else if (checkDelim(pos)) content.push(getDelim());
... | [
"function",
"getUnicodeRange",
"(",
")",
"{",
"const",
"type",
"=",
"NodeType",
".",
"UnicodeRangeType",
";",
"const",
"token",
"=",
"tokens",
"[",
"pos",
"]",
";",
"const",
"line",
"=",
"token",
".",
"ln",
";",
"const",
"column",
"=",
"token",
".",
"c... | Get a unicode range node
@return {Node} | [
"Get",
"a",
"unicode",
"range",
"node"
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/sass/parse.js#L5197-L5212 | train |
tonyganch/gonzales-pe | src/sass/parse.js | getUnit | function getUnit() {
const type = NodeType.IdentType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
const content = token.value;
pos++;
return newNode(type, content, line, column);
} | javascript | function getUnit() {
const type = NodeType.IdentType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
const content = token.value;
pos++;
return newNode(type, content, line, column);
} | [
"function",
"getUnit",
"(",
")",
"{",
"const",
"type",
"=",
"NodeType",
".",
"IdentType",
";",
"const",
"token",
"=",
"tokens",
"[",
"pos",
"]",
";",
"const",
"line",
"=",
"token",
".",
"ln",
";",
"const",
"column",
"=",
"token",
".",
"col",
";",
"... | Get unit node of type ident
@return {Node} An ident node containing the unit value | [
"Get",
"unit",
"node",
"of",
"type",
"ident"
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/sass/parse.js#L5237-L5247 | train |
tonyganch/gonzales-pe | src/sass/parse.js | _checkUnicodeWildcard | function _checkUnicodeWildcard(i) {
const start = i;
if (i >= tokensLength) return 0;
while (i < tokensLength) {
if (tokens[i].type === TokenType.QuestionMark) i += 1;
else break;
}
return i - start;
} | javascript | function _checkUnicodeWildcard(i) {
const start = i;
if (i >= tokensLength) return 0;
while (i < tokensLength) {
if (tokens[i].type === TokenType.QuestionMark) i += 1;
else break;
}
return i - start;
} | [
"function",
"_checkUnicodeWildcard",
"(",
"i",
")",
"{",
"const",
"start",
"=",
"i",
";",
"if",
"(",
"i",
">=",
"tokensLength",
")",
"return",
"0",
";",
"while",
"(",
"i",
"<",
"tokensLength",
")",
"{",
"if",
"(",
"tokens",
"[",
"i",
"]",
".",
"typ... | Check for unicode wildcard characters `?`
@param {number} i Token's index
@return {number} Wildcard length | [
"Check",
"for",
"unicode",
"wildcard",
"characters",
"?"
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/sass/parse.js#L5308-L5319 | train |
tonyganch/gonzales-pe | src/sass/parse.js | getUri | function getUri() {
const startPos = pos;
const type = NodeType.UriType;
const token = tokens[startPos];
const line = token.ln;
const column = token.col;
let content = [];
let end;
const uriType = tokens[startPos].uriType;
// Skip `url` and `(`.
pos += 2;
if (uriType === 1) content = content.co... | javascript | function getUri() {
const startPos = pos;
const type = NodeType.UriType;
const token = tokens[startPos];
const line = token.ln;
const column = token.col;
let content = [];
let end;
const uriType = tokens[startPos].uriType;
// Skip `url` and `(`.
pos += 2;
if (uriType === 1) content = content.co... | [
"function",
"getUri",
"(",
")",
"{",
"const",
"startPos",
"=",
"pos",
";",
"const",
"type",
"=",
"NodeType",
".",
"UriType",
";",
"const",
"token",
"=",
"tokens",
"[",
"startPos",
"]",
";",
"const",
"line",
"=",
"token",
".",
"ln",
";",
"const",
"col... | Get specific type of URI node
@return {Node} Specific type of URI node | [
"Get",
"specific",
"type",
"of",
"URI",
"node"
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/sass/parse.js#L5366-L5390 | train |
tonyganch/gonzales-pe | src/sass/parse.js | checkUriRawCharacters | function checkUriRawCharacters(i) {
const start = i;
let l;
if (l = checkIdent(i)) i += l;
else if (l = checkNumber(i)) i += l;
else {
switch (tokens[i].type) {
case TokenType.ExclamationMark:
case TokenType.NumberSign:
case TokenType.DollarSign:
case TokenType.PercentSign:
... | javascript | function checkUriRawCharacters(i) {
const start = i;
let l;
if (l = checkIdent(i)) i += l;
else if (l = checkNumber(i)) i += l;
else {
switch (tokens[i].type) {
case TokenType.ExclamationMark:
case TokenType.NumberSign:
case TokenType.DollarSign:
case TokenType.PercentSign:
... | [
"function",
"checkUriRawCharacters",
"(",
"i",
")",
"{",
"const",
"start",
"=",
"i",
";",
"let",
"l",
";",
"if",
"(",
"l",
"=",
"checkIdent",
"(",
"i",
")",
")",
"i",
"+=",
"l",
";",
"else",
"if",
"(",
"l",
"=",
"checkNumber",
"(",
"i",
")",
")... | Check if token type is valid URI character
@param {number} i Token's index number
@return {number} Length of raw node | [
"Check",
"if",
"token",
"type",
"is",
"valid",
"URI",
"character"
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/sass/parse.js#L5397-L5440 | train |
tonyganch/gonzales-pe | src/sass/parse.js | checkUriRaw | function checkUriRaw(i) {
const start = i;
let l;
while (i < tokensLength) {
if (checkInterpolation(i) || checkVariable(i)) break;
else if (l = checkUriRawCharacters(i)) i += l;
else break;
}
tokens[start].uri_raw_end = i;
return i - start;
} | javascript | function checkUriRaw(i) {
const start = i;
let l;
while (i < tokensLength) {
if (checkInterpolation(i) || checkVariable(i)) break;
else if (l = checkUriRawCharacters(i)) i += l;
else break;
}
tokens[start].uri_raw_end = i;
return i - start;
} | [
"function",
"checkUriRaw",
"(",
"i",
")",
"{",
"const",
"start",
"=",
"i",
";",
"let",
"l",
";",
"while",
"(",
"i",
"<",
"tokensLength",
")",
"{",
"if",
"(",
"checkInterpolation",
"(",
"i",
")",
"||",
"checkVariable",
"(",
"i",
")",
")",
"break",
"... | Check if content of URI can be contained within a raw node
@param {number} i Token's index number
@return {number} Length of raw node | [
"Check",
"if",
"content",
"of",
"URI",
"can",
"be",
"contained",
"within",
"a",
"raw",
"node"
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/sass/parse.js#L5447-L5460 | train |
tonyganch/gonzales-pe | src/sass/parse.js | getUriRaw | function getUriRaw() {
const startPos = pos;
const type = NodeType.RawType;
const token = tokens[startPos];
const line = token.ln;
const column = token.col;
let content = [];
let l;
while (pos < tokens[startPos].uri_raw_end) {
if (checkInterpolation(pos) || checkVariable(pos)) break;
else if (l... | javascript | function getUriRaw() {
const startPos = pos;
const type = NodeType.RawType;
const token = tokens[startPos];
const line = token.ln;
const column = token.col;
let content = [];
let l;
while (pos < tokens[startPos].uri_raw_end) {
if (checkInterpolation(pos) || checkVariable(pos)) break;
else if (l... | [
"function",
"getUriRaw",
"(",
")",
"{",
"const",
"startPos",
"=",
"pos",
";",
"const",
"type",
"=",
"NodeType",
".",
"RawType",
";",
"const",
"token",
"=",
"tokens",
"[",
"startPos",
"]",
";",
"const",
"line",
"=",
"token",
".",
"ln",
";",
"const",
"... | Get a raw node
@return {Node} | [
"Get",
"a",
"raw",
"node"
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/sass/parse.js#L5466-L5484 | train |
tonyganch/gonzales-pe | src/sass/parse.js | checkVariable | function checkVariable(i) {
const start = i;
let l;
if (i >= tokensLength) return 0;
// Skip `$`.
if (tokens[i].type === TokenType.DollarSign) i++;
else return 0;
if (l = checkIdent(i)) i += l;
else return 0;
return i - start;
} | javascript | function checkVariable(i) {
const start = i;
let l;
if (i >= tokensLength) return 0;
// Skip `$`.
if (tokens[i].type === TokenType.DollarSign) i++;
else return 0;
if (l = checkIdent(i)) i += l;
else return 0;
return i - start;
} | [
"function",
"checkVariable",
"(",
"i",
")",
"{",
"const",
"start",
"=",
"i",
";",
"let",
"l",
";",
"if",
"(",
"i",
">=",
"tokensLength",
")",
"return",
"0",
";",
"// Skip `$`.",
"if",
"(",
"tokens",
"[",
"i",
"]",
".",
"type",
"===",
"TokenType",
"... | Check if token is part of a variable
@param {number} i Token's index number
@return {number} Length of the variable | [
"Check",
"if",
"token",
"is",
"part",
"of",
"a",
"variable"
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/sass/parse.js#L5762-L5776 | train |
tonyganch/gonzales-pe | src/sass/parse.js | getVariablesList | function getVariablesList() {
const type = NodeType.VariablesListType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
const content = [getVariable()];
const end = getLastPosition(content, line, column, 3);
// Skip `...`.
pos += 3;
return newNode(type, content, line, colu... | javascript | function getVariablesList() {
const type = NodeType.VariablesListType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
const content = [getVariable()];
const end = getLastPosition(content, line, column, 3);
// Skip `...`.
pos += 3;
return newNode(type, content, line, colu... | [
"function",
"getVariablesList",
"(",
")",
"{",
"const",
"type",
"=",
"NodeType",
".",
"VariablesListType",
";",
"const",
"token",
"=",
"tokens",
"[",
"pos",
"]",
";",
"const",
"line",
"=",
"token",
".",
"ln",
";",
"const",
"column",
"=",
"token",
".",
... | Get node with a variables list
@return {Array} `['variableslist', ['variable', ['ident', x]]]` where
`x` is a variable name. | [
"Get",
"node",
"with",
"a",
"variables",
"list"
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/sass/parse.js#L5824-L5836 | train |
tonyganch/gonzales-pe | src/sass/parse.js | checkSelector1 | function checkSelector1(i) {
if (i >= tokensLength) return 0;
const start = i;
let l;
if (l = checkCompoundSelector(i)) i += l;
else return 0;
while (i < tokensLength) {
let space = checkSC(i);
const comma = checkCombinator(i + space);
if (!space && !comma) break;
if (comma) {
i +=... | javascript | function checkSelector1(i) {
if (i >= tokensLength) return 0;
const start = i;
let l;
if (l = checkCompoundSelector(i)) i += l;
else return 0;
while (i < tokensLength) {
let space = checkSC(i);
const comma = checkCombinator(i + space);
if (!space && !comma) break;
if (comma) {
i +=... | [
"function",
"checkSelector1",
"(",
"i",
")",
"{",
"if",
"(",
"i",
">=",
"tokensLength",
")",
"return",
"0",
";",
"const",
"start",
"=",
"i",
";",
"let",
"l",
";",
"if",
"(",
"l",
"=",
"checkCompoundSelector",
"(",
"i",
")",
")",
"i",
"+=",
"l",
"... | Checks for selector which starts with a compound selector. | [
"Checks",
"for",
"selector",
"which",
"starts",
"with",
"a",
"compound",
"selector",
"."
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/sass/parse.js#L5942-L5967 | train |
tonyganch/gonzales-pe | src/sass/parse.js | checkSelector2 | function checkSelector2(i) {
if (i >= tokensLength) return 0;
const start = i;
let l;
if (l = checkCombinator(i)) i += l;
else return 0;
while (i < tokensLength) {
const spaceBefore = checkSC(i);
if (l = checkCompoundSelector(i + spaceBefore)) i += spaceBefore + l;
else break;
const spac... | javascript | function checkSelector2(i) {
if (i >= tokensLength) return 0;
const start = i;
let l;
if (l = checkCombinator(i)) i += l;
else return 0;
while (i < tokensLength) {
const spaceBefore = checkSC(i);
if (l = checkCompoundSelector(i + spaceBefore)) i += spaceBefore + l;
else break;
const spac... | [
"function",
"checkSelector2",
"(",
"i",
")",
"{",
"if",
"(",
"i",
">=",
"tokensLength",
")",
"return",
"0",
";",
"const",
"start",
"=",
"i",
";",
"let",
"l",
";",
"if",
"(",
"l",
"=",
"checkCombinator",
"(",
"i",
")",
")",
"i",
"+=",
"l",
";",
... | Checks for a selector that starts with a combinator. | [
"Checks",
"for",
"a",
"selector",
"that",
"starts",
"with",
"a",
"combinator",
"."
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/sass/parse.js#L5992-L6016 | train |
tonyganch/gonzales-pe | src/sass/parse.js | checkTypeSelector | function checkTypeSelector(i) {
if (i >= tokensLength) return 0;
const start = i;
let l;
if (l = checkNamePrefix(i)) i += l;
if (l = checkIdentOrInterpolation(i)) i += l;
else return 0;
return i - start;
} | javascript | function checkTypeSelector(i) {
if (i >= tokensLength) return 0;
const start = i;
let l;
if (l = checkNamePrefix(i)) i += l;
if (l = checkIdentOrInterpolation(i)) i += l;
else return 0;
return i - start;
} | [
"function",
"checkTypeSelector",
"(",
"i",
")",
"{",
"if",
"(",
"i",
">=",
"tokensLength",
")",
"return",
"0",
";",
"const",
"start",
"=",
"i",
";",
"let",
"l",
";",
"if",
"(",
"l",
"=",
"checkNamePrefix",
"(",
"i",
")",
")",
"i",
"+=",
"l",
";",... | Check if token is part of a type selector
@param {number} i Token's index
@return {number} Type selector's length | [
"Check",
"if",
"token",
"is",
"part",
"of",
"a",
"type",
"selector"
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/sass/parse.js#L6210-L6222 | train |
tonyganch/gonzales-pe | src/sass/parse.js | getTypeSelector | function getTypeSelector() {
const type = NodeType.TypeSelectorType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
let content = [];
if (checkNamePrefix(pos)) content.push(getNamePrefix());
content = content.concat(getIdentOrInterpolation());
return newNode(type, content... | javascript | function getTypeSelector() {
const type = NodeType.TypeSelectorType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
let content = [];
if (checkNamePrefix(pos)) content.push(getNamePrefix());
content = content.concat(getIdentOrInterpolation());
return newNode(type, content... | [
"function",
"getTypeSelector",
"(",
")",
"{",
"const",
"type",
"=",
"NodeType",
".",
"TypeSelectorType",
";",
"const",
"token",
"=",
"tokens",
"[",
"pos",
"]",
";",
"const",
"line",
"=",
"token",
".",
"ln",
";",
"const",
"column",
"=",
"token",
".",
"c... | Get type selector node
@return {Node} | [
"Get",
"type",
"selector",
"node"
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/sass/parse.js#L6228-L6240 | train |
tonyganch/gonzales-pe | src/less/parse.js | checkArgument | function checkArgument(i) {
let l;
if (l = checkEscapedString(i)) tokens[i].argument_child = 1;
else if (l = checkDeclaration(i)) tokens[i].argument_child = 2;
else if (l = checkVariablesList(i)) tokens[i].argument_child = 3;
else if (l = checkVariable(i)) tokens[i].argument_child = 4;
else if (l = checkSC... | javascript | function checkArgument(i) {
let l;
if (l = checkEscapedString(i)) tokens[i].argument_child = 1;
else if (l = checkDeclaration(i)) tokens[i].argument_child = 2;
else if (l = checkVariablesList(i)) tokens[i].argument_child = 3;
else if (l = checkVariable(i)) tokens[i].argument_child = 4;
else if (l = checkSC... | [
"function",
"checkArgument",
"(",
"i",
")",
"{",
"let",
"l",
";",
"if",
"(",
"l",
"=",
"checkEscapedString",
"(",
"i",
")",
")",
"tokens",
"[",
"i",
"]",
".",
"argument_child",
"=",
"1",
";",
"else",
"if",
"(",
"l",
"=",
"checkDeclaration",
"(",
"i... | Check if token is valid to be part of arguments list.
@param {Number} i Token's index number
@returns {Number} | [
"Check",
"if",
"token",
"is",
"valid",
"to",
"be",
"part",
"of",
"arguments",
"list",
"."
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/less/parse.js#L424-L448 | train |
tonyganch/gonzales-pe | src/less/parse.js | checkAtrule | function checkAtrule(i) {
let l;
if (i >= tokensLength) return 0;
// If token already has a record of being part of an @-rule,
// return the @-rule's length:
if (tokens[i].atrule_l !== undefined) return tokens[i].atrule_l;
// If token is part of an @-rule, save the rule's type to token.
if (l = checkKe... | javascript | function checkAtrule(i) {
let l;
if (i >= tokensLength) return 0;
// If token already has a record of being part of an @-rule,
// return the @-rule's length:
if (tokens[i].atrule_l !== undefined) return tokens[i].atrule_l;
// If token is part of an @-rule, save the rule's type to token.
if (l = checkKe... | [
"function",
"checkAtrule",
"(",
"i",
")",
"{",
"let",
"l",
";",
"if",
"(",
"i",
">=",
"tokensLength",
")",
"return",
"0",
";",
"// If token already has a record of being part of an @-rule,",
"// return the @-rule's length:",
"if",
"(",
"tokens",
"[",
"i",
"]",
"."... | Check if token is a part of an @-rule
@param {Number} i Token's index number
@returns {Number} Length of @-rule | [
"Check",
"if",
"token",
"is",
"a",
"part",
"of",
"an"
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/less/parse.js#L517-L540 | train |
tonyganch/gonzales-pe | src/less/parse.js | checkAtruler | function checkAtruler(i) {
const start = i;
let l;
if (i >= tokensLength) return 0;
if (l = checkAtkeyword(i)) i += l;
else return 0;
if (l = checkTsets(i)) i += l;
if (i < tokensLength && tokens[i].type === TokenType.LeftCurlyBracket) i++;
else return 0;
if (l = checkAtrulers(i)) i += l;
if (... | javascript | function checkAtruler(i) {
const start = i;
let l;
if (i >= tokensLength) return 0;
if (l = checkAtkeyword(i)) i += l;
else return 0;
if (l = checkTsets(i)) i += l;
if (i < tokensLength && tokens[i].type === TokenType.LeftCurlyBracket) i++;
else return 0;
if (l = checkAtrulers(i)) i += l;
if (... | [
"function",
"checkAtruler",
"(",
"i",
")",
"{",
"const",
"start",
"=",
"i",
";",
"let",
"l",
";",
"if",
"(",
"i",
">=",
"tokensLength",
")",
"return",
"0",
";",
"if",
"(",
"l",
"=",
"checkAtkeyword",
"(",
"i",
")",
")",
"i",
"+=",
"l",
";",
"el... | Check if token is part of an @-rule with ruleset
@param {Number} i Token's index number
@returns {Number} Length of the @-rule | [
"Check",
"if",
"token",
"is",
"part",
"of",
"an"
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/less/parse.js#L600-L620 | train |
tonyganch/gonzales-pe | src/less/parse.js | getBlock | function getBlock() {
const type = NodeType.BlockType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
const end = tokens[pos].right;
let content = [];
// Skip `{`.
pos++;
while (pos < end) {
if (checkBlockdecl(pos)) content = content.concat(getBlockdecl());
else ... | javascript | function getBlock() {
const type = NodeType.BlockType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
const end = tokens[pos].right;
let content = [];
// Skip `{`.
pos++;
while (pos < end) {
if (checkBlockdecl(pos)) content = content.concat(getBlockdecl());
else ... | [
"function",
"getBlock",
"(",
")",
"{",
"const",
"type",
"=",
"NodeType",
".",
"BlockType",
";",
"const",
"token",
"=",
"tokens",
"[",
"pos",
"]",
";",
"const",
"line",
"=",
"token",
".",
"ln",
";",
"const",
"column",
"=",
"token",
".",
"col",
";",
... | Get node with a block
@returns {Array} `['block', x]` | [
"Get",
"node",
"with",
"a",
"block"
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/less/parse.js#L748-L768 | train |
tonyganch/gonzales-pe | src/less/parse.js | getCommentML | function getCommentML() {
const type = NodeType.CommentMLType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
let content = tokens[pos].value.substring(2);
const l = content.length;
if (content.charAt(l - 2) === '*' && content.charAt(l - 1) === '/')
content = content.subs... | javascript | function getCommentML() {
const type = NodeType.CommentMLType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
let content = tokens[pos].value.substring(2);
const l = content.length;
if (content.charAt(l - 2) === '*' && content.charAt(l - 1) === '/')
content = content.subs... | [
"function",
"getCommentML",
"(",
")",
"{",
"const",
"type",
"=",
"NodeType",
".",
"CommentMLType",
";",
"const",
"token",
"=",
"tokens",
"[",
"pos",
"]",
";",
"const",
"line",
"=",
"token",
".",
"ln",
";",
"const",
"column",
"=",
"token",
".",
"col",
... | Get node with a multiline comment
@returns {Array} `['commentML', x]` where `x`
is the comment's text (without `/*` and `* /`). | [
"Get",
"node",
"with",
"a",
"multiline",
"comment"
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/less/parse.js#L1242-L1258 | train |
tonyganch/gonzales-pe | src/less/parse.js | checkCondition | function checkCondition(i) {
const start = i;
let l;
if (i >= tokensLength) return 0;
if ((l = checkIdent(i)) && tokens[i].value === 'when') i += l;
else return 0;
while (i < tokensLength) {
if (l = checkBlock(i)) {
tokens[i].condition_child = 0;
break;
} else if (l = checkFunction(i)... | javascript | function checkCondition(i) {
const start = i;
let l;
if (i >= tokensLength) return 0;
if ((l = checkIdent(i)) && tokens[i].value === 'when') i += l;
else return 0;
while (i < tokensLength) {
if (l = checkBlock(i)) {
tokens[i].condition_child = 0;
break;
} else if (l = checkFunction(i)... | [
"function",
"checkCondition",
"(",
"i",
")",
"{",
"const",
"start",
"=",
"i",
";",
"let",
"l",
";",
"if",
"(",
"i",
">=",
"tokensLength",
")",
"return",
"0",
";",
"if",
"(",
"(",
"l",
"=",
"checkIdent",
"(",
"i",
")",
")",
"&&",
"tokens",
"[",
... | Check if token is part of a condition.
@param {Number} i Token's index number
@return {Number} Length of the condition | [
"Check",
"if",
"token",
"is",
"part",
"of",
"a",
"condition",
"."
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/less/parse.js#L1289-L1319 | train |
tonyganch/gonzales-pe | src/less/parse.js | getEscapedString | function getEscapedString() {
const type = NodeType.EscapedStringType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
pos++;
const content = tokens[pos].value;
const end = getLastPosition(content, line, column + 1);
pos++;
return newNode(type, content, line, column, en... | javascript | function getEscapedString() {
const type = NodeType.EscapedStringType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
pos++;
const content = tokens[pos].value;
const end = getLastPosition(content, line, column + 1);
pos++;
return newNode(type, content, line, column, en... | [
"function",
"getEscapedString",
"(",
")",
"{",
"const",
"type",
"=",
"NodeType",
".",
"EscapedStringType",
";",
"const",
"token",
"=",
"tokens",
"[",
"pos",
"]",
";",
"const",
"line",
"=",
"token",
".",
"ln",
";",
"const",
"column",
"=",
"token",
".",
... | Get node with an escaped string
@returns {Array} `['escapedString', ['string', x]]` where `x` is a string
without `~` but with quotes | [
"Get",
"node",
"with",
"an",
"escaped",
"string"
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/less/parse.js#L1506-L1520 | train |
tonyganch/gonzales-pe | src/less/parse.js | checkIdent | function checkIdent(i) {
const start = i;
if (i >= tokensLength) return 0;
if (tokens[i].type === TokenType.HyphenMinus) i++;
if (tokens[i].type === TokenType.LowLine ||
tokens[i].type === TokenType.Identifier) i++;
else return 0;
for (; i < tokensLength; i++) {
if (tokens[i].type !== TokenTyp... | javascript | function checkIdent(i) {
const start = i;
if (i >= tokensLength) return 0;
if (tokens[i].type === TokenType.HyphenMinus) i++;
if (tokens[i].type === TokenType.LowLine ||
tokens[i].type === TokenType.Identifier) i++;
else return 0;
for (; i < tokensLength; i++) {
if (tokens[i].type !== TokenTyp... | [
"function",
"checkIdent",
"(",
"i",
")",
"{",
"const",
"start",
"=",
"i",
";",
"if",
"(",
"i",
">=",
"tokensLength",
")",
"return",
"0",
";",
"if",
"(",
"tokens",
"[",
"i",
"]",
".",
"type",
"===",
"TokenType",
".",
"HyphenMinus",
")",
"i",
"++",
... | Check if token is part of an identifier
@param {Number} i Token's index number
@returns {Number} Length of the identifier | [
"Check",
"if",
"token",
"is",
"part",
"of",
"an",
"identifier"
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/less/parse.js#L1707-L1728 | train |
tonyganch/gonzales-pe | src/less/parse.js | checkInclude | function checkInclude(i) {
let l;
if (i >= tokensLength) return 0;
if (l = checkInclude1(i)) tokens[i].include_type = 1;
else if (l = checkInclude2(i)) tokens[i].include_type = 2;
return l;
} | javascript | function checkInclude(i) {
let l;
if (i >= tokensLength) return 0;
if (l = checkInclude1(i)) tokens[i].include_type = 1;
else if (l = checkInclude2(i)) tokens[i].include_type = 2;
return l;
} | [
"function",
"checkInclude",
"(",
"i",
")",
"{",
"let",
"l",
";",
"if",
"(",
"i",
">=",
"tokensLength",
")",
"return",
"0",
";",
"if",
"(",
"l",
"=",
"checkInclude1",
"(",
"i",
")",
")",
"tokens",
"[",
"i",
"]",
".",
"include_type",
"=",
"1",
";",... | Check if token is part of an include (`@include` or `@extend` directive).
@param {Number} i Token's index number
@returns {Number} | [
"Check",
"if",
"token",
"is",
"part",
"of",
"an",
"include",
"("
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/less/parse.js#L1809-L1818 | train |
tonyganch/gonzales-pe | src/less/parse.js | checkInterpolatedVariable | function checkInterpolatedVariable(i) {
const start = i;
let l;
if (i >= tokensLength) return 0;
if (tokens[i].type !== TokenType.CommercialAt ||
!tokens[i + 1] || tokens[i + 1].type !== TokenType.LeftCurlyBracket) {
return 0;
}
i += 2;
if (l = checkIdent(i)) i += l;
else return 0;
retu... | javascript | function checkInterpolatedVariable(i) {
const start = i;
let l;
if (i >= tokensLength) return 0;
if (tokens[i].type !== TokenType.CommercialAt ||
!tokens[i + 1] || tokens[i + 1].type !== TokenType.LeftCurlyBracket) {
return 0;
}
i += 2;
if (l = checkIdent(i)) i += l;
else return 0;
retu... | [
"function",
"checkInterpolatedVariable",
"(",
"i",
")",
"{",
"const",
"start",
"=",
"i",
";",
"let",
"l",
";",
"if",
"(",
"i",
">=",
"tokensLength",
")",
"return",
"0",
";",
"if",
"(",
"tokens",
"[",
"i",
"]",
".",
"type",
"!==",
"TokenType",
".",
... | Check if token is part of LESS interpolated variable
@param {Number} i Token's index number
@returns {Number} | [
"Check",
"if",
"token",
"is",
"part",
"of",
"LESS",
"interpolated",
"variable"
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/less/parse.js#L1935-L1952 | train |
tonyganch/gonzales-pe | src/less/parse.js | getInterpolatedVariable | function getInterpolatedVariable() {
const type = NodeType.InterpolatedVariableType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
const content = [];
// Skip `@{`:
pos += 2;
content.push(getIdent());
const end = getLastPosition(content, line, column, 1);
// Skip `}... | javascript | function getInterpolatedVariable() {
const type = NodeType.InterpolatedVariableType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
const content = [];
// Skip `@{`:
pos += 2;
content.push(getIdent());
const end = getLastPosition(content, line, column, 1);
// Skip `}... | [
"function",
"getInterpolatedVariable",
"(",
")",
"{",
"const",
"type",
"=",
"NodeType",
".",
"InterpolatedVariableType",
";",
"const",
"token",
"=",
"tokens",
"[",
"pos",
"]",
";",
"const",
"line",
"=",
"token",
".",
"ln",
";",
"const",
"column",
"=",
"tok... | Get node with LESS interpolated variable
@returns {Array} `['interpolatedVariable', x]` | [
"Get",
"node",
"with",
"LESS",
"interpolated",
"variable"
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/less/parse.js#L1958-L1976 | train |
tonyganch/gonzales-pe | src/less/parse.js | getUri | function getUri() {
const startPos = pos;
const uriExcluding = {};
let uri;
let token;
let l;
let raw;
pos += 2;
uriExcluding[TokenType.Space] = 1;
uriExcluding[TokenType.Tab] = 1;
uriExcluding[TokenType.Newline] = 1;
uriExcluding[TokenType.LeftParenthesis] = 1;
uriExcluding[TokenType.RightPar... | javascript | function getUri() {
const startPos = pos;
const uriExcluding = {};
let uri;
let token;
let l;
let raw;
pos += 2;
uriExcluding[TokenType.Space] = 1;
uriExcluding[TokenType.Tab] = 1;
uriExcluding[TokenType.Newline] = 1;
uriExcluding[TokenType.LeftParenthesis] = 1;
uriExcluding[TokenType.RightPar... | [
"function",
"getUri",
"(",
")",
"{",
"const",
"startPos",
"=",
"pos",
";",
"const",
"uriExcluding",
"=",
"{",
"}",
";",
"let",
"uri",
";",
"let",
"token",
";",
"let",
"l",
";",
"let",
"raw",
";",
"pos",
"+=",
"2",
";",
"uriExcluding",
"[",
"TokenTy... | Get node with URI
@returns {Array} `['uri', x]` where `x` is URI's nodes (without `url`
and braces, e.g. `['string', ''/css/styles.css'']`). | [
"Get",
"node",
"with",
"URI"
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/less/parse.js#L3847-L3889 | train |
tonyganch/gonzales-pe | src/less/parse.js | checkVariable | function checkVariable(i) {
let l;
if (i >= tokensLength || tokens[i].type !== TokenType.CommercialAt) return 0;
if (tokens[i - 1] &&
tokens[i - 1].type === TokenType.CommercialAt &&
tokens[i - 2] &&
tokens[i - 2].type === TokenType.CommercialAt) return 0;
return (l = checkVariable(i + 1) |... | javascript | function checkVariable(i) {
let l;
if (i >= tokensLength || tokens[i].type !== TokenType.CommercialAt) return 0;
if (tokens[i - 1] &&
tokens[i - 1].type === TokenType.CommercialAt &&
tokens[i - 2] &&
tokens[i - 2].type === TokenType.CommercialAt) return 0;
return (l = checkVariable(i + 1) |... | [
"function",
"checkVariable",
"(",
"i",
")",
"{",
"let",
"l",
";",
"if",
"(",
"i",
">=",
"tokensLength",
"||",
"tokens",
"[",
"i",
"]",
".",
"type",
"!==",
"TokenType",
".",
"CommercialAt",
")",
"return",
"0",
";",
"if",
"(",
"tokens",
"[",
"i",
"-"... | Check if token is part of LESS variable
@param {Number} i Token's index number
@returns {Number} Length of the variable | [
"Check",
"if",
"token",
"is",
"part",
"of",
"LESS",
"variable"
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/less/parse.js#L4008-L4019 | train |
tonyganch/gonzales-pe | src/less/parse.js | getVariable | function getVariable() {
const type = NodeType.VariableType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
const content = [];
// Skip `$`.
pos++;
if (checkVariable(pos)) content.push(getVariable());
else content.push(getIdent());
return newNode(type, content, line, ... | javascript | function getVariable() {
const type = NodeType.VariableType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
const content = [];
// Skip `$`.
pos++;
if (checkVariable(pos)) content.push(getVariable());
else content.push(getIdent());
return newNode(type, content, line, ... | [
"function",
"getVariable",
"(",
")",
"{",
"const",
"type",
"=",
"NodeType",
".",
"VariableType",
";",
"const",
"token",
"=",
"tokens",
"[",
"pos",
"]",
";",
"const",
"line",
"=",
"token",
".",
"ln",
";",
"const",
"column",
"=",
"token",
".",
"col",
"... | Get node with a variable
@returns {Array} `['variable', ['ident', x]]` where `x` is
a variable name. | [
"Get",
"node",
"with",
"a",
"variable"
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/less/parse.js#L4026-L4040 | train |
tonyganch/gonzales-pe | src/scss/parse.js | checkInclude3 | function checkInclude3(i) {
const start = i;
let l;
if (l = checkAtkeyword(i)) i += l;
else return 0;
if (tokens[start + 1].value !== 'include') return 0;
if (l = checkSC(i)) i += l;
else return 0;
if (l = checkIdentOrInterpolation(i)) i += l;
else return 0;
if (l = checkSC(i)) i += l;
if (l... | javascript | function checkInclude3(i) {
const start = i;
let l;
if (l = checkAtkeyword(i)) i += l;
else return 0;
if (tokens[start + 1].value !== 'include') return 0;
if (l = checkSC(i)) i += l;
else return 0;
if (l = checkIdentOrInterpolation(i)) i += l;
else return 0;
if (l = checkSC(i)) i += l;
if (l... | [
"function",
"checkInclude3",
"(",
"i",
")",
"{",
"const",
"start",
"=",
"i",
";",
"let",
"l",
";",
"if",
"(",
"l",
"=",
"checkAtkeyword",
"(",
"i",
")",
")",
"i",
"+=",
"l",
";",
"else",
"return",
"0",
";",
"if",
"(",
"tokens",
"[",
"start",
"+... | Check if token is part of an included mixin like `@include nani(foo)`
@param {Number} i Token's index number
@returns {Number} Length of the include | [
"Check",
"if",
"token",
"is",
"part",
"of",
"an",
"included",
"mixin",
"like"
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/scss/parse.js#L2239-L2260 | train |
tonyganch/gonzales-pe | src/scss/parse.js | getInclude3 | function getInclude3() {
const type = NodeType.IncludeType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
const content = [].concat(
getAtkeyword(),
getSC(),
getIdentOrInterpolation(),
getSC(),
getArguments()
);
return newNode(type, content, line, column)... | javascript | function getInclude3() {
const type = NodeType.IncludeType;
const token = tokens[pos];
const line = token.ln;
const column = token.col;
const content = [].concat(
getAtkeyword(),
getSC(),
getIdentOrInterpolation(),
getSC(),
getArguments()
);
return newNode(type, content, line, column)... | [
"function",
"getInclude3",
"(",
")",
"{",
"const",
"type",
"=",
"NodeType",
".",
"IncludeType",
";",
"const",
"token",
"=",
"tokens",
"[",
"pos",
"]",
";",
"const",
"line",
"=",
"token",
".",
"ln",
";",
"const",
"column",
"=",
"token",
".",
"col",
";... | Get node with included mixin like `@include nani(foo)`
@returns {Array} `['include', ['atkeyword', x], sc, ['selector', y], sc,
['arguments', z], sc]` where `x` is `include` or `extend`, `y` is
mixin's identifier (selector), `z` are arguments passed to the
mixin and `sc` are optional whitespaces | [
"Get",
"node",
"with",
"included",
"mixin",
"like"
] | cb4be1c6c22184b525c6b7252823de834235a963 | https://github.com/tonyganch/gonzales-pe/blob/cb4be1c6c22184b525c6b7252823de834235a963/src/scss/parse.js#L2269-L2283 | train |
azerion/phaser-spine | build/phaser-spine.js | function () {
var bones = this.bones;
var updateCache = this.cache;
var ikConstraints = this.ikConstraints;
var transformConstraints = this.transformConstraints;
var ikConstraintsCount = ikConstraints.length;
var transformConstraintsCount = transformConstraints.length;
updateCache.length = 0;
for (var ... | javascript | function () {
var bones = this.bones;
var updateCache = this.cache;
var ikConstraints = this.ikConstraints;
var transformConstraints = this.transformConstraints;
var ikConstraintsCount = ikConstraints.length;
var transformConstraintsCount = transformConstraints.length;
updateCache.length = 0;
for (var ... | [
"function",
"(",
")",
"{",
"var",
"bones",
"=",
"this",
".",
"bones",
";",
"var",
"updateCache",
"=",
"this",
".",
"cache",
";",
"var",
"ikConstraints",
"=",
"this",
".",
"ikConstraints",
";",
"var",
"transformConstraints",
"=",
"this",
".",
"transformCons... | Caches information about bones and constraints. Must be called if bones or constraints are added or removed. | [
"Caches",
"information",
"about",
"bones",
"and",
"constraints",
".",
"Must",
"be",
"called",
"if",
"bones",
"or",
"constraints",
"are",
"added",
"or",
"removed",
"."
] | 37c41fe880aae0d2721301dbd95a5ed73364143a | https://github.com/azerion/phaser-spine/blob/37c41fe880aae0d2721301dbd95a5ed73364143a/build/phaser-spine.js#L1201-L1232 | train | |
azerion/phaser-spine | build/phaser-spine.js | function () {
var updateCache = this.cache;
for (var i = 0, n = updateCache.length; i < n; i++)
updateCache[i].update();
} | javascript | function () {
var updateCache = this.cache;
for (var i = 0, n = updateCache.length; i < n; i++)
updateCache[i].update();
} | [
"function",
"(",
")",
"{",
"var",
"updateCache",
"=",
"this",
".",
"cache",
";",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"n",
"=",
"updateCache",
".",
"length",
";",
"i",
"<",
"n",
";",
"i",
"++",
")",
"updateCache",
"[",
"i",
"]",
".",
"update"... | Updates the world transform for each bone and applies constraints. | [
"Updates",
"the",
"world",
"transform",
"for",
"each",
"bone",
"and",
"applies",
"constraints",
"."
] | 37c41fe880aae0d2721301dbd95a5ed73364143a | https://github.com/azerion/phaser-spine/blob/37c41fe880aae0d2721301dbd95a5ed73364143a/build/phaser-spine.js#L1234-L1238 | train | |
azerion/phaser-spine | build/phaser-spine.js | function () {
var bones = this.bones;
for (var i = 0, n = bones.length; i < n; i++)
bones[i].setToSetupPose();
var ikConstraints = this.ikConstraints;
for (var i = 0, n = ikConstraints.length; i < n; i++) {
var constraint = ikConstraints[i];
constraint.bendDirection = constraint.data.bendDirection;
... | javascript | function () {
var bones = this.bones;
for (var i = 0, n = bones.length; i < n; i++)
bones[i].setToSetupPose();
var ikConstraints = this.ikConstraints;
for (var i = 0, n = ikConstraints.length; i < n; i++) {
var constraint = ikConstraints[i];
constraint.bendDirection = constraint.data.bendDirection;
... | [
"function",
"(",
")",
"{",
"var",
"bones",
"=",
"this",
".",
"bones",
";",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"n",
"=",
"bones",
".",
"length",
";",
"i",
"<",
"n",
";",
"i",
"++",
")",
"bones",
"[",
"i",
"]",
".",
"setToSetupPose",
"(",
... | Sets the bones and constraints to their setup pose values. | [
"Sets",
"the",
"bones",
"and",
"constraints",
"to",
"their",
"setup",
"pose",
"values",
"."
] | 37c41fe880aae0d2721301dbd95a5ed73364143a | https://github.com/azerion/phaser-spine/blob/37c41fe880aae0d2721301dbd95a5ed73364143a/build/phaser-spine.js#L1245-L1264 | train | |
azerion/phaser-spine | build/phaser-spine.js | function (trackIndex, animation, loop) {
var entry = new spine.TrackEntry();
entry.animation = animation;
entry.loop = loop;
entry.endTime = animation.duration;
this.setCurrent(trackIndex, entry);
return entry;
} | javascript | function (trackIndex, animation, loop) {
var entry = new spine.TrackEntry();
entry.animation = animation;
entry.loop = loop;
entry.endTime = animation.duration;
this.setCurrent(trackIndex, entry);
return entry;
} | [
"function",
"(",
"trackIndex",
",",
"animation",
",",
"loop",
")",
"{",
"var",
"entry",
"=",
"new",
"spine",
".",
"TrackEntry",
"(",
")",
";",
"entry",
".",
"animation",
"=",
"animation",
";",
"entry",
".",
"loop",
"=",
"loop",
";",
"entry",
".",
"en... | Set the current animation. Any queued animations are cleared. | [
"Set",
"the",
"current",
"animation",
".",
"Any",
"queued",
"animations",
"are",
"cleared",
"."
] | 37c41fe880aae0d2721301dbd95a5ed73364143a | https://github.com/azerion/phaser-spine/blob/37c41fe880aae0d2721301dbd95a5ed73364143a/build/phaser-spine.js#L1842-L1849 | train | |
azerion/phaser-spine | build/phaser-spine.js | function (x, y) {
return x >= this.minX && x <= this.maxX && y >= this.minY && y <= this.maxY;
} | javascript | function (x, y) {
return x >= this.minX && x <= this.maxX && y >= this.minY && y <= this.maxY;
} | [
"function",
"(",
"x",
",",
"y",
")",
"{",
"return",
"x",
">=",
"this",
".",
"minX",
"&&",
"x",
"<=",
"this",
".",
"maxX",
"&&",
"y",
">=",
"this",
".",
"minY",
"&&",
"y",
"<=",
"this",
".",
"maxY",
";",
"}"
] | Returns true if the axis aligned bounding box contains the point. | [
"Returns",
"true",
"if",
"the",
"axis",
"aligned",
"bounding",
"box",
"contains",
"the",
"point",
"."
] | 37c41fe880aae0d2721301dbd95a5ed73364143a | https://github.com/azerion/phaser-spine/blob/37c41fe880aae0d2721301dbd95a5ed73364143a/build/phaser-spine.js#L2787-L2789 | train | |
azerion/phaser-spine | build/phaser-spine.js | function (x1, y1, x2, y2) {
var minX = this.minX, minY = this.minY, maxX = this.maxX, maxY = this.maxY;
if ((x1 <= minX && x2 <= minX) || (y1 <= minY && y2 <= minY) || (x1 >= maxX && x2 >= maxX) || (y1 >= maxY && y2 >= maxY))
return false;
var m = (y2 - y1) / (x2 - x1);
var y = m * (minX - x1) + y1;
if (y ... | javascript | function (x1, y1, x2, y2) {
var minX = this.minX, minY = this.minY, maxX = this.maxX, maxY = this.maxY;
if ((x1 <= minX && x2 <= minX) || (y1 <= minY && y2 <= minY) || (x1 >= maxX && x2 >= maxX) || (y1 >= maxY && y2 >= maxY))
return false;
var m = (y2 - y1) / (x2 - x1);
var y = m * (minX - x1) + y1;
if (y ... | [
"function",
"(",
"x1",
",",
"y1",
",",
"x2",
",",
"y2",
")",
"{",
"var",
"minX",
"=",
"this",
".",
"minX",
",",
"minY",
"=",
"this",
".",
"minY",
",",
"maxX",
"=",
"this",
".",
"maxX",
",",
"maxY",
"=",
"this",
".",
"maxY",
";",
"if",
"(",
... | Returns true if the axis aligned bounding box intersects the line segment. | [
"Returns",
"true",
"if",
"the",
"axis",
"aligned",
"bounding",
"box",
"intersects",
"the",
"line",
"segment",
"."
] | 37c41fe880aae0d2721301dbd95a5ed73364143a | https://github.com/azerion/phaser-spine/blob/37c41fe880aae0d2721301dbd95a5ed73364143a/build/phaser-spine.js#L2791-L2805 | train | |
azerion/phaser-spine | build/phaser-spine.js | function (bounds) {
return this.minX < bounds.maxX && this.maxX > bounds.minX && this.minY < bounds.maxY && this.maxY > bounds.minY;
} | javascript | function (bounds) {
return this.minX < bounds.maxX && this.maxX > bounds.minX && this.minY < bounds.maxY && this.maxY > bounds.minY;
} | [
"function",
"(",
"bounds",
")",
"{",
"return",
"this",
".",
"minX",
"<",
"bounds",
".",
"maxX",
"&&",
"this",
".",
"maxX",
">",
"bounds",
".",
"minX",
"&&",
"this",
".",
"minY",
"<",
"bounds",
".",
"maxY",
"&&",
"this",
".",
"maxY",
">",
"bounds",
... | Returns true if the axis aligned bounding box intersects the axis aligned bounding box of the specified bounds. | [
"Returns",
"true",
"if",
"the",
"axis",
"aligned",
"bounding",
"box",
"intersects",
"the",
"axis",
"aligned",
"bounding",
"box",
"of",
"the",
"specified",
"bounds",
"."
] | 37c41fe880aae0d2721301dbd95a5ed73364143a | https://github.com/azerion/phaser-spine/blob/37c41fe880aae0d2721301dbd95a5ed73364143a/build/phaser-spine.js#L2807-L2809 | train | |
azerion/phaser-spine | build/phaser-spine.js | function (polygon, x, y) {
var nn = polygon.length;
var prevIndex = nn - 2;
var inside = false;
for (var ii = 0; ii < nn; ii += 2) {
var vertexY = polygon[ii + 1];
var prevY = polygon[prevIndex + 1];
if ((vertexY < y && prevY >= y) || (prevY < y && vertexY >= y)) {
var vertexX = polygon[ii];
if... | javascript | function (polygon, x, y) {
var nn = polygon.length;
var prevIndex = nn - 2;
var inside = false;
for (var ii = 0; ii < nn; ii += 2) {
var vertexY = polygon[ii + 1];
var prevY = polygon[prevIndex + 1];
if ((vertexY < y && prevY >= y) || (prevY < y && vertexY >= y)) {
var vertexX = polygon[ii];
if... | [
"function",
"(",
"polygon",
",",
"x",
",",
"y",
")",
"{",
"var",
"nn",
"=",
"polygon",
".",
"length",
";",
"var",
"prevIndex",
"=",
"nn",
"-",
"2",
";",
"var",
"inside",
"=",
"false",
";",
"for",
"(",
"var",
"ii",
"=",
"0",
";",
"ii",
"<",
"n... | Returns true if the polygon contains the point. | [
"Returns",
"true",
"if",
"the",
"polygon",
"contains",
"the",
"point",
"."
] | 37c41fe880aae0d2721301dbd95a5ed73364143a | https://github.com/azerion/phaser-spine/blob/37c41fe880aae0d2721301dbd95a5ed73364143a/build/phaser-spine.js#L2827-L2841 | train | |
azerion/phaser-spine | build/phaser-spine.js | function (polygon, x1, y1, x2, y2) {
var nn = polygon.length;
var width12 = x1 - x2, height12 = y1 - y2;
var det1 = x1 * y2 - y1 * x2;
var x3 = polygon[nn - 2], y3 = polygon[nn - 1];
for (var ii = 0; ii < nn; ii += 2) {
var x4 = polygon[ii], y4 = polygon[ii + 1];
var det2 = x3 * y4 - y3 * x4;
var wid... | javascript | function (polygon, x1, y1, x2, y2) {
var nn = polygon.length;
var width12 = x1 - x2, height12 = y1 - y2;
var det1 = x1 * y2 - y1 * x2;
var x3 = polygon[nn - 2], y3 = polygon[nn - 1];
for (var ii = 0; ii < nn; ii += 2) {
var x4 = polygon[ii], y4 = polygon[ii + 1];
var det2 = x3 * y4 - y3 * x4;
var wid... | [
"function",
"(",
"polygon",
",",
"x1",
",",
"y1",
",",
"x2",
",",
"y2",
")",
"{",
"var",
"nn",
"=",
"polygon",
".",
"length",
";",
"var",
"width12",
"=",
"x1",
"-",
"x2",
",",
"height12",
"=",
"y1",
"-",
"y2",
";",
"var",
"det1",
"=",
"x1",
"... | Returns true if the polygon contains the line segment. | [
"Returns",
"true",
"if",
"the",
"polygon",
"contains",
"the",
"line",
"segment",
"."
] | 37c41fe880aae0d2721301dbd95a5ed73364143a | https://github.com/azerion/phaser-spine/blob/37c41fe880aae0d2721301dbd95a5ed73364143a/build/phaser-spine.js#L2843-L2862 | train | |
arendjr/selectivity | src/inputs/multiple.js | MultipleInput | function MultipleInput(options) {
Selectivity.call(
this,
assign(
{
// dropdowns for multiple-value inputs should open below the select box,
// unless there is not enough space below, but there is space enough above, then it should
// open ... | javascript | function MultipleInput(options) {
Selectivity.call(
this,
assign(
{
// dropdowns for multiple-value inputs should open below the select box,
// unless there is not enough space below, but there is space enough above, then it should
// open ... | [
"function",
"MultipleInput",
"(",
"options",
")",
"{",
"Selectivity",
".",
"call",
"(",
"this",
",",
"assign",
"(",
"{",
"// dropdowns for multiple-value inputs should open below the select box,",
"// unless there is not enough space below, but there is space enough above, then it sh... | MultipleInput Constructor. | [
"MultipleInput",
"Constructor",
"."
] | 00e0657aea491ea41547979b62e8f9fc48f36549 | https://github.com/arendjr/selectivity/blob/00e0657aea491ea41547979b62e8f9fc48f36549/src/inputs/multiple.js#L26-L69 | train |
arendjr/selectivity | src/inputs/multiple.js | function(el, selectEl) {
var rect = selectEl.getBoundingClientRect();
var dropdownHeight = el.clientHeight;
var openUpwards =
rect.bottom + dropdownHeight > window.innerHeight &&
rect.top - dropdownHeight > 0;
... | javascript | function(el, selectEl) {
var rect = selectEl.getBoundingClientRect();
var dropdownHeight = el.clientHeight;
var openUpwards =
rect.bottom + dropdownHeight > window.innerHeight &&
rect.top - dropdownHeight > 0;
... | [
"function",
"(",
"el",
",",
"selectEl",
")",
"{",
"var",
"rect",
"=",
"selectEl",
".",
"getBoundingClientRect",
"(",
")",
";",
"var",
"dropdownHeight",
"=",
"el",
".",
"clientHeight",
";",
"var",
"openUpwards",
"=",
"rect",
".",
"bottom",
"+",
"dropdownHei... | dropdowns for multiple-value inputs should open below the select box, unless there is not enough space below, but there is space enough above, then it should open upwards | [
"dropdowns",
"for",
"multiple",
"-",
"value",
"inputs",
"should",
"open",
"below",
"the",
"select",
"box",
"unless",
"there",
"is",
"not",
"enough",
"space",
"below",
"but",
"there",
"is",
"space",
"enough",
"above",
"then",
"it",
"should",
"open",
"upwards"... | 00e0657aea491ea41547979b62e8f9fc48f36549 | https://github.com/arendjr/selectivity/blob/00e0657aea491ea41547979b62e8f9fc48f36549/src/inputs/multiple.js#L34-L46 | train | |
arendjr/selectivity | src/inputs/multiple.js | function(item) {
var itemIsId = Selectivity.isValidId(item);
var id = itemIsId ? item : this.validateItem(item) && item.id;
if (this.options.allowDuplicates || this._value.indexOf(id) === -1) {
this._value.push(id);
if (itemIsId && this.options.initSelection) {
... | javascript | function(item) {
var itemIsId = Selectivity.isValidId(item);
var id = itemIsId ? item : this.validateItem(item) && item.id;
if (this.options.allowDuplicates || this._value.indexOf(id) === -1) {
this._value.push(id);
if (itemIsId && this.options.initSelection) {
... | [
"function",
"(",
"item",
")",
"{",
"var",
"itemIsId",
"=",
"Selectivity",
".",
"isValidId",
"(",
"item",
")",
";",
"var",
"id",
"=",
"itemIsId",
"?",
"item",
":",
"this",
".",
"validateItem",
"(",
"item",
")",
"&&",
"item",
".",
"id",
";",
"if",
"(... | Adds an item to the selection, if it's not selected yet.
@param item The item to add. May be an item with 'id' and 'text' properties or just an ID. | [
"Adds",
"an",
"item",
"to",
"the",
"selection",
"if",
"it",
"s",
"not",
"selected",
"yet",
"."
] | 00e0657aea491ea41547979b62e8f9fc48f36549 | https://github.com/arendjr/selectivity/blob/00e0657aea491ea41547979b62e8f9fc48f36549/src/inputs/multiple.js#L80-L111 | train | |
arendjr/selectivity | src/inputs/multiple.js | function(item) {
var id = item.id || item;
var removedItem;
var index = Selectivity.findIndexById(this._data, id);
if (index > -1) {
removedItem = this._data[index];
this._data.splice(index, 1);
}
if (this._value[index] !== id) {
inde... | javascript | function(item) {
var id = item.id || item;
var removedItem;
var index = Selectivity.findIndexById(this._data, id);
if (index > -1) {
removedItem = this._data[index];
this._data.splice(index, 1);
}
if (this._value[index] !== id) {
inde... | [
"function",
"(",
"item",
")",
"{",
"var",
"id",
"=",
"item",
".",
"id",
"||",
"item",
";",
"var",
"removedItem",
";",
"var",
"index",
"=",
"Selectivity",
".",
"findIndexById",
"(",
"this",
".",
"_data",
",",
"id",
")",
";",
"if",
"(",
"index",
">",... | Removes an item from the selection, if it is selected.
@param item The item to remove. May be an item with 'id' and 'text' properties or just an ID. | [
"Removes",
"an",
"item",
"from",
"the",
"selection",
"if",
"it",
"is",
"selected",
"."
] | 00e0657aea491ea41547979b62e8f9fc48f36549 | https://github.com/arendjr/selectivity/blob/00e0657aea491ea41547979b62e8f9fc48f36549/src/inputs/multiple.js#L174-L200 | train | |
arendjr/selectivity | src/inputs/multiple.js | function(data) {
if (data === null) {
return [];
} else if (Array.isArray(data)) {
return data.map(this.validateItem, this);
} else {
throw new Error('Data for MultiSelectivity instance should be an array');
}
} | javascript | function(data) {
if (data === null) {
return [];
} else if (Array.isArray(data)) {
return data.map(this.validateItem, this);
} else {
throw new Error('Data for MultiSelectivity instance should be an array');
}
} | [
"function",
"(",
"data",
")",
"{",
"if",
"(",
"data",
"===",
"null",
")",
"{",
"return",
"[",
"]",
";",
"}",
"else",
"if",
"(",
"Array",
".",
"isArray",
"(",
"data",
")",
")",
"{",
"return",
"data",
".",
"map",
"(",
"this",
".",
"validateItem",
... | Validates data to set. Throws an exception if the data is invalid.
@param data The data to validate. Should be an array of objects with 'id' and 'text'
properties.
@return The validated data. This may differ from the input data. | [
"Validates",
"data",
"to",
"set",
".",
"Throws",
"an",
"exception",
"if",
"the",
"data",
"is",
"invalid",
"."
] | 00e0657aea491ea41547979b62e8f9fc48f36549 | https://github.com/arendjr/selectivity/blob/00e0657aea491ea41547979b62e8f9fc48f36549/src/inputs/multiple.js#L283-L291 | train |
Subsets and Splits
SQL Console for semeru/code-text-javascript
Retrieves 20,000 non-null code samples labeled as JavaScript, providing a basic overview of the dataset.