Eval gives a syntax error while require doesn't
-----------------------------------------------
Key: JRUBY-3734
URL: http://jira.codehaus.org/browse/JRUBY-3734
Project: JRuby
Issue Type: Bug
Components: Parser
Affects Versions: JRuby 1.3
Environment: OS X 10.5.7, Java 1.6.0_13-b03-206
Reporter: Mario Camou
Assignee: Thomas E Enebo
I am trying to isolate a test case but haven't yet been able to do so.
I am getting this exception:
Exception in thread "AWT-EventQueue-0" (eval):1:in `load': (eval):2: ,
unexpected ':'
when running this code:
eval "
form :test do
puts 'test'
end"
Putting the exact same code in a file and doing a require works fine. Using
(:test) instead of :test also works fine.
form is defined as follows:
def form(name, &proc)
klass = Class.new Form
Object.const_set name.to_s.camelize, klass
klass.create_definitions_structure
klass.instance_eval(&proc)
klass
end
I will continue to try to generate a minimal test case but so far my attempts
have been fruitless. I'm posting the bug now in case it rings a bell in
someone's head.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email