[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master a28a648 007/110: Remove await-node for 'awayt' and use una
From: |
Dmitry Gutov |
Subject: |
[elpa] master a28a648 007/110: Remove await-node for 'awayt' and use unary-node |
Date: |
Thu, 23 Jun 2016 01:12:52 +0000 (UTC) |
branch: master
commit a28a64884459713bb5162e7befb1ec5b08b678b7
Author: Masafumi Oyamada (mooz) <address@hidden>
Commit: Masafumi Oyamada (mooz) <address@hidden>
Remove await-node for 'awayt' and use unary-node
---
js2-mode.el | 35 ++++++++++-------------------------
1 file changed, 10 insertions(+), 25 deletions(-)
diff --git a/js2-mode.el b/js2-mode.el
index fd55d98..87de550 100644
--- a/js2-mode.el
+++ b/js2-mode.el
@@ -656,7 +656,9 @@ which doesn't seem particularly useful, but Rhino permits
it."
(defvar js2-NO_SUBS_TEMPLATE 168) ; template literal without substitutions
(defvar js2-TAGGED_TEMPLATE 169) ; tagged template literal
-(defconst js2-num-tokens (1+ js2-TAGGED_TEMPLATE))
+(defvar js2-AWAIT 170) ; await (pseudo keyword)
+
+(defconst js2-num-tokens (1+ js2-AWAIT))
(defconst js2-debug-print-trees nil)
@@ -3488,6 +3490,7 @@ The type field inherited from `js2-node' holds the
operator."
(cons js2-TYPEOF "typeof")
(cons js2-INSTANCEOF "instanceof")
(cons js2-DELPROP "delete")
+ (cons js2-AWAIT "await")
(cons js2-COMMA ",")
(cons js2-COLON ":")
(cons js2-OR "||")
@@ -3568,7 +3571,7 @@ The type field holds the actual assignment operator.")
len operand)))
"AST node type for unary operator nodes.
The type field can be NOT, BITNOT, POS, NEG, INC, DEC,
-TYPEOF, DELPROP or TRIPLEDOT. For INC or DEC, a 'postfix node
+TYPEOF, DELPROP, TRIPLEDOT or AWAIT. For INC or DEC, a 'postfix node
property is added if the operator follows the operand."
operand) ; a `js2-node' expression
@@ -3588,31 +3591,13 @@ property is added if the operator follows the operand."
(unless postfix
(insert op))
(if (or (= tt js2-TYPEOF)
- (= tt js2-DELPROP))
+ (= tt js2-DELPROP)
+ (= tt js2-AWAIT))
(insert " "))
(js2-print-ast (js2-unary-node-operand n) 0)
(when postfix
(insert op))))
-(cl-defstruct (js2-await-node
- (:include js2-node)
- (:constructor nil)
- (:constructor make-js2-await-node (&key (pos js2-ts-cursor)
- len operand)))
- "AST node type for await nodes."
- operand) ; a `js2-node' expression
-
-(put 'cl-struct-js2-await-node 'js2-visitor 'js2-visit-await-node)
-(put 'cl-struct-js2-await-node 'js2-printer 'js2-print-await-node)
-
-(defun js2-visit-await-node (n v)
- (js2-visit-ast (js2-await-node-operand n) v))
-
-(defun js2-print-await-node (n i)
- (insert (js2-make-pad i))
- (insert "await ")
- (js2-print-ast (js2-await-node-operand n) 0))
-
(cl-defstruct (js2-let-node
(:include js2-scope)
(:constructor nil)
@@ -5148,8 +5133,8 @@ You should use `js2-print-tree' instead of this function."
(or (js2-node-has-side-effects expr)
(when (js2-string-node-p expr)
(member (js2-string-node-value expr) '("use strict" "use
asm"))))))
- ((js2-await-node-p node)
- (js2-node-has-side-effects (js2-await-node-operand node)))
+ ((= tt js2-AWAIT)
+ (js2-node-has-side-effects (js2-unary-node-operand node)))
((= tt js2-COMMA)
(js2-node-has-side-effects (js2-infix-node-right node)))
((or (= tt js2-AND)
@@ -9633,7 +9618,7 @@ to parse the operand (for prefix operators)."
(js2-get-token)
(js2-make-unary js2-DELPROP 'js2-parse-unary-expr))
((js2-match-await)
- (js2-make-await))
+ (js2-make-unary js2-AWAIT 'js2-parse-unary-expr))
((= tt js2-ERROR)
(js2-get-token)
(make-js2-error-node)) ; try to continue
- [elpa] master 84379dd 004/110: Treat async/await as contextual keywords; Refs #185, (continued)
- [elpa] master 84379dd 004/110: Treat async/await as contextual keywords; Refs #185, Dmitry Gutov, 2016/06/22
- [elpa] master a2be944 014/110: Add a test for the latest change, Dmitry Gutov, 2016/06/22
- [elpa] master 34245fe 008/110: Don't treat getter / setter pairs as duplicates, Dmitry Gutov, 2016/06/22
- [elpa] master fb3f5b6 010/110: Fix 'make all' on older emacsen, Dmitry Gutov, 2016/06/22
- [elpa] master 37867af 020/110: Add NEWS entry about rename to method-node, Dmitry Gutov, 2016/06/22
- [elpa] master b904d10 023/110: Merge pull request #279 from XeCycle/class-semicolon-elem, Dmitry Gutov, 2016/06/22
- [elpa] master 8abf087 025/110: Report error for binding initializer outside destructuring, Dmitry Gutov, 2016/06/22
- [elpa] master 4c0408b 032/110: Add NEWS entry for js2-jsx-mode, Dmitry Gutov, 2016/06/22
- [elpa] master bfb83dd 017/110: Refactor: unify computed property name handling, Dmitry Gutov, 2016/06/22
- [elpa] master c63c700 029/110: Update MELPA URL, Dmitry Gutov, 2016/06/22
- [elpa] master a28a648 007/110: Remove await-node for 'awayt' and use unary-node,
Dmitry Gutov <=
- [elpa] master 2cf52e9 015/110: js2-parse-highlight-prop-get: Take care now to overwrite the js2-function-call face, Dmitry Gutov, 2016/06/22
- [elpa] master 3603bc4 018/110: Add test on shorthand method name and scoping, Dmitry Gutov, 2016/06/22
- [elpa] master 0555a8a 024/110: Support initializer in destructuring, Dmitry Gutov, 2016/06/22
- [elpa] master 1f95553 033/110: Add js2-jsx-mode usage instructions, Dmitry Gutov, 2016/06/22
- [elpa] master 47b215d 011/110: Define js2-object-property face, Dmitry Gutov, 2016/06/22
- [elpa] master c0e0309 022/110: Allow semicolons in a class body, Dmitry Gutov, 2016/06/22
- [elpa] master df3f97f 030/110: Add js2-jsx-mode, Dmitry Gutov, 2016/06/22
- [elpa] master 6aba571 021/110: Merge pull request #276 from XeCycle/methods, Dmitry Gutov, 2016/06/22
- [elpa] master 221282a 028/110: Merge pull request #280 from XeCycle/binding-pattern-initializer, Dmitry Gutov, 2016/06/22
- [elpa] master 2e7fdb3 012/110: Also highlight property lookups with the same face, Dmitry Gutov, 2016/06/22