From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: miha--- via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#59637: 29.0.50; Should treesit-range-settings support the possibility of separate parser for each region? Date: Sun, 27 Nov 2022 18:12:42 +0100 Message-ID: <87v8n0b9th.fsf@miha-pc> Reply-To: miha@kamnitnik.top Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35076"; mail-complaints-to="usenet@ciao.gmane.io" To: 59637@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 27 18:12:18 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ozLCT-0008sh-Nh for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 27 Nov 2022 18:12:17 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ozLCH-0008Uj-1z; Sun, 27 Nov 2022 12:12:05 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ozLCF-0008UZ-LI for bug-gnu-emacs@gnu.org; Sun, 27 Nov 2022 12:12:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ozLCF-0007p5-9K for bug-gnu-emacs@gnu.org; Sun, 27 Nov 2022 12:12:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ozLCE-0006qZ-4W for bug-gnu-emacs@gnu.org; Sun, 27 Nov 2022 12:12:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: miha@kamnitnik.top Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 27 Nov 2022 17:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 59637 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.166956909226310 (code B ref -1); Sun, 27 Nov 2022 17:12:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 27 Nov 2022 17:11:32 +0000 Original-Received: from localhost ([127.0.0.1]:43167 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ozLBj-0006qI-Vd for submit@debbugs.gnu.org; Sun, 27 Nov 2022 12:11:32 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:55506) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ozLBi-0006qC-D1 for submit@debbugs.gnu.org; Sun, 27 Nov 2022 12:11:30 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ozLBi-0008IO-8W for bug-gnu-emacs@gnu.org; Sun, 27 Nov 2022 12:11:30 -0500 Original-Received: from kamnitnik.top ([209.250.245.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ozLBe-0007fl-If for bug-gnu-emacs@gnu.org; Sun, 27 Nov 2022 12:11:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kamnitnik.top; s=mail; t=1669569084; bh=doWme5TRXYsBlAUPIub2saYZTNs1zUQlDUP9g04vSUQ=; h=From:To:Subject:Date:From; b=hHq884zUPly1WCsex3PsMEZv/tgDr6BJlHtCrEwU8/Qf84rpf3H8YR/dnEHWyqLX2 Hnf/8oAN9XZpVOHxtAsAPo6GT11OGJBNJok8f5syj/YIWGyIKp/8YbYVydWxwXaDza tHOgkMJygYtHlxizGX39ryK32G0CEvIjzsG0zXWdBqSkR0Re+AfaRPXL/vIcCxcgNC 84saKyyAbJLjOiXwPTnrfprD9toB1BnO/q6aKYgRZ0IBqScPGN93dxjXkBJtSfL4kP RE/HbAeOzmtkA0Vb7QAQVkB7tH2jfxzc8loaXgxj+Ia3wl9kLYAsGdCLxyGXNfzMfL Lj+bED7duPzmw== Received-SPF: pass client-ip=209.250.245.214; envelope-from=miha@kamnitnik.top; helo=kamnitnik.top X-Spam_score_int: 16 X-Spam_score: 1.6 X-Spam_bar: + X-Spam_report: (1.6 / 5.0 requ) BAYES_00=-1.9, CONTENT_AFTER_HTML_WEAK=1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FROM_SUSPICIOUS_NTLD=0.001, FROM_SUSPICIOUS_NTLD_FP=0.695, PDS_OTHER_BAD_TLD=1.999, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:249237 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable 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 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. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJHBAEBCAAxFiEEmxVnesoT5rQXvVXnswkaGpIVmT8FAmODmooTHG1paGFAa2Ft bml0bmlrLnRvcAAKCRCzCRoakhWZP/0SEACNj/sx7UXE+hzEmkKOk0X7OeKp0K5r 2dSTcSxLNO5/do66R0PZd2nEb0bfdQkP9WvCpNaKT/e5rzG+hRcWOfzRj0Frzn7g RKbMBpZ4kYFjnEELGi4JXfHeejXmjhpOf+N4JaP4KyerTUCTVrkIsb7ZzympWPXD ZIXWOdfYcwxFn0cN5rqDavrc22nBUof0h6++dezwjvrrpaxyjf0sB6FO7W2cfITO syMaiU2StsBjK3XErK0ATy+HCSwk6nsEz/f5MaKGpwS0vOYSZ2FBANe6UkBn39hZ nss0E4NtJ1hzxyBG/n3ID0t1RqnkmAcSwCxc8WmVO9uDrT9hUO6rHedeNOAsnHJE QN0ay7qkkHp9fBTL1GnLutyYSKv8elOmRuo3Ha7VjVt4VkgzsFJ5ChT67uFc1ypO WWueu66LCkog7hK5v58dveq/MXR1qAR1dGsLu+ePhEr0fN9TMDNAS6nQ+cHVS63D pR5xemn00gc+Hg4irldj6HwDzwmdEcquaWykCRctcEGxlUjlLFsDRqqTXFHmNBXP Vou7JCD6uWADbb8B0hKns29NeYf+w5Qi2UvUH19WVKuNZiu51O1VCEBgu29sZ6VT tjLISvQ9YWWtJl/Fu/9IKhRbPekDWZG5MDGq79vIrhdzeBgMS1+RLBVGvTJH3HD6 2bTfap5VNLvUBQ== =vAd4 -----END PGP SIGNATURE----- --=-=-=--