From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-3.0 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_MED,SPF_PASS,T_DKIM_INVALID, T_RP_MATCHES_RCVD shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id 5D08C20D09 for ; Sat, 3 Jun 2017 06:43:56 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 9F32012076B; Sat, 3 Jun 2017 15:43:53 +0900 (JST) Received: from o1678916x28.outbound-mail.sendgrid.net (o1678916x28.outbound-mail.sendgrid.net [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id 3366C12075C for ; Sat, 3 Jun 2017 15:43:51 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=sendgrid.me; h=from:to:references:subject:mime-version:content-type:content-transfer-encoding:list-id; s=smtpapi; bh=/qarskTy9qrLxNzkR0GUy/CJby0=; b=bu3IisjkkAi71Zb0ZL DLnbMFp6oCkOmNKLgZYwHq3EfHFzKdCOdflOX/9qcuod3srQEXCmhzfoyagZOyEh UPAUHsdBbcLenyS8faTWhFv+60cKQLpd4STAonaRKq9gqVClGzSZwAAKvB6+8ALT 6nGYXdXGqTLGUVt1ve1MRdJ4Y= Received: by filter0796p1mdw1.sendgrid.net with SMTP id filter0796p1mdw1-32001-59325AA4-6 2017-06-03 06:43:48.270215599 +0000 UTC Received: from herokuapp.com (ec2-54-81-166-105.compute-1.amazonaws.com [54.81.166.105]) by ismtpd0004p1iad1.sendgrid.net (SG) with ESMTP id _QAbMcagRDu8zQzZlzle3Q Sat, 03 Jun 2017 06:43:48.214 +0000 (UTC) Date: Sat, 03 Jun 2017 06:43:48 +0000 From: adriaan1@gmail.com To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 56584 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 13623 X-Redmine-Issue-Author: caschip X-Redmine-Sender: caschip 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-SG-EID: ync6xU2WACa70kv/Ymy4QrNMhiuLXJG8OTL2vJD1yS68cHBYejynoFU0WDz9uGgJ3Xfs4qbHLEKsWI TgRTICdxQrPnj/HogBt1ab6nqwWIS+vORThu6FAy9JwcEs27mia6o9KnAL5qXVx2O2SDvk3LsPTcv0 Sh4VN4+hnAV/nkuxOJmJTBueMRa26GKWfOHeZWEmKBFRvSErBOk/F+LpOg== X-ML-Name: ruby-core X-Mail-Count: 81554 Subject: [ruby-core:81554] [Ruby trunk Bug#13623] meta-programming, adding sub-module fails with syntax error X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #13623 has been updated by caschip (Aad Schippers). So you are saying this is how it should work and not a bug? If that is true, I should close this. What do you mean when you say that Object::const_get('Foo')::Bar is syntactically a constant. Its contains characters that are not appropriate in constant names, like brackets and single quotes, and a method is called, const_get, to evaluate it. To me it is an expression a::b::c with two scope operators, two constants (Object and Bar) and one method call that returns a constant const_get('Foo') => Foo. ---------------------------------------- Bug #13623: meta-programming, adding sub-module fails with syntax error https://bugs.ruby-lang.org/issues/13623#change-65257 * Author: caschip (Aad Schippers) * Status: Open * Priority: Normal * Assignee: * Target version: * ruby -v: ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-linux] * Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN ---------------------------------------- The goal is to add a sub-module to a higher level module. The higher level module is derived from its name in a string. This works in one case and gives an unexpected syntax error in another case. failing_meta:4: syntax error, unexpected '\n', expecting &. or :: or '[' or '.' failing_meta:8: syntax error, unexpected keyword_end, expecting end-of-input ---Files-------------------------------- no_meta (72 Bytes) working_meta (82 Bytes) failing_meta (95 Bytes) -- https://bugs.ruby-lang.org/