This repository has been archived on 2026-03-06. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
openclaw-extensions/wecom/node_modules/node-llama-cpp/dist/utils/gbnfJson/terminals/GbnfStringValue.js
T

26 lines
740 B
JavaScript

import { GbnfTerminal } from "../GbnfTerminal.js";
export class GbnfStringValue extends GbnfTerminal {
value;
constructor(value) {
super();
this.value = value;
}
getGrammar() {
return [
'"',
'\\"',
this.value
.replaceAll("\\", "\\\\\\\\")
.replaceAll("\t", "\\\\t")
.replaceAll("\r", "\\\\r")
.replaceAll("\n", "\\\\n")
.replaceAll('"', "\\\\" + '\\"'),
'\\"',
'"'
].join("");
}
generateRuleName(grammarGenerator) {
return grammarGenerator.generateRuleNameForLiteralValue(this.value);
}
}
//# sourceMappingURL=GbnfStringValue.js.map