all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefankangas@gmail.com>
To: miha@kamnitnik.top, 59637@debbugs.gnu.org
Cc: Yuan Fu <casouri@gmail.com>
Subject: bug#59637: 29.0.50; Should treesit-range-settings support the possibility of separate parser for each region?
Date: Sun, 27 Nov 2022 09:28:56 -0800	[thread overview]
Message-ID: <CADwFkmkwVOx5OVJc2dfzNuhsqCUH9uJPa6R7OehbRXLN0k8nRQ@mail.gmail.com> (raw)
In-Reply-To: <87v8n0b9th.fsf@miha-pc>

miha--- via "Bug reports for GNU Emacs, the Swiss army knife of text
editors" <bug-gnu-emacs@gnu.org> writes:

> As far as I understand, the current behaviour of
> treesit-parser-set-included-ranges is that the concatenation of text
> from different regions in the same range set is considered as one
> program. This means that for this html program
>
>     <html>
>       <script>
>         /* comment start
>       </script>
>       <script>
>         alert('hello');
>       </script>
>     </html>
>
> treesitter would consider "alert('hello');" to be inside a comment and
> the second script tag would contain an error about missing comment
> end.
>
> However, testing this in Firefox, it seems that the first script tag is
> the erroneous one here and the alert function call isn't inside a
> comment. So I guess the correct way to parse this html document would be
> to have two instances of javascript parser, one for each region. On the
> other hand, we should consider if this is worth the added complexity and
> performance degradation.
>
> Thanks and best regards.

Copying in Yuan Fu.





  reply	other threads:[~2022-11-27 17:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-27 17:12 bug#59637: 29.0.50; Should treesit-range-settings support the possibility of separate parser for each region? miha--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-27 17:28 ` Stefan Kangas [this message]
2022-11-28 22:51 ` Yuan Fu

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=CADwFkmkwVOx5OVJc2dfzNuhsqCUH9uJPa6R7OehbRXLN0k8nRQ@mail.gmail.com \
    --to=stefankangas@gmail.com \
    --cc=59637@debbugs.gnu.org \
    --cc=casouri@gmail.com \
    --cc=miha@kamnitnik.top \
    /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.