dgutov pushed a commit to branch master
in repository elpa.
commit f31437301a02ef2387320819e5c9a4350aec3b81
Author: Dmitry Gutov <[email protected]>
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")