Fix code quality violations and exclude Manifest from checks
Document application modes (development/debug/production) Add global file drop handler, order column normalization, SPA hash fix Serve CDN assets via /_vendor/ URLs instead of merging into bundles Add production minification with license preservation Improve JSON formatting for debugging and production optimization Add CDN asset caching with CSS URL inlining for production builds Add three-mode system (development, debug, production) Update Manifest CLAUDE.md to reflect helper class architecture Refactor Manifest.php into helper classes for better organization Pre-manifest-refactor checkpoint: Add app_mode documentation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
415
node_modules/css-tree/lib/syntax/node/AnPlusB.js
generated
vendored
415
node_modules/css-tree/lib/syntax/node/AnPlusB.js
generated
vendored
@@ -1,21 +1,21 @@
|
||||
var cmpChar = require('../../tokenizer').cmpChar;
|
||||
var isDigit = require('../../tokenizer').isDigit;
|
||||
var TYPE = require('../../tokenizer').TYPE;
|
||||
import {
|
||||
isDigit,
|
||||
WhiteSpace,
|
||||
Comment,
|
||||
Ident,
|
||||
Number,
|
||||
Dimension
|
||||
} from '../../tokenizer/index.js';
|
||||
|
||||
var WHITESPACE = TYPE.WhiteSpace;
|
||||
var COMMENT = TYPE.Comment;
|
||||
var IDENT = TYPE.Ident;
|
||||
var NUMBER = TYPE.Number;
|
||||
var DIMENSION = TYPE.Dimension;
|
||||
var PLUSSIGN = 0x002B; // U+002B PLUS SIGN (+)
|
||||
var HYPHENMINUS = 0x002D; // U+002D HYPHEN-MINUS (-)
|
||||
var N = 0x006E; // U+006E LATIN SMALL LETTER N (n)
|
||||
var DISALLOW_SIGN = true;
|
||||
var ALLOW_SIGN = false;
|
||||
const PLUSSIGN = 0x002B; // U+002B PLUS SIGN (+)
|
||||
const HYPHENMINUS = 0x002D; // U+002D HYPHEN-MINUS (-)
|
||||
const N = 0x006E; // U+006E LATIN SMALL LETTER N (n)
|
||||
const DISALLOW_SIGN = true;
|
||||
const ALLOW_SIGN = false;
|
||||
|
||||
function checkInteger(offset, disallowSign) {
|
||||
var pos = this.scanner.tokenStart + offset;
|
||||
var code = this.scanner.source.charCodeAt(pos);
|
||||
let pos = this.tokenStart + offset;
|
||||
const code = this.charCodeAt(pos);
|
||||
|
||||
if (code === PLUSSIGN || code === HYPHENMINUS) {
|
||||
if (disallowSign) {
|
||||
@@ -24,8 +24,8 @@ function checkInteger(offset, disallowSign) {
|
||||
pos++;
|
||||
}
|
||||
|
||||
for (; pos < this.scanner.tokenEnd; pos++) {
|
||||
if (!isDigit(this.scanner.source.charCodeAt(pos))) {
|
||||
for (; pos < this.tokenEnd; pos++) {
|
||||
if (!isDigit(this.charCodeAt(pos))) {
|
||||
this.error('Integer is expected', pos);
|
||||
}
|
||||
}
|
||||
@@ -36,8 +36,8 @@ function checkTokenIsInteger(disallowSign) {
|
||||
}
|
||||
|
||||
function expectCharCode(offset, code) {
|
||||
if (!cmpChar(this.scanner.source, this.scanner.tokenStart + offset, code)) {
|
||||
var msg = '';
|
||||
if (!this.cmpChar(this.tokenStart + offset, code)) {
|
||||
let msg = '';
|
||||
|
||||
switch (code) {
|
||||
case N:
|
||||
@@ -48,32 +48,32 @@ function expectCharCode(offset, code) {
|
||||
break;
|
||||
}
|
||||
|
||||
this.error(msg, this.scanner.tokenStart + offset);
|
||||
this.error(msg, this.tokenStart + offset);
|
||||
}
|
||||
}
|
||||
|
||||
// ... <signed-integer>
|
||||
// ... ['+' | '-'] <signless-integer>
|
||||
function consumeB() {
|
||||
var offset = 0;
|
||||
var sign = 0;
|
||||
var type = this.scanner.tokenType;
|
||||
let offset = 0;
|
||||
let sign = 0;
|
||||
let type = this.tokenType;
|
||||
|
||||
while (type === WHITESPACE || type === COMMENT) {
|
||||
type = this.scanner.lookupType(++offset);
|
||||
while (type === WhiteSpace || type === Comment) {
|
||||
type = this.lookupType(++offset);
|
||||
}
|
||||
|
||||
if (type !== NUMBER) {
|
||||
if (this.scanner.isDelim(PLUSSIGN, offset) ||
|
||||
this.scanner.isDelim(HYPHENMINUS, offset)) {
|
||||
sign = this.scanner.isDelim(PLUSSIGN, offset) ? PLUSSIGN : HYPHENMINUS;
|
||||
if (type !== Number) {
|
||||
if (this.isDelim(PLUSSIGN, offset) ||
|
||||
this.isDelim(HYPHENMINUS, offset)) {
|
||||
sign = this.isDelim(PLUSSIGN, offset) ? PLUSSIGN : HYPHENMINUS;
|
||||
|
||||
do {
|
||||
type = this.scanner.lookupType(++offset);
|
||||
} while (type === WHITESPACE || type === COMMENT);
|
||||
type = this.lookupType(++offset);
|
||||
} while (type === WhiteSpace || type === Comment);
|
||||
|
||||
if (type !== NUMBER) {
|
||||
this.scanner.skip(offset);
|
||||
if (type !== Number) {
|
||||
this.skip(offset);
|
||||
checkTokenIsInteger.call(this, DISALLOW_SIGN);
|
||||
}
|
||||
} else {
|
||||
@@ -82,216 +82,211 @@ function consumeB() {
|
||||
}
|
||||
|
||||
if (offset > 0) {
|
||||
this.scanner.skip(offset);
|
||||
this.skip(offset);
|
||||
}
|
||||
|
||||
if (sign === 0) {
|
||||
type = this.scanner.source.charCodeAt(this.scanner.tokenStart);
|
||||
type = this.charCodeAt(this.tokenStart);
|
||||
if (type !== PLUSSIGN && type !== HYPHENMINUS) {
|
||||
this.error('Number sign is expected');
|
||||
}
|
||||
}
|
||||
|
||||
checkTokenIsInteger.call(this, sign !== 0);
|
||||
return sign === HYPHENMINUS ? '-' + this.consume(NUMBER) : this.consume(NUMBER);
|
||||
return sign === HYPHENMINUS ? '-' + this.consume(Number) : this.consume(Number);
|
||||
}
|
||||
|
||||
// An+B microsyntax https://www.w3.org/TR/css-syntax-3/#anb
|
||||
module.exports = {
|
||||
name: 'AnPlusB',
|
||||
structure: {
|
||||
a: [String, null],
|
||||
b: [String, null]
|
||||
},
|
||||
parse: function() {
|
||||
/* eslint-disable brace-style*/
|
||||
var start = this.scanner.tokenStart;
|
||||
var a = null;
|
||||
var b = null;
|
||||
export const name = 'AnPlusB';
|
||||
export const structure = {
|
||||
a: [String, null],
|
||||
b: [String, null]
|
||||
};
|
||||
|
||||
// <integer>
|
||||
if (this.scanner.tokenType === NUMBER) {
|
||||
checkTokenIsInteger.call(this, ALLOW_SIGN);
|
||||
b = this.consume(NUMBER);
|
||||
export function parse() {
|
||||
/* eslint-disable brace-style*/
|
||||
const start = this.tokenStart;
|
||||
let a = null;
|
||||
let b = null;
|
||||
|
||||
// <integer>
|
||||
if (this.tokenType === Number) {
|
||||
checkTokenIsInteger.call(this, ALLOW_SIGN);
|
||||
b = this.consume(Number);
|
||||
}
|
||||
|
||||
// -n
|
||||
// -n <signed-integer>
|
||||
// -n ['+' | '-'] <signless-integer>
|
||||
// -n- <signless-integer>
|
||||
// <dashndashdigit-ident>
|
||||
else if (this.tokenType === Ident && this.cmpChar(this.tokenStart, HYPHENMINUS)) {
|
||||
a = '-1';
|
||||
|
||||
expectCharCode.call(this, 1, N);
|
||||
|
||||
switch (this.tokenEnd - this.tokenStart) {
|
||||
// -n
|
||||
// -n <signed-integer>
|
||||
// -n ['+' | '-'] <signless-integer>
|
||||
case 2:
|
||||
this.next();
|
||||
b = consumeB.call(this);
|
||||
break;
|
||||
|
||||
// -n- <signless-integer>
|
||||
case 3:
|
||||
expectCharCode.call(this, 2, HYPHENMINUS);
|
||||
|
||||
this.next();
|
||||
this.skipSC();
|
||||
|
||||
checkTokenIsInteger.call(this, DISALLOW_SIGN);
|
||||
|
||||
b = '-' + this.consume(Number);
|
||||
break;
|
||||
|
||||
// <dashndashdigit-ident>
|
||||
default:
|
||||
expectCharCode.call(this, 2, HYPHENMINUS);
|
||||
checkInteger.call(this, 3, DISALLOW_SIGN);
|
||||
this.next();
|
||||
|
||||
b = this.substrToCursor(start + 2);
|
||||
}
|
||||
}
|
||||
|
||||
// '+'? n
|
||||
// '+'? n <signed-integer>
|
||||
// '+'? n ['+' | '-'] <signless-integer>
|
||||
// '+'? n- <signless-integer>
|
||||
// '+'? <ndashdigit-ident>
|
||||
else if (this.tokenType === Ident || (this.isDelim(PLUSSIGN) && this.lookupType(1) === Ident)) {
|
||||
let sign = 0;
|
||||
a = '1';
|
||||
|
||||
// just ignore a plus
|
||||
if (this.isDelim(PLUSSIGN)) {
|
||||
sign = 1;
|
||||
this.next();
|
||||
}
|
||||
|
||||
// -n
|
||||
// -n <signed-integer>
|
||||
// -n ['+' | '-'] <signless-integer>
|
||||
// -n- <signless-integer>
|
||||
// <dashndashdigit-ident>
|
||||
else if (this.scanner.tokenType === IDENT && cmpChar(this.scanner.source, this.scanner.tokenStart, HYPHENMINUS)) {
|
||||
a = '-1';
|
||||
expectCharCode.call(this, 0, N);
|
||||
|
||||
expectCharCode.call(this, 1, N);
|
||||
switch (this.tokenEnd - this.tokenStart) {
|
||||
// '+'? n
|
||||
// '+'? n <signed-integer>
|
||||
// '+'? n ['+' | '-'] <signless-integer>
|
||||
case 1:
|
||||
this.next();
|
||||
b = consumeB.call(this);
|
||||
break;
|
||||
|
||||
switch (this.scanner.getTokenLength()) {
|
||||
// -n
|
||||
// -n <signed-integer>
|
||||
// -n ['+' | '-'] <signless-integer>
|
||||
case 2:
|
||||
this.scanner.next();
|
||||
b = consumeB.call(this);
|
||||
break;
|
||||
// '+'? n- <signless-integer>
|
||||
case 2:
|
||||
expectCharCode.call(this, 1, HYPHENMINUS);
|
||||
|
||||
// -n- <signless-integer>
|
||||
case 3:
|
||||
expectCharCode.call(this, 2, HYPHENMINUS);
|
||||
this.next();
|
||||
this.skipSC();
|
||||
|
||||
this.scanner.next();
|
||||
this.scanner.skipSC();
|
||||
checkTokenIsInteger.call(this, DISALLOW_SIGN);
|
||||
|
||||
checkTokenIsInteger.call(this, DISALLOW_SIGN);
|
||||
b = '-' + this.consume(Number);
|
||||
break;
|
||||
|
||||
b = '-' + this.consume(NUMBER);
|
||||
break;
|
||||
// '+'? <ndashdigit-ident>
|
||||
default:
|
||||
expectCharCode.call(this, 1, HYPHENMINUS);
|
||||
checkInteger.call(this, 2, DISALLOW_SIGN);
|
||||
this.next();
|
||||
|
||||
// <dashndashdigit-ident>
|
||||
default:
|
||||
expectCharCode.call(this, 2, HYPHENMINUS);
|
||||
checkInteger.call(this, 3, DISALLOW_SIGN);
|
||||
this.scanner.next();
|
||||
b = this.substrToCursor(start + sign + 1);
|
||||
}
|
||||
}
|
||||
|
||||
b = this.scanner.substrToCursor(start + 2);
|
||||
// <ndashdigit-dimension>
|
||||
// <ndash-dimension> <signless-integer>
|
||||
// <n-dimension>
|
||||
// <n-dimension> <signed-integer>
|
||||
// <n-dimension> ['+' | '-'] <signless-integer>
|
||||
else if (this.tokenType === Dimension) {
|
||||
const code = this.charCodeAt(this.tokenStart);
|
||||
const sign = code === PLUSSIGN || code === HYPHENMINUS;
|
||||
let i = this.tokenStart + sign;
|
||||
|
||||
for (; i < this.tokenEnd; i++) {
|
||||
if (!isDigit(this.charCodeAt(i))) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// '+'? n
|
||||
// '+'? n <signed-integer>
|
||||
// '+'? n ['+' | '-'] <signless-integer>
|
||||
// '+'? n- <signless-integer>
|
||||
// '+'? <ndashdigit-ident>
|
||||
else if (this.scanner.tokenType === IDENT || (this.scanner.isDelim(PLUSSIGN) && this.scanner.lookupType(1) === IDENT)) {
|
||||
var sign = 0;
|
||||
a = '1';
|
||||
|
||||
// just ignore a plus
|
||||
if (this.scanner.isDelim(PLUSSIGN)) {
|
||||
sign = 1;
|
||||
this.scanner.next();
|
||||
}
|
||||
|
||||
expectCharCode.call(this, 0, N);
|
||||
|
||||
switch (this.scanner.getTokenLength()) {
|
||||
// '+'? n
|
||||
// '+'? n <signed-integer>
|
||||
// '+'? n ['+' | '-'] <signless-integer>
|
||||
case 1:
|
||||
this.scanner.next();
|
||||
b = consumeB.call(this);
|
||||
break;
|
||||
|
||||
// '+'? n- <signless-integer>
|
||||
case 2:
|
||||
expectCharCode.call(this, 1, HYPHENMINUS);
|
||||
|
||||
this.scanner.next();
|
||||
this.scanner.skipSC();
|
||||
|
||||
checkTokenIsInteger.call(this, DISALLOW_SIGN);
|
||||
|
||||
b = '-' + this.consume(NUMBER);
|
||||
break;
|
||||
|
||||
// '+'? <ndashdigit-ident>
|
||||
default:
|
||||
expectCharCode.call(this, 1, HYPHENMINUS);
|
||||
checkInteger.call(this, 2, DISALLOW_SIGN);
|
||||
this.scanner.next();
|
||||
|
||||
b = this.scanner.substrToCursor(start + sign + 1);
|
||||
}
|
||||
if (i === this.tokenStart + sign) {
|
||||
this.error('Integer is expected', this.tokenStart + sign);
|
||||
}
|
||||
|
||||
// <ndashdigit-dimension>
|
||||
// <ndash-dimension> <signless-integer>
|
||||
expectCharCode.call(this, i - this.tokenStart, N);
|
||||
a = this.substring(start, i);
|
||||
|
||||
// <n-dimension>
|
||||
// <n-dimension> <signed-integer>
|
||||
// <n-dimension> ['+' | '-'] <signless-integer>
|
||||
else if (this.scanner.tokenType === DIMENSION) {
|
||||
var code = this.scanner.source.charCodeAt(this.scanner.tokenStart);
|
||||
var sign = code === PLUSSIGN || code === HYPHENMINUS;
|
||||
|
||||
for (var i = this.scanner.tokenStart + sign; i < this.scanner.tokenEnd; i++) {
|
||||
if (!isDigit(this.scanner.source.charCodeAt(i))) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i === this.scanner.tokenStart + sign) {
|
||||
this.error('Integer is expected', this.scanner.tokenStart + sign);
|
||||
}
|
||||
|
||||
expectCharCode.call(this, i - this.scanner.tokenStart, N);
|
||||
a = this.scanner.source.substring(start, i);
|
||||
|
||||
// <n-dimension>
|
||||
// <n-dimension> <signed-integer>
|
||||
// <n-dimension> ['+' | '-'] <signless-integer>
|
||||
if (i + 1 === this.scanner.tokenEnd) {
|
||||
this.scanner.next();
|
||||
b = consumeB.call(this);
|
||||
} else {
|
||||
expectCharCode.call(this, i - this.scanner.tokenStart + 1, HYPHENMINUS);
|
||||
|
||||
// <ndash-dimension> <signless-integer>
|
||||
if (i + 2 === this.scanner.tokenEnd) {
|
||||
this.scanner.next();
|
||||
this.scanner.skipSC();
|
||||
checkTokenIsInteger.call(this, DISALLOW_SIGN);
|
||||
b = '-' + this.consume(NUMBER);
|
||||
}
|
||||
// <ndashdigit-dimension>
|
||||
else {
|
||||
checkInteger.call(this, i - this.scanner.tokenStart + 2, DISALLOW_SIGN);
|
||||
this.scanner.next();
|
||||
b = this.scanner.substrToCursor(i + 1);
|
||||
}
|
||||
}
|
||||
if (i + 1 === this.tokenEnd) {
|
||||
this.next();
|
||||
b = consumeB.call(this);
|
||||
} else {
|
||||
this.error();
|
||||
}
|
||||
expectCharCode.call(this, i - this.tokenStart + 1, HYPHENMINUS);
|
||||
|
||||
if (a !== null && a.charCodeAt(0) === PLUSSIGN) {
|
||||
a = a.substr(1);
|
||||
}
|
||||
|
||||
if (b !== null && b.charCodeAt(0) === PLUSSIGN) {
|
||||
b = b.substr(1);
|
||||
}
|
||||
|
||||
return {
|
||||
type: 'AnPlusB',
|
||||
loc: this.getLocation(start, this.scanner.tokenStart),
|
||||
a: a,
|
||||
b: b
|
||||
};
|
||||
},
|
||||
generate: function(node) {
|
||||
var a = node.a !== null && node.a !== undefined;
|
||||
var b = node.b !== null && node.b !== undefined;
|
||||
|
||||
if (a) {
|
||||
this.chunk(
|
||||
node.a === '+1' ? '+n' : // eslint-disable-line operator-linebreak, indent
|
||||
node.a === '1' ? 'n' : // eslint-disable-line operator-linebreak, indent
|
||||
node.a === '-1' ? '-n' : // eslint-disable-line operator-linebreak, indent
|
||||
node.a + 'n' // eslint-disable-line operator-linebreak, indent
|
||||
);
|
||||
|
||||
if (b) {
|
||||
b = String(node.b);
|
||||
if (b.charAt(0) === '-' || b.charAt(0) === '+') {
|
||||
this.chunk(b.charAt(0));
|
||||
this.chunk(b.substr(1));
|
||||
} else {
|
||||
this.chunk('+');
|
||||
this.chunk(b);
|
||||
}
|
||||
// <ndash-dimension> <signless-integer>
|
||||
if (i + 2 === this.tokenEnd) {
|
||||
this.next();
|
||||
this.skipSC();
|
||||
checkTokenIsInteger.call(this, DISALLOW_SIGN);
|
||||
b = '-' + this.consume(Number);
|
||||
}
|
||||
// <ndashdigit-dimension>
|
||||
else {
|
||||
checkInteger.call(this, i - this.tokenStart + 2, DISALLOW_SIGN);
|
||||
this.next();
|
||||
b = this.substrToCursor(i + 1);
|
||||
}
|
||||
} else {
|
||||
this.chunk(String(node.b));
|
||||
}
|
||||
} else {
|
||||
this.error();
|
||||
}
|
||||
};
|
||||
|
||||
if (a !== null && a.charCodeAt(0) === PLUSSIGN) {
|
||||
a = a.substr(1);
|
||||
}
|
||||
|
||||
if (b !== null && b.charCodeAt(0) === PLUSSIGN) {
|
||||
b = b.substr(1);
|
||||
}
|
||||
|
||||
return {
|
||||
type: 'AnPlusB',
|
||||
loc: this.getLocation(start, this.tokenStart),
|
||||
a,
|
||||
b
|
||||
};
|
||||
}
|
||||
|
||||
export function generate(node) {
|
||||
if (node.a) {
|
||||
const a =
|
||||
node.a === '+1' && 'n' ||
|
||||
node.a === '1' && 'n' ||
|
||||
node.a === '-1' && '-n' ||
|
||||
node.a + 'n';
|
||||
|
||||
if (node.b) {
|
||||
const b = node.b[0] === '-' || node.b[0] === '+'
|
||||
? node.b
|
||||
: '+' + node.b;
|
||||
this.tokenize(a + b);
|
||||
} else {
|
||||
this.tokenize(a);
|
||||
}
|
||||
} else {
|
||||
this.tokenize(node.b);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user