[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 33/46: js2-parse-primary-expr: Make some vars "more" local
From: |
Dmitry Gutov |
Subject: |
[elpa] 33/46: js2-parse-primary-expr: Make some vars "more" local |
Date: |
Sat, 15 Nov 2014 20:58:09 +0000 |
dgutov pushed a commit to branch master
in repository elpa.
commit f31437301a02ef2387320819e5c9a4350aec3b81
Author: Dmitry Gutov <address@hidden>
Date: Sat Nov 1 14:55:51 2014 +0300
js2-parse-primary-expr: Make some vars "more" local
---
js2-mode.el | 15 ++++++---------
1 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/js2-mode.el b/js2-mode.el
index 7546640..04dd34d 100644
--- a/js2-mode.el
+++ b/js2-mode.el
@@ -9205,10 +9205,7 @@ For instance, @[expr], @*::[expr], or ns::[expr]."
Includes complex literals such as functions, object-literals,
array-literals, array comprehensions and regular expressions."
(let (pn ; parent node (usually return value)
- tt
- px-pos ; paren-expr pos
- len
- expr)
+ tt)
(setq tt (js2-current-token-type))
(cond
((= tt js2-FUNCTION)
@@ -9234,8 +9231,8 @@ array-literals, array comprehensions and regular
expressions."
(js2-record-face 'font-lock-string-face)))
((or (= tt js2-DIV) (= tt js2-ASSIGN_DIV))
;; Got / or /= which in this context means a regexp literal
- (setq px-pos (js2-current-token-beg))
- (let ((flags (js2-read-regexp tt))
+ (let ((px-pos (js2-current-token-beg))
+ (flags (js2-read-regexp tt))
(end (js2-current-token-end)))
(prog1
(make-js2-regexp-node :pos px-pos
@@ -9278,9 +9275,9 @@ array-literals, array comprehensions and regular
expressions."
;; the scanner or one of its subroutines reported the error.
(make-js2-error-node))
((= tt js2-EOF)
- (setq px-pos (point-at-bol)
- len (- js2-ts-cursor px-pos))
- (js2-report-error "msg.unexpected.eof" nil px-pos len)
+ (let* ((px-pos (point-at-bol))
+ (len (- js2-ts-cursor px-pos)))
+ (js2-report-error "msg.unexpected.eof" nil px-pos len))
(make-js2-error-node :pos (1- js2-ts-cursor)))
(t
(js2-report-error "msg.syntax")
- [elpa] 26/46: Allow 'in' operator inside 'for' init when unambiguous, (continued)
- [elpa] 26/46: Allow 'in' operator inside 'for' init when unambiguous, Dmitry Gutov, 2014/11/15
- [elpa] 27/46: Fix parsing of let expressions, Dmitry Gutov, 2014/11/15
- [elpa] 18/46: Merge pull request #149 from lewang/dont-parse-killed-buffer, Dmitry Gutov, 2014/11/15
- [elpa] 28/46: js2-parse-let: Simplify, Dmitry Gutov, 2014/11/15
- [elpa] 22/46: Support ES6 number literals, Dmitry Gutov, 2014/11/15
- [elpa] 21/46: js2-get-token-internal-1: add a FIXME, Dmitry Gutov, 2014/11/15
- [elpa] 20/46: js2-read-unicode-escape: use a stricter regexp, Dmitry Gutov, 2014/11/15
- [elpa] 29/46: Fontify negation operator, Dmitry Gutov, 2014/11/15
- [elpa] 32/46: Fix #171, Dmitry Gutov, 2014/11/15
- [elpa] 31/46: js2-mode-find-enclosing-node: Make docstring and impl consistent with name, Dmitry Gutov, 2014/11/15
- [elpa] 33/46: js2-parse-primary-expr: Make some vars "more" local,
Dmitry Gutov <=
- [elpa] 34/46: Add imenu support for the Sencha framework, Dmitry Gutov, 2014/11/15
- [elpa] 36/46: Indent before inequality operator at bol, Dmitry Gutov, 2014/11/15
- [elpa] 38/46: Indent after `+=', Dmitry Gutov, 2014/11/15
- [elpa] 37/46: Support object destructuring inside arrow function args, Dmitry Gutov, 2014/11/15
- [elpa] 30/46: js2-imenu-extras.el: Use Unix-style EOL, Dmitry Gutov, 2014/11/15
- [elpa] 42/46: js2-imenu-walk-ast: Look up js2-imenu-show-module-pattern in v-i-n case, too, Dmitry Gutov, 2014/11/15
- [elpa] 40/46: Support orphan functions on the right side of assignments, Dmitry Gutov, 2014/11/15
- [elpa] 35/46: Merge pull request #173 from lelit/master, Dmitry Gutov, 2014/11/15
- [elpa] 43/46: Fix toggling single-line comments, Dmitry Gutov, 2014/11/15
- [elpa] 41/46: js2-imenu-record-module-pattern: Support `js2-var-init-node', Dmitry Gutov, 2014/11/15