id int32 0 58k | 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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
15,900 | 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 |
15,901 | 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 |
15,902 | 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 | |
15,903 | 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 | |
15,904 | 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 [email protected] 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 |
15,905 | 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 |
15,906 | 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 | |
15,907 | 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 | |
15,908 | 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 | |
15,909 | 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 | |
15,910 | 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 | |
15,911 | 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 | |
15,912 | 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 | |
15,913 | 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 | |
15,914 | 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 |
15,915 | 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 |
15,916 | 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 |
15,917 | 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 |
15,918 | 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 |
15,919 | 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 |
15,920 | 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 |
15,921 | 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 |
15,922 | 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 |
15,923 | 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 |
15,924 | 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 |
15,925 | 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 |
15,926 | 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 |
15,927 | 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 |
15,928 | 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 |
15,929 | 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 |
15,930 | 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 |
15,931 | 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 |
15,932 | 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 |
15,933 | 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 |
15,934 | 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 |
15,935 | 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 |
15,936 | 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 |
15,937 | 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 |
15,938 | 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 |
15,939 | 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 |
15,940 | 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 |
15,941 | 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 |
15,942 | 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 |
15,943 | 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 |
15,944 | 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 |
15,945 | 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 |
15,946 | 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 |
15,947 | 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 |
15,948 | 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 |
15,949 | 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 |
15,950 | 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 |
15,951 | 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 |
15,952 | 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 |
15,953 | 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 |
15,954 | 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 |
15,955 | 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 |
15,956 | 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 |
15,957 | 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 |
15,958 | 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 |
15,959 | 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 |
15,960 | 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 |
15,961 | 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 |
15,962 | 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 |
15,963 | 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 |
15,964 | 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 |
15,965 | 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 |
15,966 | 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 |
15,967 | 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 |
15,968 | 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 |
15,969 | 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 |
15,970 | 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 |
15,971 | 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 |
15,972 | 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 |
15,973 | 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 |
15,974 | 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 |
15,975 | 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 |
15,976 | 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 |
15,977 | 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 | |
15,978 | 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 | |
15,979 | 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 | |
15,980 | 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 | |
15,981 | 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 | |
15,982 | 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 | |
15,983 | 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 | |
15,984 | 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 | |
15,985 | 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 | |
15,986 | 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 |
15,987 | 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 | |
15,988 | 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 | |
15,989 | 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 | |
15,990 | 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 | |
15,991 | arendjr/selectivity | src/inputs/multiple.js | function(value) {
if (value === null) {
return [];
} else if (Array.isArray(value)) {
if (value.every(Selectivity.isValidId)) {
return value;
} else {
throw new Error('Value contains invalid IDs');
}
} else {
... | javascript | function(value) {
if (value === null) {
return [];
} else if (Array.isArray(value)) {
if (value.every(Selectivity.isValidId)) {
return value;
} else {
throw new Error('Value contains invalid IDs');
}
} else {
... | [
"function",
"(",
"value",
")",
"{",
"if",
"(",
"value",
"===",
"null",
")",
"{",
"return",
"[",
"]",
";",
"}",
"else",
"if",
"(",
"Array",
".",
"isArray",
"(",
"value",
")",
")",
"{",
"if",
"(",
"value",
".",
"every",
"(",
"Selectivity",
".",
"... | Validates a value to set. Throws an exception if the value is invalid.
@param value The value to validate. Should be an array of IDs.
@return The validated value. This may differ from the input value. | [
"Validates",
"a",
"value",
"to",
"set",
".",
"Throws",
"an",
"exception",
"if",
"the",
"value",
"is",
"invalid",
"."
] | 00e0657aea491ea41547979b62e8f9fc48f36549 | https://github.com/arendjr/selectivity/blob/00e0657aea491ea41547979b62e8f9fc48f36549/src/inputs/multiple.js#L300-L312 | |
15,992 | arendjr/selectivity | src/event-listener.js | EventListener | function EventListener(el, context) {
this.context = context || null;
this.el = el;
this.events = {};
this._onEvent = this._onEvent.bind(this);
} | javascript | function EventListener(el, context) {
this.context = context || null;
this.el = el;
this.events = {};
this._onEvent = this._onEvent.bind(this);
} | [
"function",
"EventListener",
"(",
"el",
",",
"context",
")",
"{",
"this",
".",
"context",
"=",
"context",
"||",
"null",
";",
"this",
".",
"el",
"=",
"el",
";",
"this",
".",
"events",
"=",
"{",
"}",
";",
"this",
".",
"_onEvent",
"=",
"this",
".",
... | Listens to events dispatched to an element or its children.
@param el The element to listen to.
@param context Optional context in which to execute the callbacks. | [
"Listens",
"to",
"events",
"dispatched",
"to",
"an",
"element",
"or",
"its",
"children",
"."
] | 00e0657aea491ea41547979b62e8f9fc48f36549 | https://github.com/arendjr/selectivity/blob/00e0657aea491ea41547979b62e8f9fc48f36549/src/event-listener.js#L16-L24 |
15,993 | arendjr/selectivity | src/event-listener.js | function(eventName, selector, callback) {
if (!isString(selector)) {
callback = selector;
selector = '';
}
if (callback) {
var events = this.events[eventName];
if (events) {
events = events[selector];
if (events) {
... | javascript | function(eventName, selector, callback) {
if (!isString(selector)) {
callback = selector;
selector = '';
}
if (callback) {
var events = this.events[eventName];
if (events) {
events = events[selector];
if (events) {
... | [
"function",
"(",
"eventName",
",",
"selector",
",",
"callback",
")",
"{",
"if",
"(",
"!",
"isString",
"(",
"selector",
")",
")",
"{",
"callback",
"=",
"selector",
";",
"selector",
"=",
"''",
";",
"}",
"if",
"(",
"callback",
")",
"{",
"var",
"events",... | Stops listening to an event.
The arguments are the same as for on(), but when no callback is given, all callbacks for the
given event and class are discarded. | [
"Stops",
"listening",
"to",
"an",
"event",
"."
] | 00e0657aea491ea41547979b62e8f9fc48f36549 | https://github.com/arendjr/selectivity/blob/00e0657aea491ea41547979b62e8f9fc48f36549/src/event-listener.js#L49-L71 | |
15,994 | arendjr/selectivity | src/event-listener.js | function(eventName, selector, callback) {
if (!isString(eventName)) {
var eventsMap = eventName;
for (var key in eventsMap) {
if (eventsMap.hasOwnProperty(key)) {
var split = key.split(' ');
if (split.length > 1) {
... | javascript | function(eventName, selector, callback) {
if (!isString(eventName)) {
var eventsMap = eventName;
for (var key in eventsMap) {
if (eventsMap.hasOwnProperty(key)) {
var split = key.split(' ');
if (split.length > 1) {
... | [
"function",
"(",
"eventName",
",",
"selector",
",",
"callback",
")",
"{",
"if",
"(",
"!",
"isString",
"(",
"eventName",
")",
")",
"{",
"var",
"eventsMap",
"=",
"eventName",
";",
"for",
"(",
"var",
"key",
"in",
"eventsMap",
")",
"{",
"if",
"(",
"event... | Starts listening to an event.
@param eventName Name of the event to listen to, in lower-case.
@param selector Optional CSS selector. If given, only events inside a child element matching
the selector are caught.
@param callback Callback to invoke when the event is caught.
Alternatively, the arguments may be provided ... | [
"Starts",
"listening",
"to",
"an",
"event",
"."
] | 00e0657aea491ea41547979b62e8f9fc48f36549 | https://github.com/arendjr/selectivity/blob/00e0657aea491ea41547979b62e8f9fc48f36549/src/event-listener.js#L90-L125 | |
15,995 | arendjr/selectivity | src/templates.js | function(options) {
var extraClass = options.dropdownCssClass ? ' ' + options.dropdownCssClass : '',
searchInput = '';
if (options.showSearchInput) {
extraClass += ' has-search-input';
var placeholder = options.searchInputPlaceholder;
searchInput =
... | javascript | function(options) {
var extraClass = options.dropdownCssClass ? ' ' + options.dropdownCssClass : '',
searchInput = '';
if (options.showSearchInput) {
extraClass += ' has-search-input';
var placeholder = options.searchInputPlaceholder;
searchInput =
... | [
"function",
"(",
"options",
")",
"{",
"var",
"extraClass",
"=",
"options",
".",
"dropdownCssClass",
"?",
"' '",
"+",
"options",
".",
"dropdownCssClass",
":",
"''",
",",
"searchInput",
"=",
"''",
";",
"if",
"(",
"options",
".",
"showSearchInput",
")",
"{",
... | Renders the dropdown.
The template is expected to have at least one element with the class
'selectivity-results-container', which is where all results will be added to.
@param options Options object containing the following properties:
dropdownCssClass - Optional CSS class to add to the top-level element.
searchInput... | [
"Renders",
"the",
"dropdown",
"."
] | 00e0657aea491ea41547979b62e8f9fc48f36549 | https://github.com/arendjr/selectivity/blob/00e0657aea491ea41547979b62e8f9fc48f36549/src/templates.js#L32-L54 | |
15,996 | arendjr/selectivity | src/templates.js | function(options) {
var extraClass = options.highlighted ? ' highlighted' : '';
return (
'<span class="selectivity-multiple-selected-item' +
extraClass +
'" ' +
'data-item-id="' +
escape(options.id) +
'">' +
(options.rem... | javascript | function(options) {
var extraClass = options.highlighted ? ' highlighted' : '';
return (
'<span class="selectivity-multiple-selected-item' +
extraClass +
'" ' +
'data-item-id="' +
escape(options.id) +
'">' +
(options.rem... | [
"function",
"(",
"options",
")",
"{",
"var",
"extraClass",
"=",
"options",
".",
"highlighted",
"?",
"' highlighted'",
":",
"''",
";",
"return",
"(",
"'<span class=\"selectivity-multiple-selected-item'",
"+",
"extraClass",
"+",
"'\" '",
"+",
"'data-item-id=\"'",
"+",... | Renders a selected item in multi-selection input boxes.
The template is expected to have a top-level element with the class
'selectivity-multiple-selected-item'. This element is also required to have a 'data-item-id'
attribute with the ID set to that passed through the options object.
An element with the class 'selec... | [
"Renders",
"a",
"selected",
"item",
"in",
"multi",
"-",
"selection",
"input",
"boxes",
"."
] | 00e0657aea491ea41547979b62e8f9fc48f36549 | https://github.com/arendjr/selectivity/blob/00e0657aea491ea41547979b62e8f9fc48f36549/src/templates.js#L132-L149 | |
15,997 | arendjr/selectivity | src/templates.js | function(options) {
return (
'<div class="selectivity-result-item' +
(options.disabled ? ' disabled' : '') +
'"' +
' data-item-id="' +
escape(options.id) +
'">' +
escape(options.text) +
(options.submenu
... | javascript | function(options) {
return (
'<div class="selectivity-result-item' +
(options.disabled ? ' disabled' : '') +
'"' +
' data-item-id="' +
escape(options.id) +
'">' +
escape(options.text) +
(options.submenu
... | [
"function",
"(",
"options",
")",
"{",
"return",
"(",
"'<div class=\"selectivity-result-item'",
"+",
"(",
"options",
".",
"disabled",
"?",
"' disabled'",
":",
"''",
")",
"+",
"'\"'",
"+",
"' data-item-id=\"'",
"+",
"escape",
"(",
"options",
".",
"id",
")",
"+... | Render a result item in the dropdown.
The template is expected to have a top-level element with the class
'selectivity-result-item'. This element is also required to have a 'data-item-id' attribute
with the ID set to that passed through the options object.
@param options Options object containing the following proper... | [
"Render",
"a",
"result",
"item",
"in",
"the",
"dropdown",
"."
] | 00e0657aea491ea41547979b62e8f9fc48f36549 | https://github.com/arendjr/selectivity/blob/00e0657aea491ea41547979b62e8f9fc48f36549/src/templates.js#L190-L204 | |
15,998 | arendjr/selectivity | src/plugins/submenu.js | SubmenuPlugin | function SubmenuPlugin(selectivity, options) {
/**
* Optional parent dropdown menu from which this dropdown was opened.
*/
this.parentMenu = options.parentMenu;
Dropdown.call(this, selectivity, options);
this._closeSubmenuTimeout = 0;
this._openSubmenuTimeout = 0;
} | javascript | function SubmenuPlugin(selectivity, options) {
/**
* Optional parent dropdown menu from which this dropdown was opened.
*/
this.parentMenu = options.parentMenu;
Dropdown.call(this, selectivity, options);
this._closeSubmenuTimeout = 0;
this._openSubmenuTimeout = 0;
} | [
"function",
"SubmenuPlugin",
"(",
"selectivity",
",",
"options",
")",
"{",
"/**\n * Optional parent dropdown menu from which this dropdown was opened.\n */",
"this",
".",
"parentMenu",
"=",
"options",
".",
"parentMenu",
";",
"Dropdown",
".",
"call",
"(",
"this",
"... | Extended dropdown that supports submenus. | [
"Extended",
"dropdown",
"that",
"supports",
"submenus",
"."
] | 00e0657aea491ea41547979b62e8f9fc48f36549 | https://github.com/arendjr/selectivity/blob/00e0657aea491ea41547979b62e8f9fc48f36549/src/plugins/submenu.js#L11-L22 |
15,999 | arendjr/selectivity | src/plugins/submenu.js | setSelectable | function setSelectable(item) {
if (item.children) {
item.children.forEach(setSelectable);
}
if (item.submenu) {
item.selectable = !!item.selectable;
}
} | javascript | function setSelectable(item) {
if (item.children) {
item.children.forEach(setSelectable);
}
if (item.submenu) {
item.selectable = !!item.selectable;
}
} | [
"function",
"setSelectable",
"(",
"item",
")",
"{",
"if",
"(",
"item",
".",
"children",
")",
"{",
"item",
".",
"children",
".",
"forEach",
"(",
"setSelectable",
")",
";",
"}",
"if",
"(",
"item",
".",
"submenu",
")",
"{",
"item",
".",
"selectable",
"=... | makes sure any result item with a submenu that's not explicitly set as selectable becomes unselectable | [
"makes",
"sure",
"any",
"result",
"item",
"with",
"a",
"submenu",
"that",
"s",
"not",
"explicitly",
"set",
"as",
"selectable",
"becomes",
"unselectable"
] | 00e0657aea491ea41547979b62e8f9fc48f36549 | https://github.com/arendjr/selectivity/blob/00e0657aea491ea41547979b62e8f9fc48f36549/src/plugins/submenu.js#L122-L129 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.