- web/: Vue 3 + Vite + UnoCSS + Pinia, dark tactical theme (amber/#0d1117) - AppNav, ListingCard, SearchView with filters/sort, composables (useSnipeMode, useKonamiCode, useMotion), Pinia search store - Steal shimmer, auction countdown, Snipe Mode easter egg all native in Vue - docker/web/: nginx + multi-stage Dockerfile (node build → nginx serve) - compose.yml: api (8510) + web (8509) services - Dockerfile CMD updated to uvicorn for upcoming FastAPI layer - Clean build: 0 TS errors, 380 modules
67 lines
1.5 KiB
JavaScript
67 lines
1.5 KiB
JavaScript
'use strict';
|
|
|
|
const types = require('../../tokenizer/types.cjs');
|
|
|
|
const name = 'FeatureFunction';
|
|
const structure = {
|
|
kind: String,
|
|
feature: String,
|
|
value: ['Declaration', 'Selector']
|
|
};
|
|
|
|
function getFeatureParser(kind, name) {
|
|
const featuresOfKind = this.features[kind] || {};
|
|
const parser = featuresOfKind[name];
|
|
|
|
if (typeof parser !== 'function') {
|
|
this.error(`Unknown feature ${name}()`);
|
|
}
|
|
|
|
return parser;
|
|
}
|
|
|
|
function parse(kind = 'unknown') {
|
|
const start = this.tokenStart;
|
|
const functionName = this.consumeFunctionName();
|
|
const valueParser = getFeatureParser.call(this, kind, functionName.toLowerCase());
|
|
|
|
this.skipSC();
|
|
|
|
const value = this.parseWithFallback(
|
|
() => {
|
|
const startValueToken = this.tokenIndex;
|
|
const value = valueParser.call(this);
|
|
|
|
if (this.eof === false &&
|
|
this.isBalanceEdge(startValueToken) === false) {
|
|
this.error();
|
|
}
|
|
|
|
return value;
|
|
},
|
|
() => this.Raw(null, false)
|
|
);
|
|
|
|
if (!this.eof) {
|
|
this.eat(types.RightParenthesis);
|
|
}
|
|
|
|
return {
|
|
type: 'FeatureFunction',
|
|
loc: this.getLocation(start, this.tokenStart),
|
|
kind,
|
|
feature: functionName,
|
|
value
|
|
};
|
|
}
|
|
|
|
function generate(node) {
|
|
this.token(types.Function, node.feature + '(');
|
|
this.node(node.value);
|
|
this.token(types.RightParenthesis, ')');
|
|
}
|
|
|
|
exports.generate = generate;
|
|
exports.name = name;
|
|
exports.parse = parse;
|
|
exports.structure = structure;
|