mirror of
https://github.com/matrix-org/mjolnir.git
synced 2024-10-01 01:36:06 -04:00
WIP
This commit is contained in:
parent
fb54799463
commit
3cb4ffc3e6
@ -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];
|
||||
|
Loading…
Reference in New Issue
Block a user