This commit is contained in:
David Teller 2022-07-19 17:36:28 +02:00
parent fb54799463
commit 3cb4ffc3e6

View File

@ -12,7 +12,7 @@ const TokenizrClass = Tokenizr || TokenizrModule;
export class Lexer extends TokenizrClass {
constructor(string: string) {
super();
console.debug("YORIC", "Lexer", 0);
// Ignore whitespace.
this.rule(/\s+/, (ctx) => {
ctx.ignore()
@ -58,6 +58,7 @@ export class Lexer extends TokenizrClass {
});
// Dates and durations.
console.debug("YORIC", "Lexer", 1);
try {
this.rule("dateOrDuration", /(?:"([^"]+)")|(\S+)/, (ctx, match) => {
let content = match[1] || match[2];