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=0.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_BL_SPAMCOP_NET,SPF_HELO_PASS, SPF_PASS autolearn=no 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)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 1C9971F4CC for ; Thu, 12 Dec 2024 10:58:01 +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=iCtuyIMj; 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=ont4Ji2Y; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1734001079; bh=u/G00xzOI2cP89S/OGch5bXGzAwAWojp/tCG70muyeo=; 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=iCtuyIMjs72FIw+8moQkAdasCfCSTJq+hMbjnrteoo2fQX3DbgUIv7AJpzK7zr2sf LhlhxaO8u/yQeUgwmhun1p8J6FG60Qx4/mzUfUL7yZ7zZYsc4U9iDKXsImduWulfCl lv2Jncc1cMptAH9hPnuvWgLa5n3ViMyCVgZYBIik= Received: from nue.mailmanlists.eu (localhost [IPv6:::1]) by nue.mailmanlists.eu (Postfix) with ESMTP id 953DD46017 for ; Thu, 12 Dec 2024 10:57:59 +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=ont4Ji2Y; dkim-atps=neutral Received: from s.wrqvwxzv.outbound-mail.sendgrid.net (s.wrqvwxzv.outbound-mail.sendgrid.net [149.72.154.232]) by nue.mailmanlists.eu (Postfix) with ESMTPS id 5B2DB45F44 for ; Thu, 12 Dec 2024 10:56:02 +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=72LhXsXJhaY0vrCsbEWTFjSptDSTu7naQQikb6m2UtI=; b=ont4Ji2Y1w84nhoEk68165MEfxIGmYrU3WGPml29f1OH1W7k/e2psAb+q7Muef043YeV Knq3b2BXk9XWQI/S1/+XHqY9HCARqiPpYI7mIf4FJLgQAJmp1pivFSmRKW/XBK0RmCYx+O 2JJo+QSVOx/ZPgUlDAgFb2WJovk3l6/d/5f1zQHcvemiXsVslbJmX/bzxSBAA4quS/E+g3 RDph5vi77aXnj7mK+T0W1nq2mj7eaiMGWSsZj8Jo9ackczeTT9EKJTJbh4OITPUf29gBFZ gDMVWX5ldH/V5+0kBoNQ4N2zhWReO/WbmP/AEjwbwI/9lw5qoh/AK9sRiWtgl1ow== Received: by recvd-5f9ffdf494-tt7kt with SMTP id recvd-5f9ffdf494-tt7kt-1-675AC140-6 2024-12-12 10:56:00.488896976 +0000 UTC m=+2381960.544237995 Received: from herokuapp.com (unknown) by geopod-ismtpd-25 (SG) with ESMTP id xLG--5OfTAyemGasXenLsg for ; Thu, 12 Dec 2024 10:56:00.450 +0000 (UTC) Date: Thu, 12 Dec 2024 10:56:00 +0000 (UTC) Message-ID: References: Mime-Version: 1.0 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Bug X-Redmine-Issue-Id: 20918 X-Redmine-Issue-Author: mame X-Redmine-Issue-Assignee: Group (prism) X-Redmine-Issue-Priority: Normal X-Redmine-Sender: mame 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: 96887 X-SG-EID: =?us-ascii?Q?u001=2Ep+ckLDtT+4Y5c+H0YCkEnsuWiCQmn3OZA=2F9FzjoR6ZZlPaMv54M7EFoSM?= =?us-ascii?Q?CX5Trc79ep2R5F+0oYS4n23jq1cv223YtOotL2t?= =?us-ascii?Q?6gDq81AtbRX1SUQf2Q64PDWCmiquIPZiI7STA1P?= =?us-ascii?Q?7R1zDjifzYdENEnD3DsxJ=2FsiELAmmHxV7aEEUjN?= =?us-ascii?Q?JSBSwnOqLceANQ2KHb6q6qSd4PuhYzUdLRvU=2Fg6?= =?us-ascii?Q?JrZ=2FNVa76ajILL6xZA4RtYYtzXR+xGOL5RBoD8A?= =?us-ascii?Q?VYKZ?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: u001.I8uzylDtAfgbeCOeLBYDww== Message-ID-Hash: 3BBO72HTV2N2FBPLO4MNPBUQOSW64E3I X-Message-ID-Hash: 3BBO72HTV2N2FBPLO4MNPBUQOSW64E3I 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:120210] [Ruby master Bug#20918] Prism error indicates line number of `-e` that does not exist List-Id: Ruby developers Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: "mame (Yusuke Endoh) via ruby-core" Cc: "mame (Yusuke Endoh)" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Issue #20918 has been updated by mame (Yusuke Endoh). Status changed from Closed to Assigned @tenderlovemaking Thank you for fixing the issue, but it still shows line 2 in the code snippet. ``` $ ruby -e "foo(" -e: -e:1: syntax error found (SyntaxError) > 1 | foo( | ^ unexpected end-of-input; expected a `)` to close the arguments 2 | ``` I don't think ` 2 |` should be printed. kddnewton (Kevin Newton) wrote in #note-3: > I looked into this this morning, it looks like ruby.c is automatically concatenating a \n onto the -e script here: https://github.com/ruby/ruby/blob/f43585b02c3634ab9a4e54049b08e04ab1a640fd/ruby.c#L1303. Is this desired behavior? According to @nobu, the new line is intentionally added to separate expressions for multiple `-e` options. ``` $ ruby -e 'p 1' -e 'p 2' 1 2 $ ruby -e 'p 1 +' -e '2' 3 ``` However, I don't think it should be printed in an error message and snippet. ---------------------------------------- Bug #20918: Prism error indicates line number of `-e` that does not exist https://bugs.ruby-lang.org/issues/20918#change-110973 * Author: mame (Yusuke Endoh) * Status: Assigned * Assignee: prism * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- ``` $ ruby -e 'foo(' -e: -e:2: syntax error found (SyntaxError) 1 | foo( > 2 | | ^ unexpected end-of-input; expected a `)` to close the arguments ``` It says `-e:2`, but there is no line 2 in `-e 'foo('`. `eval("foo(")` reports line 1, so I guess this issue is only for `-e`. -- 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/