[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: parse.js
"use strict"; // Following http://www.w3.org/TR/css3-selectors/#nth-child-pseudo Object.defineProperty(exports, "__esModule", { value: true }); exports.parse = void 0; // Whitespace as per https://www.w3.org/TR/selectors-3/#lex is " \t\r\n\f" var whitespace = new Set([9, 10, 12, 13, 32]); var ZERO = "0".charCodeAt(0); var NINE = "9".charCodeAt(0); /** * Parses an expression. * * @throws An `Error` if parsing fails. * @returns An array containing the integer step size and the integer offset of the nth rule. * @example nthCheck.parse("2n+3"); // returns [2, 3] */ function parse(formula) { formula = formula.trim().toLowerCase(); if (formula === "even") { return [2, 0]; } else if (formula === "odd") { return [2, 1]; } // Parse [ ['-'|'+']? INTEGER? {N} [ S* ['-'|'+'] S* INTEGER ]? var idx = 0; var a = 0; var sign = readSign(); var number = readNumber(); if (idx < formula.length && formula.charAt(idx) === "n") { idx++; a = sign * (number !== null && number !== void 0 ? number : 1); skipWhitespace(); if (idx < formula.length) { sign = readSign(); skipWhitespace(); number = readNumber(); } else { sign = number = 0; } } // Throw if there is anything else if (number === null || idx < formula.length) { throw new Error("n-th rule couldn't be parsed ('" + formula + "')"); } return [a, sign * number]; function readSign() { if (formula.charAt(idx) === "-") { idx++; return -1; } if (formula.charAt(idx) === "+") { idx++; } return 1; } function readNumber() { var start = idx; var value = 0; while (idx < formula.length && formula.charCodeAt(idx) >= ZERO && formula.charCodeAt(idx) <= NINE) { value = value * 10 + (formula.charCodeAt(idx) - ZERO); idx++; } // Return `null` if we didn't read anything. return idx === start ? null : value; } function skipWhitespace() { while (idx < formula.length && whitespace.has(formula.charCodeAt(idx))) { idx++; } } } exports.parse = parse;
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.67 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002