Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor command-line handling #335

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
WIP
  • Loading branch information
Yoric committed Jul 19, 2022
commit 3cb4ffc3e67172c92898da5a4760bc65af932392
3 changes: 2 additions & 1 deletion src/commands/Lexer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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];
Expand Down