mirror of
https://github.com/R0m1k3/Loki.git
synced 2026-10-16 19:59:56 +02:00
Trois défauts sans rapport entre eux, tous visibles à l'écran. Jauge de contexte bloquée à « 0 / N (0 %) » : le comptage exact vient de usage.prompt_tokens (include_usage), qu'un llama-server récent a cessé de renvoyer. On note désormais si l'usage est arrivé ; sinon la fin de tour publie l'estimation qui pilote déjà la compaction — approximative, mais jamais absente. Et la souscription envoie la valeur courante juste après le rattrapage : une page rechargée affichait zéro sur une discussion pourtant pleine, faute d'événement ctx_used dans la fenêtre rejouée. Espace disque : « il ne reste que 11,9 Go » sur un partage Unraid qui en a des centaines. /mnt/user est servi par shfs, un FUSE qui agrège plusieurs disques — statfs y renvoie l'espace d'un seul, et ce chiffre REFUSAIT l'installation du modèle. Les systèmes de fichiers qui approximent (FUSE, overlay, NFS, CIFS, Ceph, Gluster) sont reconnus par leur magie : leur chiffre reste affiché, précédé d'un « ~ », mais ne bloque plus rien. Panneau Fichiers : le panneau entier défilait, emportant vers le haut l'en-tête, le fil d'Ariane et le pied (occupation disque, bouton .zip) dès qu'il y avait quelques fichiers. Seule la liste défile maintenant ; le pied reste en bas et l'état vide se centre. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
160 lines
5.2 KiB
JavaScript
160 lines
5.2 KiB
JavaScript
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _flow = require('../plugins/flow');
|
|
var _typescript = require('../plugins/typescript');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var _index = require('../tokenizer/index');
|
|
var _keywords = require('../tokenizer/keywords');
|
|
var _types = require('../tokenizer/types');
|
|
var _base = require('./base');
|
|
var _expression = require('./expression');
|
|
var _util = require('./util');
|
|
|
|
function parseSpread() {
|
|
_index.next.call(void 0, );
|
|
_expression.parseMaybeAssign.call(void 0, false);
|
|
} exports.parseSpread = parseSpread;
|
|
|
|
function parseRest(isBlockScope) {
|
|
_index.next.call(void 0, );
|
|
parseBindingAtom(isBlockScope);
|
|
} exports.parseRest = parseRest;
|
|
|
|
function parseBindingIdentifier(isBlockScope) {
|
|
_expression.parseIdentifier.call(void 0, );
|
|
markPriorBindingIdentifier(isBlockScope);
|
|
} exports.parseBindingIdentifier = parseBindingIdentifier;
|
|
|
|
function parseImportedIdentifier() {
|
|
_expression.parseIdentifier.call(void 0, );
|
|
_base.state.tokens[_base.state.tokens.length - 1].identifierRole = _index.IdentifierRole.ImportDeclaration;
|
|
} exports.parseImportedIdentifier = parseImportedIdentifier;
|
|
|
|
function markPriorBindingIdentifier(isBlockScope) {
|
|
let identifierRole;
|
|
if (_base.state.scopeDepth === 0) {
|
|
identifierRole = _index.IdentifierRole.TopLevelDeclaration;
|
|
} else if (isBlockScope) {
|
|
identifierRole = _index.IdentifierRole.BlockScopedDeclaration;
|
|
} else {
|
|
identifierRole = _index.IdentifierRole.FunctionScopedDeclaration;
|
|
}
|
|
_base.state.tokens[_base.state.tokens.length - 1].identifierRole = identifierRole;
|
|
} exports.markPriorBindingIdentifier = markPriorBindingIdentifier;
|
|
|
|
// Parses lvalue (assignable) atom.
|
|
function parseBindingAtom(isBlockScope) {
|
|
switch (_base.state.type) {
|
|
case _types.TokenType._this: {
|
|
// In TypeScript, "this" may be the name of a parameter, so allow it.
|
|
const oldIsType = _index.pushTypeContext.call(void 0, 0);
|
|
_index.next.call(void 0, );
|
|
_index.popTypeContext.call(void 0, oldIsType);
|
|
return;
|
|
}
|
|
|
|
case _types.TokenType._yield:
|
|
case _types.TokenType.name: {
|
|
_base.state.type = _types.TokenType.name;
|
|
parseBindingIdentifier(isBlockScope);
|
|
return;
|
|
}
|
|
|
|
case _types.TokenType.bracketL: {
|
|
_index.next.call(void 0, );
|
|
parseBindingList(_types.TokenType.bracketR, isBlockScope, true /* allowEmpty */);
|
|
return;
|
|
}
|
|
|
|
case _types.TokenType.braceL:
|
|
_expression.parseObj.call(void 0, true, isBlockScope);
|
|
return;
|
|
|
|
default:
|
|
_util.unexpected.call(void 0, );
|
|
}
|
|
} exports.parseBindingAtom = parseBindingAtom;
|
|
|
|
function parseBindingList(
|
|
close,
|
|
isBlockScope,
|
|
allowEmpty = false,
|
|
allowModifiers = false,
|
|
contextId = 0,
|
|
) {
|
|
let first = true;
|
|
|
|
let hasRemovedComma = false;
|
|
const firstItemTokenIndex = _base.state.tokens.length;
|
|
|
|
while (!_index.eat.call(void 0, close) && !_base.state.error) {
|
|
if (first) {
|
|
first = false;
|
|
} else {
|
|
_util.expect.call(void 0, _types.TokenType.comma);
|
|
_base.state.tokens[_base.state.tokens.length - 1].contextId = contextId;
|
|
// After a "this" type in TypeScript, we need to set the following comma (if any) to also be
|
|
// a type token so that it will be removed.
|
|
if (!hasRemovedComma && _base.state.tokens[firstItemTokenIndex].isType) {
|
|
_base.state.tokens[_base.state.tokens.length - 1].isType = true;
|
|
hasRemovedComma = true;
|
|
}
|
|
}
|
|
if (allowEmpty && _index.match.call(void 0, _types.TokenType.comma)) {
|
|
// Empty item; nothing further to parse for this item.
|
|
} else if (_index.eat.call(void 0, close)) {
|
|
break;
|
|
} else if (_index.match.call(void 0, _types.TokenType.ellipsis)) {
|
|
parseRest(isBlockScope);
|
|
parseAssignableListItemTypes();
|
|
// Support rest element trailing commas allowed by TypeScript <2.9.
|
|
_index.eat.call(void 0, _types.TokenType.comma);
|
|
_util.expect.call(void 0, close);
|
|
break;
|
|
} else {
|
|
parseAssignableListItem(allowModifiers, isBlockScope);
|
|
}
|
|
}
|
|
} exports.parseBindingList = parseBindingList;
|
|
|
|
function parseAssignableListItem(allowModifiers, isBlockScope) {
|
|
if (allowModifiers) {
|
|
_typescript.tsParseModifiers.call(void 0, [
|
|
_keywords.ContextualKeyword._public,
|
|
_keywords.ContextualKeyword._protected,
|
|
_keywords.ContextualKeyword._private,
|
|
_keywords.ContextualKeyword._readonly,
|
|
_keywords.ContextualKeyword._override,
|
|
]);
|
|
}
|
|
|
|
parseMaybeDefault(isBlockScope);
|
|
parseAssignableListItemTypes();
|
|
parseMaybeDefault(isBlockScope, true /* leftAlreadyParsed */);
|
|
}
|
|
|
|
function parseAssignableListItemTypes() {
|
|
if (_base.isFlowEnabled) {
|
|
_flow.flowParseAssignableListItemTypes.call(void 0, );
|
|
} else if (_base.isTypeScriptEnabled) {
|
|
_typescript.tsParseAssignableListItemTypes.call(void 0, );
|
|
}
|
|
}
|
|
|
|
// Parses assignment pattern around given atom if possible.
|
|
function parseMaybeDefault(isBlockScope, leftAlreadyParsed = false) {
|
|
if (!leftAlreadyParsed) {
|
|
parseBindingAtom(isBlockScope);
|
|
}
|
|
if (!_index.eat.call(void 0, _types.TokenType.eq)) {
|
|
return;
|
|
}
|
|
const eqIndex = _base.state.tokens.length - 1;
|
|
_expression.parseMaybeAssign.call(void 0, );
|
|
_base.state.tokens[eqIndex].rhsEndIndex = _base.state.tokens.length;
|
|
} exports.parseMaybeDefault = parseMaybeDefault;
|