+ ((= tt js2-RP)
+ ;; Not valid expression syntax, but this is valid in an arrow
+ ;; function with no params: () => body.
+ (if (eq (js2-peek-token) js2-ARROW)
+ (progn
+ (js2-unget-token) ; Put back the right paren.
+ ;; Return whatever, it will hopefully be rewinded and
+ ;; reparsed when we reach the =>.
+ (make-js2-keyword-node :type js2-NULL))
+ (js2-report-error "msg.syntax")
+ (make-js2-error-node)))
+ ((= tt js2-TRIPLEDOT)
+ ;; Likewise, only valid in an arrow function with a rest param.
+ (if (and (js2-match-token js2-NAME)
+ (js2-match-token js2-RP)
+ (eq (js2-peek-token) js2-ARROW))
+ (progn
+ (js2-unget-token) ; Put back the right paren.
+ ;; See the previous case.
+ (make-js2-keyword-node :type js2-NULL))
+ (js2-report-error "msg.syntax")
+ (make-js2-error-node)))