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

24 lines
712 B
JavaScript

import { GbnfTerminal } from "../GbnfTerminal.js";
import { reservedRuleNames } from "./gbnfConsts.js";
export class GbnfInsideStringChar extends GbnfTerminal {
getGrammar() {
return [
negatedCharacterSet([
'"',
"\\\\",
"\\x7F",
"\\x00-\\x1F"
]),
// escape sequences
'"\\\\" ["\\\\/bfnrt]',
'"\\\\u" [0-9a-fA-F]{4}'
].join(" | ");
}
getRuleName() {
return reservedRuleNames.stringChar;
}
}
function negatedCharacterSet(characterDefinitions) {
return "[^" + characterDefinitions.join("") + "]";
}
//# sourceMappingURL=GbnfInsideStringChar.js.map