[Pkg-javascript-commits] [node-acorn-jsx] 342/484: Loose: Fix regex after tokenizer changes in #144.

Bastien Roucariès rouca at moszumanska.debian.org
Sat Aug 19 14:20:53 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch master
in repository node-acorn-jsx.

commit 2419de74dcf88d3a7a0b34a8845ea1d444f1538a
Author: Ingvar Stepanyan <me at rreverser.com>
Date:   Fri Oct 31 00:47:33 2014 +0200

    Loose: Fix regex after tokenizer changes in #144.
---
 acorn_loose.js | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/acorn_loose.js b/acorn_loose.js
index f551679..261d9e7 100644
--- a/acorn_loose.js
+++ b/acorn_loose.js
@@ -695,7 +695,16 @@
       var id = parseIdent();
       return eat(tt.arrow) ? parseArrowExpression(startNodeAt(start), [id]) : id;
 
-    case tt.num: case tt.string: case tt.regexp: 
+    case tt.regexp:
+      var node = startNode();
+      var val = token.value;
+      node.regex = {pattern: val.pattern, flags: val.flags};
+      node.value = val.value;
+      node.raw = input.slice(token.start, token.end);
+      next();
+      return finishNode(node, "Literal");
+
+    case tt.num: case tt.string:
       var node = startNode();
       node.value = token.value;
       node.raw = input.slice(token.start, token.end);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-acorn-jsx.git



More information about the Pkg-javascript-commits mailing list