[Pkg-javascript-commits] [node-acorn-jsx] 79/484: [loose parser] Support tabSize option
Bastien Roucariès
rouca at moszumanska.debian.org
Sat Aug 19 14:20:07 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 d08144c1d7732ffc28210196638e59694ca41032
Author: Marijn Haverbeke <marijnh at gmail.com>
Date: Wed Jan 16 17:53:37 2013 +0100
[loose parser] Support tabSize option
---
acorn_loose.js | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/acorn_loose.js b/acorn_loose.js
index f31c7ea..59ea3c5 100644
--- a/acorn_loose.js
+++ b/acorn_loose.js
@@ -40,6 +40,7 @@
if (!opts) opts = {};
input = String(inpt);
options = opts;
+ if (!opts.tabSize) opts.tabSize = 4;
fetchToken = acorn.tokenize(inpt, opts);
next();
return parseTopLevel();
@@ -126,7 +127,7 @@
for (var cur = lineStart(pos), count = 0; cur < pos; ++cur) {
var ch = input.charCodeAt(cur);
if (ch === 32) ++count;
- else if (ch === 9) count += 4;
+ else if (ch === 9) count += options.tabSize;
}
return count;
}
--
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