[Pkg-javascript-commits] [node-acorn-jsx] 80/484: [loose parser] Several small tweaks

Bastien Roucariès rouca at moszumanska.debian.org
Sat Aug 19 14:20:08 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 1d974ce2b6f146224644414ca45464c7565183a3
Author: Marijn Haverbeke <marijnh at gmail.com>
Date:   Wed Jan 16 19:09:06 2013 +0100

    [loose parser] Several small tweaks
---
 acorn_loose.js | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/acorn_loose.js b/acorn_loose.js
index 59ea3c5..7262e4c 100644
--- a/acorn_loose.js
+++ b/acorn_loose.js
@@ -132,7 +132,7 @@
     return count;
   }
   function closesBlock(closeTok, indent) {
-    return token.type === closeTok || token.type === tt.eof || indent > indentationAt(token.start);
+    return token.type === closeTok || token.type === tt.eof || indent > token.start - lineStart(token.start);
   }
 
   function node_t(start) {
@@ -627,16 +627,17 @@
     else node.id = null;
     node.params = [];
     expect(tt.parenL);
-    while (!eat(tt.parenR)) {
+    while (node.type == tt.name) {
       node.params.push(parseIdent());
       eat(tt.comma);
     }
+    eat(tt.parenR);
     node.body = parseBlock();
     return finishNode(node, isStatement ? "FunctionDeclaration" : "FunctionExpression");
   }
 
   function parseExprList(close) {
-    var elts = [], indent = indentationAt(token.start);
+    var elts = [], indent = indentationAt(token.start) + 1;
     while (!closesBlock(close, indent)) {
       elts.push(parseExpression$(true));
       while (eat(tt.comma)) {}

-- 
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