Commit 9c64c52b authored by Daniel Colascione's avatar Daniel Colascione
Browse files

Teach js-mode about ES6 generators

* lisp/progmodes/js.el (js--function-heading-1-re)
(js--function-prologue-beginning): Parse ES6 generator function
declarations.  (That is, "function* name()").
parent d1f848ff
2015-01-09 Daniel Colascione <dancol@dancol.org>
* progmodes/js.el (js--function-heading-1-re)
(js--function-prologue-beginning): Parse ES6 generator function
declarations. (That is, "function* name()").
2015-01-08 Stefan Monnier <monnier@iro.umontreal.ca>
* emacs-lisp/eieio.el (defclass): Move from eieio-defclass all the code
......
......@@ -248,7 +248,7 @@ name as matched contains
(defconst js--function-heading-1-re
(concat
"^\\s-*function\\s-+\\(" js--name-re "\\)")
"^\\s-*function\\(?:\\s-\\|\\*\\)+\\(" js--name-re "\\)")
"Regexp matching the start of a JavaScript function header.
Match group 1 is the name of the function.")
......@@ -796,6 +796,9 @@ determined. Otherwise, return nil."
(let ((name t))
(forward-word)
(forward-comment most-positive-fixnum)
(when (eq (char-after) ?*)
(forward-char)
(forward-comment most-positive-fixnum))
(when (looking-at js--name-re)
(setq name (match-string-no-properties 0))
(goto-char (match-end 0)))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment