From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mickey Petersen Newsgroups: gmane.emacs.bugs Subject: bug#61043: 30.0.50; `json-ts-mode': invalid font lock rule Date: Wed, 25 Jan 2023 12:09:08 +0000 Organization: Mastering Emacs Message-ID: <87ilgu3jdb.fsf@masteringemacs.org> References: <87lelrwv7f.fsf@masteringemacs.org> <87cz73vzpi.fsf@masteringemacs.org> <87o7qm95q8.fsf@thornhill.no> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27103"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e @VERSION@; emacs 30.0.50 Cc: 61043@debbugs.gnu.org, Dmitry Gutov To: Theodor Thornhill Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jan 25 13:11:16 2023 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 1pKecV-0006mt-7u for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 25 Jan 2023 13:11:15 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pKecK-0002hb-Nj; Wed, 25 Jan 2023 07:11:04 -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 1pKecI-0002gr-Su for bug-gnu-emacs@gnu.org; Wed, 25 Jan 2023 07:11:02 -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 1pKecI-0007df-KF for bug-gnu-emacs@gnu.org; Wed, 25 Jan 2023 07:11:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pKecI-0000yG-GO for bug-gnu-emacs@gnu.org; Wed, 25 Jan 2023 07:11:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Mickey Petersen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 25 Jan 2023 12:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61043 X-GNU-PR-Package: emacs Original-Received: via spool by 61043-submit@debbugs.gnu.org id=B61043.16746486383698 (code B ref 61043); Wed, 25 Jan 2023 12:11:02 +0000 Original-Received: (at 61043) by debbugs.gnu.org; 25 Jan 2023 12:10:38 +0000 Original-Received: from localhost ([127.0.0.1]:58520 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pKebu-0000xZ-2j for submit@debbugs.gnu.org; Wed, 25 Jan 2023 07:10:38 -0500 Original-Received: from mail-lo2gbr01on2092.outbound.protection.outlook.com ([40.107.10.92]:38242 helo=GBR01-LO2-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pKebr-0000xL-72 for 61043@debbugs.gnu.org; Wed, 25 Jan 2023 07:10:36 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jFkilu7zLaQZ4dq5XLRRkgnY0JInVtxHP3UpI+VdYy0k/Ueay6nAl1hf60l5EOXQShA56xS/gKp0SjedXzPNTZbEW9lsQ7iBqqGCt4P3tjGy+l2rcPMNqb3yUG6fGs6vj3fYvCFU1n4BK7xL+9Ut6aCpE3d8uzp8xhZrpu9Em+L/VZM6DP3FToVyK1eAyYdlpNLj0b4jRJFmQpN7l75dY8XqvaQ5cG5IdLP+aAN4SXqpDPcBk+iuzOE0eYTAWzQ1gmwW32pf5O36yO3guCPi6XgPeLa8xl+2/OcS9PFJ0AOkp+QaFKbUaryewTv7PI+LAayWLSyzwkSBq4DNx8FwIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=a90CNDThJbxQ90+Jr6dVaAsgu96+sdG2PTBdPgB20YY=; b=gpoG0G/aa4exg/WQ9hiYkONYOMt9+Q3B1FjGEPELcKd60rj+4kpneyZWMLLZpdyO32cHsX3ULFRCPouY0+fmnukDGRNsUVhJuDkkxu0XMt1oyJZ0+vkf9WEgL4Ww73u+/UA35QWPxJU1rtJTLLDTxqB/nksBTOmWWwvJhiVqawjp/f6bgrqVNpdwF0VxSa7VDN5tobSceLZfrKmC5Ro3PmcU96gkqIILN/rzMnen77efzESc2q/30ULppLT67IqTTVG9c9oFLHQBoLrukY9YO36y6emDLZlMpBjn1dWvZnZHIry2lKNENnXypLxJOqakqlwTzqa1x58Yu/79JAhLBA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 178.79.136.144) smtp.rcpttodomain=debbugs.gnu.org smtp.mailfrom=masteringemacs.org; dmarc=pass (p=none sp=none pct=100) action=none header.from=masteringemacs.org; dkim=pass (signature was verified) header.d=masteringemacs.org; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semantical.onmicrosoft.com; s=selector1-semantical-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=a90CNDThJbxQ90+Jr6dVaAsgu96+sdG2PTBdPgB20YY=; b=R3Iya7+iQGyGU4bPj32OXkX081Jpd3O73vvar3CFsY+L4Q8L0XAQsGb2JurZGIqdMZxbItwu77nlIvZbzvjSUJtD6vW4YPIPi5vRN8Zo+E2rlBpYWRZSabCKk2uN9KXfZkgACgR9ak80cvvUVlPljAVl3+7m9wFOXCj+QWJxn44= Original-Received: from CWLP265CA0493.GBRP265.PROD.OUTLOOK.COM (2603:10a6:400:18b::20) by CWLP265MB2562.GBRP265.PROD.OUTLOOK.COM (2603:10a6:400:a3::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.33; Wed, 25 Jan 2023 12:10:27 +0000 Original-Received: from CWLGBR01FT023.eop-gbr01.prod.protection.outlook.com (2603:10a6:400:18b:cafe::6d) by CWLP265CA0493.outlook.office365.com (2603:10a6:400:18b::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.21 via Frontend Transport; Wed, 25 Jan 2023 12:10:27 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 178.79.136.144) smtp.mailfrom=masteringemacs.org; dkim=pass (signature was verified) header.d=masteringemacs.org;dmarc=pass action=none header.from=masteringemacs.org; Received-SPF: Pass (protection.outlook.com: domain of masteringemacs.org designates 178.79.136.144 as permitted sender) receiver=protection.outlook.com; client-ip=178.79.136.144; helo=semantical.co.uk; pr=C Original-Received: from semantical.co.uk (178.79.136.144) by CWLGBR01FT023.mail.protection.outlook.com (10.152.40.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.17 via Frontend Transport; Wed, 25 Jan 2023 12:10:27 +0000 Original-Received: by semantical.co.uk (Postfix, from userid 5001) id 20344114002; Wed, 25 Jan 2023 12:10:27 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=masteringemacs.org; s=masteringemacs.org; t=1674648627; bh=a90CNDThJbxQ90+Jr6dVaAsgu96+sdG2PTBdPgB20YY=; h=References:From:To:Cc:Subject:Date:In-reply-to:From; b=zXN5wDxKYEG+1rqxCbnjvx86pSX6cuvCgTgWnN+a/2qY1EONeuE93NKqZWptQXIHx ah74HQhd3xpdbMSZ+q6ewXGZTMkycsIsEtDAf+0bBP+ikqBFbApYehhhLavsFftJvC g3Sh0FRZRC4NXfqt+uYR1/zPcdgfiDmLaZCyNgO8= In-reply-to: <87o7qm95q8.fsf@thornhill.no> X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CWLGBR01FT023:EE_|CWLP265MB2562:EE_ X-MS-Office365-Filtering-Correlation-Id: 078ce7c6-340a-4b82-1936-08dafecd2554 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9KTHUpBD/gqgW2SJWM/gUbdC4ExZQGWN/2uE1E87nDbnNs6js4Ip7TrfswWSS00fZ2GCO4hr9C+aGscLWL2VYaxSo6ajXpMCdYAWkJ/4AeErL3p9Jc8Itdf5lShbYP5dVufTIsQqRLn1Eh9IJQ9VPJYbGGw6qTYYzyHtyHdu4vMYdKm6bEJojgfr9ojXYBT4l63UN/6sZqau+W8/iJU+ebE0Dve4WeTh2Zks5ubPanj0JYAN4hTEFAmf8HBC2HLuZKwFfA+feT+milLCKBnBKWPN0c2w9XfRLTGrVqlEwXUuTEzN/K4pAMgTESYSWsiLBXqT7kbdY7IVfzSPh8sxBnhidaRnrO9r8yFUDXjXiqPx546jnYT3BIgVSfJ/dFVY0IvuDUfqEpTuxk7g3sBmIeApRDOv4v6qJNeQeM7jSvF7M4QA0eMPyfZysXfhMEf7qgDG7TAraGL6xAJg3Chhrj1dAPIDVy4xbjovi03vYC9TyhaK6UsiHWWzhSqJr+AEowlVybK/67NfkGlNLwSoXMhVZj68AmyVtI407cmtkPdpwLjkDQIMPGBh/cRjnE6T2ALSN4fmx16IytSOhTaT1NvRQvnfoh9VuOitNYvqOuNL4ahD0yCze8aFzTo87MMUIhcya1fhXWAOEgBlznCAjuzOmOyV53orNhrAPWuPoryeqTRKdn+3aDh+74GRCXKMXh3pzeA7djCoT4Eci5BYDkH1RC01jJ4+Uhnqu+QnqKUTxw7gvyVmFpdoErGH7 U571/i9aL2Dpj7lRHQoGxr/vILpuf12Zg+GVic3dkfW47LPy08yS+2ijQgUjulyOT4XbooCH9jiPuCfOVrNGIpcAQ== X-Forefront-Antispam-Report: CIP:178.79.136.144; CTRY:GB; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:semantical.co.uk; PTR:semantical.co.uk; CAT:NONE; SFS:(13230025)(376002)(39830400003)(396003)(136003)(346002)(451199018)(36840700001)(46966006)(356005)(40480700001)(7636003)(7596003)(36916002)(966005)(186003)(2906002)(82310400005)(86362001)(5660300002)(26005)(6266002)(8936002)(6862004)(36860700001)(83380400001)(6666004)(336012)(478600001)(42186006)(70206006)(316002)(36756003)(4326008)(53546011)(8676002)(70586007)(41300700001)(2616005)(47076005)(38230200001)(81973001)(23180200003)(79816003)(14776008); DIR:OUT; SFP:1102; X-OriginatorOrg: masteringemacs.org X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jan 2023 12:10:27.4006 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 078ce7c6-340a-4b82-1936-08dafecd2554 X-MS-Exchange-CrossTenant-Id: a4e27e3d-bab0-45e8-8942-e64cf9fbd34f X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=a4e27e3d-bab0-45e8-8942-e64cf9fbd34f; Ip=[178.79.136.144]; Helo=[semantical.co.uk] X-MS-Exchange-CrossTenant-AuthSource: CWLGBR01FT023.eop-gbr01.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CWLP265MB2562 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:254114 Archived-At: Theodor Thornhill writes: > Mickey Petersen writes: > >> Dmitry Gutov writes: >> >>> On 24/01/2023 22:09, Mickey Petersen wrote: >>>> There's a comment font lock rule in `json-ts-mode'. However, that is >>>> illegal and againt the JSON spec, and indeed the search query fails >>>> because `comment' is not a valid node type. >>> >>> When you say it fails, how does that look to you? >>> >>> Here's an example of a JSON file (or, more accurately, a JSON-superset >>> file) with comments: >>> https://raw.githubusercontent.com/huytd/vscode-espresso-tutti/master/themes/Espresso%20Tutti-color-theme.json >>> >>> The JSON tree-sitter grammar seems to parse them correctly as comments >>> ("comment" node type), and json-ts-mode highlights them as comments >>> correctly as a result. >> >> It may well be my JSON grammar file that is different then. Which is >> perhaps even worse: it is easy to find yourself with one of two >> versions. > > > See [0], it seems comment is supported if I'm not mistaken. > > Theo > > [0]: https://github.com/tree-sitter/tree-sitter-json/blob/master/grammar.js#L6 I understand. But nevertheless, I do get an error for that rule as it's missing (for some inexplicable reason.) It would be better if the font lock machinery disables/ignores the rule if it encounters a validation error. That way it'll gracefully degrade.