From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on starla X-Spam-Level: X-Spam-Status: No, score=-1.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 Received: from nue.mailmanlists.eu (nue.mailmanlists.eu [94.130.110.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 39E221F5CB for ; Wed, 2 Oct 2024 16:14:04 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; unprotected) header.d=ml.ruby-lang.org header.i=@ml.ruby-lang.org header.a=rsa-sha256 header.s=mail header.b=SQsGtmz7; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ruby-lang.org header.i=@ruby-lang.org header.a=rsa-sha256 header.s=s1 header.b=hsAt3KIH; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1727885611; bh=5cXbwKIRHsZ8/Fhj9Ii2SiimW3fwC2BatzBbDcmE/Vo=; h=Date:References:To:Reply-To:Subject:List-Id:List-Archive: List-Help:List-Owner:List-Post:List-Subscribe:List-Unsubscribe: From:Cc:From; b=SQsGtmz74jyrKb3MyI6OiHRxS1jZ0SG5Ylw/b5Es+gtAUsxLbbqT32f+td9of9Rs7 REGCRBs5DOo7uRJYhc7FOerltTFLrsY2TjJ+zIyiyCxhY6Gf7gqqkBO1+KPPuQjXAp 2xJvcke/WAmz0qRtZPVac6M3gdYLu3PMbIpgcX7s= Received: from nue.mailmanlists.eu (localhost [IPv6:::1]) by nue.mailmanlists.eu (Postfix) with ESMTP id 1F81743FA5 for ; Wed, 2 Oct 2024 16:13:31 +0000 (UTC) Authentication-Results: nue.mailmanlists.eu; dkim=pass (2048-bit key; unprotected) header.d=ruby-lang.org header.i=@ruby-lang.org header.a=rsa-sha256 header.s=s1 header.b=hsAt3KIH; dkim-atps=neutral Received: from s.wfbtzhsv.outbound-mail.sendgrid.net (s.wfbtzhsv.outbound-mail.sendgrid.net [159.183.224.104]) by nue.mailmanlists.eu (Postfix) with ESMTPS id 6506443EFB for ; Wed, 2 Oct 2024 16:13:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ruby-lang.org; h=from:references:subject:mime-version:content-type: content-transfer-encoding:list-id:to:cc:content-type:from:subject:to; s=s1; bh=5u9dkhl5sfimK082x9H3ITUYRDKj2H/T50kru2lzXP8=; b=hsAt3KIHdCuy9LqGJTjjIXUfrjAy5Z1lo9ecEsXisQyT92DY9CQ+YMWsPVL8vtpqCHB8 9j2joCV/BEznOco8vC3m40XYscwjdfik96It1XzJDs+fWpNlmz/NqQRhRibPQ7+J5uQ8RH cX/ci+1IB4AEufio2X1IPuMiswUHLqKRuB9shAcCx1YKQaNj8/e70ChOIK/sqBP/5sf753 rAoy1SRWg4WECWQ+p0hD8+woa64xJ24mAF3p295wXhNNJX25m12xzcXTNfzCm1LrIWzXv7 mszvLOzQpVJR5CEuYAj6B+oGAuV8gKIqqDe/HkBL2psIejltTss99Ph4rSBjEpTQ== Received: by recvd-55fc7fd858-rtqpx with SMTP id recvd-55fc7fd858-rtqpx-1-66FD711D-20 2024-10-02 16:13:17.953985731 +0000 UTC m=+1721616.933888759 Received: from herokuapp.com (unknown) by geopod-ismtpd-26 (SG) with ESMTP id LuIyYl0jRSKTLYVQLj1YqA for ; Wed, 02 Oct 2024 16:13:17.885 +0000 (UTC) Date: Wed, 02 Oct 2024 16:13:17 +0000 (UTC) Message-ID: References: Mime-Version: 1.0 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Bug X-Redmine-Issue-Id: 20776 X-Redmine-Issue-Author: nobu X-Redmine-Issue-Assignee: Group (prism) X-Redmine-Issue-Priority: Normal X-Redmine-Sender: kddnewton X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-Redmine-MailingListIntegration-Message-Ids: 96044 X-SG-EID: =?us-ascii?Q?u001=2E41nWPij=2FD1kdGmpgWeHScbb9X8tZePZrQQx3bl8Vy2odBuMhLMhId2kIq?= =?us-ascii?Q?I4MmMJ43lNHfKPNNds=2Fb3JsTYpYoWyQb3+sPV4d?= =?us-ascii?Q?vscaSKwkBzVvZ3i5MeLUZggozNd5GxV4ho9rlBX?= =?us-ascii?Q?e=2FrIZemZ2HtZhhlpP0cuWCeOr0fkRSGfW4EhadF?= =?us-ascii?Q?IgBMh1GT7JWr2mIooVPhZiXpd+KOQXoxu7L+6OO?= =?us-ascii?Q?19tI3vHh2YEMKhVGAPXLv0I7qrJnTCtqRIlZtor?= =?us-ascii?Q?yGEaXF9yHnQYxLOJN39FRqKQgw=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: u001.I8uzylDtAfgbeCOeLBYDww== Message-ID-Hash: J65C3VAVCAR5AZDEKVYOLH7TLTKCOJVG X-Message-ID-Hash: J65C3VAVCAR5AZDEKVYOLH7TLTKCOJVG X-MailFrom: bounces+313651-b711-ruby-core=ml.ruby-lang.org@em5188.ruby-lang.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list Reply-To: Ruby developers Subject: [ruby-core:119407] [Ruby master Bug#20776] [PRISM] Pattern matching syntax error message List-Id: Ruby developers Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: "kddnewton (Kevin Newton) via ruby-core" Cc: "kddnewton (Kevin Newton)" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Issue #20776 has been updated by kddnewton (Kevin Newton). What's happening with the error message is that it's seeing the `$g` and determining that it's not a valid pattern, so it assumes the pattern is missing. Then it's determining that there is no statement delimiter (newline or semicolon) between the statements, so it's saying it expected and end-of-input. Then it's finding the `$g` at the beginning of the next expression, so it's warning that it's possibly useless. Effectively it's parsing it like: ```ruby 1 => $g ``` I'm happy to change the error message to whatever would make that more clear. The second newline is in there because it looked weird having errors hang off the end without another line indicating where the input ended, but I can remove that. ---------------------------------------- Bug #20776: [PRISM] Pattern matching syntax error message https://bugs.ruby-lang.org/issues/20776#change-110022 * Author: nobu (Nobuyoshi Nakada) * Status: Open * Assignee: prism * Backport: 3.1: DONTNEED, 3.2: DONTNEED, 3.3: UNKNOWN ---------------------------------------- Syntax error is fine, but is really expecting end-of-input there? ``` $ ruby -v -e '1 => $g' ruby 3.4.0dev (2024-10-01T14:59:58Z master 169a5ee99e) +PRISM [arm64-darwin23] -e:1: warning: possibly useless use of a variable in void context -e: -e:1: syntax errors found (SyntaxError) > 1 | 1 => $g | ^~ unexpected global variable, expecting end-of-input | ^~ expected a pattern expression after `=>` 2 | ``` And the line 2 is **not** in the input. -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/