From c44e09bc7289508134cd799cb028a497a5500146 Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Thu, 15 Feb 2018 07:09:20 +0900 Subject: [PATCH] improve loose parser --- src/loose/state.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/loose/state.js b/src/loose/state.js index 571f472d6..da068edb5 100644 --- a/src/loose/state.js +++ b/src/loose/state.js @@ -1,5 +1,7 @@ import {tokenizer, SourceLocation, tokTypes as tt, Node, lineBreak, isNewLine} from "../index" +function noop() {} + // Registered plugins export const pluginsLoose = {} @@ -9,6 +11,8 @@ export class LooseParser { this.options = this.toks.options this.input = this.toks.input this.tok = this.last = {type: tt.eof, start: 0, end: 0} + this.tok.validateRegExpFlags = noop + this.tok.validateRegExpPattern = noop if (this.options.locations) { let here = this.toks.curPosition() this.tok.loc = new SourceLocation(this.toks, here, here)