ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: adriaan1@gmail.com
To: ruby-core@ruby-lang.org
Subject: [ruby-core:81529] [Ruby trunk Bug#13623] meta-programming, adding sub-module fails with syntax error
Date: Fri, 02 Jun 2017 14:43:59 +0000	[thread overview]
Message-ID: <redmine.journal-65234.20170602144359.f698134224d1f407@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-13623.20170602143700@ruby-lang.org

Issue #13623 has been updated by caschip (Aad Schippers).


module Foo
end

# Failing with syntax error is the code below

module Object::const_get( 'Foo' )

	module Bar
	end
end


----------------------------------------
Bug #13623: meta-programming, adding sub-module fails with syntax error
https://bugs.ruby-lang.org/issues/13623#change-65234

* 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/

  parent reply	other threads:[~2017-06-02 14:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <redmine.issue-13623.20170602143700@ruby-lang.org>
2017-06-02 14:37 ` [ruby-core:81528] [Ruby trunk Bug#13623] meta-programming, adding sub-module fails with syntax error adriaan1
2017-06-02 14:43 ` adriaan1 [this message]
2017-06-02 15:25 ` [ruby-core:81532] " shyouhei
2017-06-03  6:43 ` [ruby-core:81554] " adriaan1
2017-06-03  7:25 ` [ruby-core:81555] [Ruby trunk Bug#13623][Rejected] " nobu
2017-06-05 10:02 ` [ruby-core:81579] [Ruby trunk Bug#13623] " adriaan1
2017-06-05 10:24 ` [ruby-core:81580] " nobu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.ruby-lang.org/en/community/mailing-lists/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=redmine.journal-65234.20170602144359.f698134224d1f407@ruby-lang.org \
    --to=ruby-core@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).