Files
airllm-fork-nodejs/node_modules/node-llama-cpp/dist/utils/gbnfJson/terminals/GbnfCommaWhitespace.js
2026-02-05 15:27:49 +08:00

28 lines
1003 B
JavaScript

import { GbnfTerminal } from "../GbnfTerminal.js";
import { GbnfGrammar } from "./GbnfGrammar.js";
import { GbnfWhitespace } from "./GbnfWhitespace.js";
import { reservedRuleNames } from "./gbnfConsts.js";
export class GbnfCommaWhitespace extends GbnfTerminal {
scopeState;
newLine;
constructor(scopeState, { newLine = "before" } = {}) {
super();
this.scopeState = scopeState;
this.newLine = newLine;
}
getGrammar() {
return new GbnfGrammar([
'","', new GbnfWhitespace(this.scopeState, { newLine: this.newLine }).getGrammar()
]).getGrammar();
}
getRuleName() {
return reservedRuleNames.commaWhitespace({
newLine: this.scopeState.settings.allowNewLines
? this.newLine
: false,
scopeSpaces: this.scopeState.settings.scopePadSpaces,
nestingScope: this.scopeState.currentNestingScope
});
}
}
//# sourceMappingURL=GbnfCommaWhitespace.js.map