[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 32/46: Fix #171
From: |
Dmitry Gutov |
Subject: |
[elpa] 32/46: Fix #171 |
Date: |
Sat, 15 Nov 2014 20:58:08 +0000 |
dgutov pushed a commit to branch master
in repository elpa.
commit d860d8f3c51af44f2b5bab32316beaafb440518f
Author: Dmitry Gutov <address@hidden>
Date: Sat Nov 1 14:47:01 2014 +0300
Fix #171
* js2-mode.el (js2-parse-primary-expr): Use
`js2-current-token-end' to retrieve the end of the current token.
This works better if parsing errored on EOF.
(js2-read-regexp): Don't try to set `syntax-table' property (it
didn't work anyway, `syntax-class' is bogus).
---
js2-mode.el | 23 ++++++++++-------------
1 files changed, 10 insertions(+), 13 deletions(-)
diff --git a/js2-mode.el b/js2-mode.el
index e5683a2..7546640 100644
--- a/js2-mode.el
+++ b/js2-mode.el
@@ -5946,10 +5946,7 @@ its relevant fields and puts it into `js2-ti-tokens'."
(if (js2-alpha-p (js2-peek-char))
(js2-report-scan-error "msg.invalid.re.flag" t
js2-ts-cursor 1))
- (js2-set-string-from-buffer token)
- ;; tell `parse-partial-sexp' to ignore this range of chars
- (js2-record-text-property (js2-current-token-beg)
- (js2-current-token-end) 'syntax-class '(2)))
+ (js2-set-string-from-buffer token))
(js2-collect-string flags)))
(defun js2-get-first-xml-token ()
@@ -9211,7 +9208,6 @@ array-literals, array comprehensions and regular
expressions."
tt
px-pos ; paren-expr pos
len
- flags ; regexp flags
expr)
(setq tt (js2-current-token-type))
(cond
@@ -9239,14 +9235,15 @@ array-literals, array comprehensions and regular
expressions."
((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))
- (setq flags (js2-read-regexp tt))
- (prog1
- (make-js2-regexp-node :pos px-pos
- :len (- js2-ts-cursor px-pos)
- :value (js2-current-token-string)
- :flags flags)
- (js2-set-face px-pos js2-ts-cursor 'font-lock-string-face 'record)
- (js2-record-text-property px-pos js2-ts-cursor 'syntax-table '(2))))
+ (let ((flags (js2-read-regexp tt))
+ (end (js2-current-token-end)))
+ (prog1
+ (make-js2-regexp-node :pos px-pos
+ :len (- end px-pos)
+ :value (js2-current-token-string)
+ :flags flags)
+ (js2-set-face px-pos end 'font-lock-string-face 'record)
+ (js2-record-text-property px-pos end 'syntax-table '(2)))))
((or (= tt js2-NULL)
(= tt js2-THIS)
(= tt js2-FALSE)
- [elpa] 23/46: Add js2-language-version checks, (continued)
- [elpa] 23/46: Add js2-language-version checks, Dmitry Gutov, 2014/11/15
- [elpa] 25/46: Ignore integer overflow, Dmitry Gutov, 2014/11/15
- [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 <=
- [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, 2014/11/15
- [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