Skip to content

Commit

Permalink
Fix: remove unused lookbehind pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
Wanasit Tanakitrungruang committed Mar 12, 2023
1 parent 7108a59 commit 8b64dcb
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions src/locales/en/parsers/ENCasualDateParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import { AbstractParserWithWordBoundaryChecking } from "../../../common/parsers/
import { assignSimilarDate } from "../../../utils/dayjs";
import * as references from "../../../common/casualReferences";

const PATTERN =
/(now|today|tonight|tomorrow|tmr|tmrw|yesterday|last\s*night|(?<!\d\s*)day\s*after\s*tomorrow|(?<!\d\s*)day\s*before\s*yesterday)(?=\W|$)/i;
const PATTERN = /(now|today|tonight|tomorrow|tmr|tmrw|yesterday|last\s*night)(?=\W|$)/i;

export default class ENCasualDateParser extends AbstractParserWithWordBoundaryChecking {
innerPattern(context: ParsingContext): RegExp {
Expand Down Expand Up @@ -45,15 +44,6 @@ export default class ENCasualDateParser extends AbstractParserWithWordBoundaryCh
assignSimilarDate(component, targetDate);
component.imply("hour", 0);
}

if (lowerText.match(/after\s*tomorrow/)) {
return references.theDayAfter(context.reference, 2);
}

if (lowerText.match(/before\s*yesterday/)) {
return references.theDayBefore(context.reference, 2);
}

break;
}

Expand Down

0 comments on commit 8b64dcb

Please sign in to comment.