[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 71416f6 08/31: Merge pull request #366 from XeCycle/drop-y
From: |
Dmitry Gutov |
Subject: |
[elpa] master 71416f6 08/31: Merge pull request #366 from XeCycle/drop-yield-paren |
Date: |
Fri, 21 Jul 2017 09:04:55 -0400 (EDT) |
branch: master
commit 71416f652d7dc2530fc4d3bafab57a09707f5342
Merge: faf73e8 bb6c388
Author: Dmitry Gutov <address@hidden>
Commit: GitHub <address@hidden>
Merge pull request #366 from XeCycle/drop-yield-paren
Fix some yield parsing (#362)
---
js2-mode.el | 13 ++++---------
tests/parser.el | 3 +++
2 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/js2-mode.el b/js2-mode.el
index 2848a2c..d18455d 100644
--- a/js2-mode.el
+++ b/js2-mode.el
@@ -1359,9 +1359,6 @@ the correct number of ARGS must be provided."
(js2-msg "msg.bad.yield"
"yield must be in a function.")
-(js2-msg "msg.yield.parenthesized"
- "yield expression must be parenthesized.")
-
(js2-msg "msg.bad.await"
"await must be in async functions.")
@@ -9363,7 +9360,7 @@ Last matched token must be js2-CONST or js2-VAR."
(js2-parse-return-or-yield (js2-current-token-type) nil))
(defconst js2-parse-return-stmt-enders
- (list js2-SEMI js2-RC js2-EOF js2-EOL js2-ERROR js2-RB js2-RP js2-YIELD))
+ (list js2-SEMI js2-RC js2-EOF js2-EOL js2-ERROR js2-RB js2-RP))
(defsubst js2-now-all-set (before after mask)
"Return whether or not the bits in the mask have changed to all set.
@@ -9391,7 +9388,9 @@ but not BEFORE."
(setq yield-star-p t))
;; This is ugly, but we don't want to require a semicolon.
(unless (memq (js2-peek-token-or-eol) js2-parse-return-stmt-enders)
- (setq e (js2-parse-expr)
+ (setq e (if (eq gen-type 'STAR)
+ (js2-parse-assign-expr)
+ (js2-parse-expr))
end (js2-node-end e)))
(cond
((eq tt js2-RETURN)
@@ -9772,8 +9771,6 @@ If NODE is non-nil, it is the AST node associated with
the symbol."
(while (and (not oneshot)
(js2-match-token js2-COMMA))
(setq op-pos (- (js2-current-token-beg) pos)) ; relative
- (if (= (js2-peek-token) js2-YIELD)
- (js2-report-error "msg.yield.parenthesized"))
(setq right (js2-parse-assign-expr)
left pn
pn (make-js2-infix-node :type js2-COMMA
@@ -10162,8 +10159,6 @@ Returns the list in reverse order. Consumes the
right-paren token."
(unless (js2-match-token js2-RP)
(cl-loop do
(let ((tt (js2-get-token)))
- (if (= tt js2-YIELD)
- (js2-report-error "msg.yield.parenthesized"))
(if (and (= tt js2-TRIPLEDOT)
(>= js2-language-version 200))
(push (js2-make-unary tt 'js2-parse-assign-expr) result)
diff --git a/tests/parser.el b/tests/parser.el
index de97343..ead7a88 100644
--- a/tests/parser.el
+++ b/tests/parser.el
@@ -456,6 +456,9 @@ the test."
(js2-deftest-parse harmony-generator-yield-star "(function*(a) { yield*
a;\n});")
+(js2-deftest-parse harmony-generator-yield-assign-expr
+ "(function*() { return {a: yield a, b: yield b, c: yield c};\n});")
+
;;; Comprehensions
(js2-deftest-parse parse-legacy-array-comp-loop-with-filter
- [elpa] master updated (a69e424 -> 231ac7f), Dmitry Gutov, 2017/07/21
- [elpa] master da4793e 02/31: ignored warning support, Dmitry Gutov, 2017/07/21
- [elpa] master faf73e8 03/31: Merge pull request #404 from jordonbiondo/feature/ignore-warnings, Dmitry Gutov, 2017/07/21
- [elpa] master 0b09004 04/31: Drop msg.yield.parenthesized error, Dmitry Gutov, 2017/07/21
- [elpa] master 9b20642 01/31: Add support for /*jslint*/ declarations, Dmitry Gutov, 2017/07/21
- [elpa] master 8d05bb7 05/31: yield should not end a return statement, Dmitry Gutov, 2017/07/21
- [elpa] master bb6c388 06/31: ES6 yield is followed by AssignmentExpression, Dmitry Gutov, 2017/07/21
- [elpa] master 32f9782 12/31: Remove js2-mark-safe-local, it's unused now, Dmitry Gutov, 2017/07/21
- [elpa] master 71416f6 08/31: Merge pull request #366 from XeCycle/drop-yield-paren,
Dmitry Gutov <=
- [elpa] master 4787b5f 09/31: Merge pull request #363 from XeCycle/class-public-field, Dmitry Gutov, 2017/07/21
- [elpa] master cb8607c 25/31: Add failing test for issue #420, Dmitry Gutov, 2017/07/21
- [elpa] master 908395e 11/31: Allow trailing comma in param list (#410), Dmitry Gutov, 2017/07/21
- [elpa] master 659f683 14/31: Merge pull request #421 from raxod502/feat/C-M-j, Dmitry Gutov, 2017/07/21
- [elpa] master 8a5f492 20/31: Merge pull request #425 from shicks/jsdoc, Dmitry Gutov, 2017/07/21
- [elpa] master d3b31ba 10/31: js2-node-qname-component: Nandle computed properties, Dmitry Gutov, 2017/07/21
- [elpa] master 4a87822 13/31: Map C-M-j to js2-line-break, Dmitry Gutov, 2017/07/21
- [elpa] master ca7df5b 16/31: Merge branch 'master' of github.com:mooz/js2-mode, Dmitry Gutov, 2017/07/21
- [elpa] master b3f74f0 19/31: Fix jsdoc highlighting for tags w/ optional braces, Dmitry Gutov, 2017/07/21
- [elpa] master 9ce2542 07/31: Add support for ES7 class public fields, Dmitry Gutov, 2017/07/21