format: prettify entire project

This commit is contained in:
Rim
2025-04-02 06:50:39 -04:00
parent 86f0782a98
commit 7ccc0be712
1711 changed files with 755867 additions and 235931 deletions

View File

@ -4,40 +4,45 @@ const types = require('../../tokenizer/types.cjs');
// var( <ident> , <value>? )
function varFn() {
const children = this.createList();
const children = this.createList();
this.skipSC();
this.skipSC();
// NOTE: Don't check more than a first argument is an ident, rest checks are for lexer
children.push(this.Identifier());
// NOTE: Don't check more than a first argument is an ident, rest checks are for lexer
children.push(this.Identifier());
this.skipSC();
this.skipSC();
if (this.tokenType === types.Comma) {
children.push(this.Operator());
if (this.tokenType === types.Comma) {
children.push(this.Operator());
const startIndex = this.tokenIndex;
const value = this.parseCustomProperty
? this.Value(null)
: this.Raw(this.tokenIndex, this.consumeUntilExclamationMarkOrSemicolon, false);
const startIndex = this.tokenIndex;
const value =
this.parseCustomProperty ?
this.Value(null)
: this.Raw(
this.tokenIndex,
this.consumeUntilExclamationMarkOrSemicolon,
false
);
if (value.type === 'Value' && value.children.isEmpty) {
for (let offset = startIndex - this.tokenIndex; offset <= 0; offset++) {
if (this.lookupType(offset) === types.WhiteSpace) {
value.children.appendData({
type: 'WhiteSpace',
loc: null,
value: ' '
});
break;
}
}
if (value.type === 'Value' && value.children.isEmpty) {
for (let offset = startIndex - this.tokenIndex; offset <= 0; offset++) {
if (this.lookupType(offset) === types.WhiteSpace) {
value.children.appendData({
type: 'WhiteSpace',
loc: null,
value: ' ',
});
break;
}
children.push(value);
}
}
return children;
children.push(value);
}
return children;
}
module.exports = varFn;