From patchwork Tue Dec 21 22:45:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Lepiller X-Patchwork-Id: 35559 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id E0C8F27BBEA; Tue, 21 Dec 2021 22:47:37 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id B48A627BBE9 for ; Tue, 21 Dec 2021 22:47:37 +0000 (GMT) Received: from localhost ([::1]:41954 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mznuy-0003RQ-Uc for patchwork@mira.cbaines.net; Tue, 21 Dec 2021 17:47:36 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39244) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mznta-0000A7-KN for guix-patches@gnu.org; Tue, 21 Dec 2021 17:46:11 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:44532) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mznta-0001h6-9X for guix-patches@gnu.org; Tue, 21 Dec 2021 17:46:10 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mznta-00082b-8o for guix-patches@gnu.org; Tue, 21 Dec 2021 17:46:10 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52723] [PATCH 22/26] guix: maven: Fix java parser. Resent-From: Julien Lepiller Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 21 Dec 2021 22:46:10 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52723 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52723@debbugs.gnu.org Received: via spool by 52723-submit@debbugs.gnu.org id=B52723.164012675230710 (code B ref 52723); Tue, 21 Dec 2021 22:46:10 +0000 Received: (at 52723) by debbugs.gnu.org; 21 Dec 2021 22:45:52 +0000 Received: from localhost ([127.0.0.1]:56052 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mzntI-0007zA-HC for submit@debbugs.gnu.org; Tue, 21 Dec 2021 17:45:52 -0500 Received: from lepiller.eu ([89.234.186.109]:52554) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mznsy-0007ve-KB for 52723@debbugs.gnu.org; Tue, 21 Dec 2021 17:45:33 -0500 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id f7edf91c for <52723@debbugs.gnu.org>; Tue, 21 Dec 2021 22:45:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=dkim; bh=oPQZM/DwMlMoCI4wokBLQwPiW t9rvf0O/ys1FhzDX9w=; b=ai58sSzielMJ9zEpUVUa4LbAcCXdpdFSXF/4YavHb Oy6WnCKwK1W+yZMBLINUo3MmTTbeBadYKwNnfbvSPz59PsTU0hA8aH/+jHRzkXcC s5HaWcnQD+xkzhsRMgGdcUnKFdl0tsOGZlXhNaP5SUBn9Tg/MuIY/poGnMIZ03Ea alSHp1FIq33+OHPMPoyMrDO6zCXvkoDDAtNgwgrJvJLHda44cPUfWffx5LOfHWBJ 1xnHq5lsixoyRlERyGXDCFd46oyiZw+xBjLbYLZCd4dks0azb6acNBVdpHxA06kW IjiX8e5OxUdjT9GbZacr0GVFfmCtTbgQrhet8Advp9V9w== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 498e78db (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO) for <52723@debbugs.gnu.org>; Tue, 21 Dec 2021 22:45:28 +0000 (UTC) From: Julien Lepiller Date: Tue, 21 Dec 2021 23:45:06 +0100 Message-Id: X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211221234231.44299f63@tachikoma.lepiller.eu> References: <20211221234231.44299f63@tachikoma.lepiller.eu> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * guix/build/maven/java.scm (comment, comment-chr): Support more comment styles. --- guix/build/maven/java.scm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/guix/build/maven/java.scm b/guix/build/maven/java.scm index daa4c88045..f8c8e5745d 100644 --- a/guix/build/maven/java.scm +++ b/guix/build/maven/java.scm @@ -31,11 +31,14 @@ (define-peg-pattern import-pat all (and (ignore "import") (* WS) (? (and (ignore "static") (* WS))) package-name (* WS) (ignore ";"))) -(define-peg-pattern comment all (and (? (and annotation-pat (* WS))) (ignore "/*") - comment-part)) +(define-peg-pattern comment all (or + (and (? (and annotation-pat (* WS))) (ignore "/*") + comment-part) + (and (ignore "//") (* (or "\t" (range #\ #\xffff))) + (or (ignore "\n") (ignore "\r")) (* WS)))) (define-peg-pattern comment-part body (or (ignore (and (* "*") "/")) (and (* "*") (+ comment-chr) comment-part))) -(define-peg-pattern comment-chr body (or "\t" "\n" (range #\ #\)) (range #\+ #\xffff))) +(define-peg-pattern comment-chr body (or "\t" "\n" "\r" (range #\ #\)) (range #\+ #\xffff))) (define-peg-pattern inline-comment none (and (ignore "//") (* inline-comment-chr) (ignore "\n"))) (define-peg-pattern inline-comment-chr body (range #\ #\xffff))