all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Jimmy Yuen Ho Wong <wyuenho@gmail.com>
To: Noam Postavsky <npostavs@gmail.com>,
	Ruslan Bekenev <furyinbox@gmail.com>
Cc: 26750@debbugs.gnu.org
Subject: bug#26750: [PATCH] add missing keywords to js-mode
Date: Sat, 28 Apr 2018 22:46:55 +0100	[thread overview]
Message-ID: <9822cef6-7fb4-1b25-e056-a237fa706430@gmail.com> (raw)
In-Reply-To: <87zi1nox8m.fsf@gmail.com>

Technically, "async", "await" and "yield" can also be identifiers.
"async" should only be highlighted if it's followed by a function, arrow
function or a method. "await" should only be highlighted if it's inside
an async function, async arrow function or an async method. "yield"
should only be highlighted inside a generator function/arrow function
and method. But for all intends and purposes, you can put "await" and
"yield" into the list of keywords or you'll have to write a full blown
parser and AST in order to traverse back and forth. That's how Chrome
devtools does it anyway. Only "async", "as", "of" and "from" need
special handling.


On 28/04/2018 22:08, Noam Postavsky wrote:
> forcemerge 26750 31306
> quit
>
> Ruslan Bekenev <furyinbox@gmail.com> writes:
>
>> Hi. It is my first contribution. 
>> I hope everything is correct with this PATCH and submission itself. 
>> In this patch added two missed keywords to `js--keyword-re` which are `as` and `of`. 
>> `async` and `await` are already there. 
> Hi, sorry your patch was overlooked for so long.  Unfortunately, I think
> just adding keywords to js--keyword-re will not quite do the right
> thing, based on https://debbugs.gnu.org/cgi/bugreport.cgi?bug=31306#5:
>
>     Specially, "as" and "from" should only be highlighted in an import
>     statement. "of" should only be highlighted in a for statement. Any other
>     occurrances of "as", "from" and "of" should not be highlighted as they
>     are legal identifiers outside of import and for statements respectively.
>
>







      reply	other threads:[~2018-04-28 21:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-02 19:23 bug#26750: 25.2; js-mode missing keywords Yuen Ho Wong
2017-05-12 11:12 ` bug#26750: [PATCH] add missing keywords to js-mode Ruslan Bekenev
2018-04-28 21:08   ` Noam Postavsky
2018-04-28 21:46     ` Jimmy Yuen Ho Wong [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9822cef6-7fb4-1b25-e056-a237fa706430@gmail.com \
    --to=wyuenho@gmail.com \
    --cc=26750@debbugs.gnu.org \
    --cc=furyinbox@gmail.com \
    --cc=npostavs@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.