[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 4a1b4e8 09/22: Parse without error first method in a class
From: |
Dmitry Gutov |
Subject: |
[elpa] master 4a1b4e8 09/22: Parse without error first method in a class with keyword name |
Date: |
Fri, 24 Apr 2015 02:57:11 +0000 |
branch: master
commit 4a1b4e8d089724445c01278247a6bfebe1d54009
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>
Parse without error first method in a class with keyword name
Make 'static' just a reserved word, for now. Traceur calls it that anyway.
Using js2-match-token was a problem because it stored a wrong token in
js2-ti-tokens (read without the modifier).
Fixes #216
---
js2-mode.el | 24 ++++++++++++++----------
1 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/js2-mode.el b/js2-mode.el
index 7314c28..1a7a852 100644
--- a/js2-mode.el
+++ b/js2-mode.el
@@ -650,11 +650,10 @@ which doesn't seem particularly useful, but Rhino permits
it."
(defvar js2-ARROW 162) ; function arrow (=>)
(defvar js2-CLASS 163)
(defvar js2-EXTENDS 164)
-(defvar js2-STATIC 165)
-(defvar js2-SUPER 166)
-(defvar js2-TEMPLATE_HEAD 167) ; part of template literal before
substitution
-(defvar js2-NO_SUBS_TEMPLATE 168) ; template literal without substitutions
-(defvar js2-TAGGED_TEMPLATE 169) ; tagged template literal
+(defvar js2-SUPER 165)
+(defvar js2-TEMPLATE_HEAD 166) ; part of template literal before
substitution
+(defvar js2-NO_SUBS_TEMPLATE 167) ; template literal without substitutions
+(defvar js2-TAGGED_TEMPLATE 168) ; tagged template literal
(defconst js2-num-tokens (1+ js2-TAGGED_TEMPLATE))
@@ -5690,7 +5689,7 @@ into temp buffers."
let
new null
return
- static super switch
+ super switch
this throw true try typeof
var void
while with
@@ -5711,7 +5710,7 @@ into temp buffers."
js2-LET
js2-NEW js2-NULL
js2-RETURN
- js2-STATIC js2-SUPER js2-SWITCH
+ js2-SUPER js2-SWITCH
js2-THIS js2-THROW js2-TRUE js2-TRY js2-TYPEOF
js2-VAR
js2-WHILE js2-WITH
@@ -5736,7 +5735,7 @@ The values are default faces to use for highlighting the
keywords.")
;; FIXME: Support strict mode-only future reserved words, after we know
;; which parts scopes are in strict mode, and which are not.
-(defconst js2-reserved-words '(class enum export extends import super)
+(defconst js2-reserved-words '(class enum export extends import static super)
"Future reserved keywords in ECMAScript 5.1.")
(defconst js2-keyword-names
@@ -10321,9 +10320,14 @@ If ONLY-OF-P is non-nil, only the 'for (foo of bar)'
form is allowed."
(continue t)
tt elems elem after-comma)
(while continue
- (setq static (and class-p (js2-match-token js2-STATIC))
- tt (js2-get-prop-name-token)
+ (setq tt (js2-get-prop-name-token)
+ static nil
elem nil)
+ (when (and class-p (= js2-NAME tt)
+ (string= "static" (js2-current-token-string)))
+ (js2-record-face 'font-lock-keyword-face)
+ (setq static t
+ tt (js2-get-prop-name-token)))
(cond
;; {foo: ...}, {'foo': ...}, {foo, bar, ...},
;; {get foo() {...}}, {set foo(x) {...}}, or {foo(x) {...}}
- [elpa] master updated (c10ba4b -> 54df259), Dmitry Gutov, 2015/04/23
- [elpa] master fae5776 01/22: Check that the let declaration comes before the reference, Dmitry Gutov, 2015/04/23
- [elpa] master dd2106b 02/22: Merge branch 'let-temporal-dz', Dmitry Gutov, 2015/04/23
- [elpa] master 28853c9 03/22: do auto semicolon insert on function exports, Dmitry Gutov, 2015/04/23
- [elpa] master dfad0d5 04/22: Merge pull request #211 from cowboyd/no-semicolon-warning-on-function-export, Dmitry Gutov, 2015/04/23
- [elpa] master 02fea21 06/22: Merge pull request #213 from lelit/typos, Dmitry Gutov, 2015/04/23
- [elpa] master bf454ef 05/22: Fix typos in comments and docstrings, Dmitry Gutov, 2015/04/23
- [elpa] master 7bf479a 08/22: Fix js2-paren-node length, Dmitry Gutov, 2015/04/23
- [elpa] master 4d8ec67 07/22: Rely on bogus scopes less, Dmitry Gutov, 2015/04/23
- [elpa] master 4a1b4e8 09/22: Parse without error first method in a class with keyword name,
Dmitry Gutov <=
- [elpa] master 90a9056 10/22: ...or any following one, Dmitry Gutov, 2015/04/23
- [elpa] master bc61ce0 11/22: Fix off-by-one error for comment node length, Dmitry Gutov, 2015/04/23
- [elpa] master 3b76567 12/22: Fix js2-node-get-enclosing-scope, Dmitry Gutov, 2015/04/23
- [elpa] master 458d3fe 14/22: Merge pull request #221 from jacksonrayhamilton/enclosing-scope, Dmitry Gutov, 2015/04/23
- [elpa] master a184642 13/22: Merge pull request #220 from jacksonrayhamilton/comment-length, Dmitry Gutov, 2015/04/23
- [elpa] master 2bb4db0 15/22: Assign quote syntax to backquotes, Dmitry Gutov, 2015/04/23
- [elpa] master 4de6f03 16/22: Don't indent in multiline strings, Dmitry Gutov, 2015/04/23
- [elpa] master ee4a202 18/22: Merge pull request #195 from jacksonrayhamilton/pretty-multiline-declarations, Dmitry Gutov, 2015/04/23
- [elpa] master d4d9c54 17/22: js2-pretty-multiline-declarations: Add 'dynamic option, Dmitry Gutov, 2015/04/23
- [elpa] master 9790b97 19/22: * js2-mode.el (js2-mode): Use cursor-sensor-mode if available., Dmitry Gutov, 2015/04/23