First upload version 0.0.1
This commit is contained in:
28
node_modules/node-llama-cpp/dist/utils/gbnfJson/terminals/GbnfCommaWhitespace.js
generated
vendored
Normal file
28
node_modules/node-llama-cpp/dist/utils/gbnfJson/terminals/GbnfCommaWhitespace.js
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
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
|
||||
Reference in New Issue
Block a user