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 9E9221F406 for ; Thu, 24 Aug 2023 21:39:05 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; secure) header.d=ml.ruby-lang.org header.i=@ml.ruby-lang.org header.a=rsa-sha256 header.s=mail header.b=YuE6PIH8; 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=gN9eRQgf; dkim-atps=neutral Received: from nue.mailmanlists.eu (localhost [127.0.0.1]) by nue.mailmanlists.eu (Postfix) with ESMTP id 7FB3A7FC57; Thu, 24 Aug 2023 21:38:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1692913125; bh=10iTx2d3bip0cpbpdWQqBYlV8kE3GXU8h5PryEXHc0o=; 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=YuE6PIH8FAkrU7M94OKpWmqBW+ko0I2y4dFmJ6lY6DzLEPg4WIpqAOiVkBodn4N5Q v3X/XouJLm3fZgarCO4qClcl0AmwGnnA55MpZLFKIQZPFPhWYL5bI7xeQOcy44EAl/ bchAWGICM6gkDL0r9GL3ZojFFRBOQvZ1USqoIoMk= Received: from xtrwkhkc.outbound-mail.sendgrid.net (xtrwkhkc.outbound-mail.sendgrid.net [167.89.16.28]) by nue.mailmanlists.eu (Postfix) with ESMTPS id BE6707FC37 for ; Thu, 24 Aug 2023 21:38:40 +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=gN9eRQgf; dkim-atps=neutral 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=uG4nanbg0vMIbPlMsQIAxPE2LEYfzzmgxfJ3SC8PG30=; b=gN9eRQgfu8hlAx+yqFdTwgtQhPNOe9PHf/8UQbEuW/kipBLVp3Z+R1c0H9invoNzrie8 85mLQK+3Bism0m2hpiMyuPGQ55obftESCtfwGMlYc8/ZQhOg4jGxqfNNfURSgls9L2aTeI cwyxAqF0iwiMssORbjdRqEJU3vO9LQnaN0ID6BALLFPSUoyd/9uKPUo0/2kyOpkHeeClfh OMS8Sx5OwLGh6GYPjgZ1Q5tlCh+sz7gZTwi9T/VXo8kQKQVkZMPchZEIUnC8FOBcWVJQM5 it3RydRtzim5pjWzMz34dBzfcLi3ZDMGARSljfuzgOjKRe1PQiGcYS0B6n3wWBcg== Received: by filterdrecv-84b96456cb-hrvlt with SMTP id filterdrecv-84b96456cb-hrvlt-1-64E7CDDE-3E 2023-08-24 21:38:39.046130502 +0000 UTC m=+9151204.042230554 Received: from herokuapp.com (unknown) by geopod-ismtpd-13 (SG) with ESMTP id FoD1xiXpRpOzQrkBq_K1Ww for ; Thu, 24 Aug 2023 21:38:38.898 +0000 (UTC) Date: Thu, 24 Aug 2023 21:38:39 +0000 (UTC) Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Bug X-Redmine-Issue-Id: 17925 X-Redmine-Issue-Author: koic X-Redmine-Sender: jeremyevans0 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: 91016 X-SG-EID: =?us-ascii?Q?zy3UxWTRryXcrjCh7SV39ZkShJ1PHkEOmoUEekBgd8G8RAJk=2FsUOlbLwuWEoNU?= =?us-ascii?Q?BxG3BBFmcsr21OPpQwa7zNRSwswJm1szgMd841w?= =?us-ascii?Q?HPqc4OeYibNI0ucVMnF1P9+JP+mZRf1VPPsaBaM?= =?us-ascii?Q?Euu7+9fCViZ+uQ2=2FIetIIbS94EDaxCJQ7yCsOET?= =?us-ascii?Q?7oZ0fy0cTHtKHXvTFBUTwk9b6QDzshNw26LdW0Y?= =?us-ascii?Q?Di2NrSAYnYnJMq6XYpvk01V89KeAnCg0uwcPBTH?= =?us-ascii?Q?H8ypmXBLj0umLwWGquyUQ=3D=3D?= To: ruby-dev@ml.ruby-lang.org X-Entity-ID: b/2+PoftWZ6GuOu3b0IycA== Message-ID-Hash: AKKT3H3HEE4F27CYFIMJYTN7V35UNGGZ X-Message-ID-Hash: AKKT3H3HEE4F27CYFIMJYTN7V35UNGGZ X-MailFrom: bounces+313651-12dc-ruby-dev=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.3 Precedence: list Reply-To: "Ruby developers (Japanese)" Subject: =?utf-8?q?=5Bruby-dev=3A52040=5D_?= [Ruby master Bug#17925] Pattern matching syntax using semicolon one-line List-Id: "Ruby developers (Japanese)" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: "jeremyevans0 (Jeremy Evans) via ruby-dev" Cc: "jeremyevans0 (Jeremy Evans)" Issue #17925 has been updated by jeremyevans0 (Jeremy Evans).=0D =0D =0D @kddnewton Is this possible to fix in YARP?=0D =0D @yui-knk Is this possible to fix in parse.y/lrama?=0D =0D ----------------------------------------=0D Bug #17925: Pattern matching syntax using semicolon one-line=0D https://bugs.ruby-lang.org/issues/17925#change-104311=0D =0D * Author: koic (Koichi ITO)=0D * Status: Open=0D * Priority: Normal=0D * ruby -v: ruby 3.1.0dev (2021-05-28T16:34:27Z master e56ba6231f) [x86_64-d= arwin19]=0D * Backport: 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN=0D ----------------------------------------=0D ## Summary=0D =0D There are the following differences between `case ... when` and` case ... i= n`. Is this an expected behavior?=0D =0D ```console=0D % ruby -v=0D ruby 3.1.0dev (2021-05-28T16:34:27Z master e56ba6231f) [x86_64-darwin19]=0D =0D % ruby -ce 'case expression when 42; end'=0D Syntax OK=0D =0D % ruby -ce 'case expression in 42; end'=0D -e:1: warning: One-line pattern matching is experimental, and the behavior = may change in future versions of Ruby!=0D -e:1: syntax error, unexpected `end', expecting `when'=0D case expression in 42; end=0D ```=0D =0D So, I have two concerns.=0D =0D - Since the pattern matching syntax is different from `case ... when`,=E3= =80=80can't user write semicolon one-line `case ... in` in the same semicol= on one-line as `case ... when`?=0D - Does `case expression in 42; end` display an experimental warning of one-= line pattern matching. Right?=0D =0D This is reproduced in Ruby 3.1.0-dev and Ruby 3.0.1.=0D =0D ## Additional Information=0D =0D NOTE 1: I understand that only syntax that doesn't use `case` and `end` is = experimental one-line pattern matching syntax.=0D =0D ```=0D % ruby -ce 'expression in 42'=0D -e:1: warning: One-line pattern matching is experimental, and the behavior = may change in future versions of Ruby!=0D Syntax OK=0D ```=0D =0D NOTE 2: The syntax is OK if a semicolon is used between `expression` and `i= n`. But `case ... when` is a valid syntax to omit.=0D =0D ```=0D % ruby -e ruby -ce 'case expression; in 42; end'=0D Syntax OK=0D ```=0D =0D =0D =0D --=20=0D https://bugs.ruby-lang.org/=0D