Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Truffle] Handle END keyword #4254

Closed
bjfish opened this issue Oct 27, 2016 · 4 comments
Closed

[Truffle] Handle END keyword #4254

bjfish opened this issue Oct 27, 2016 · 4 comments
Assignees
Milestone

Comments

@bjfish
Copy link
Contributor

bjfish commented Oct 27, 2016

Example (example.rb file)

puts "1"
END { puts "3" }
puts "2"

Expected Behavior

1
2
3

Actual Behavior

1
3
2

Found in mkmf: https://github.com/jruby/jruby/blob/master/lib/ruby/stdlib/mkmf.rb#L2721

There appear to be some more tests for this in jt test mri ruby/test_beginendblock.rb

This should also work when requiring, e.g.:
one.rb:

puts "1"
require "two"
puts "2"

two.rb:

END { puts "3" }

Should result in:

1
2
3
@bjfish bjfish added the truffle label Oct 27, 2016
@bjfish bjfish changed the title [Truffle] Handle END [Truffle] Handle END keyword Oct 27, 2016
@bjfish
Copy link
Contributor Author

bjfish commented Oct 27, 2016

The begin keyword also appears to have an issue:

puts "2"
BEGIN { puts "1" }
puts "3"

Expected

1
2
3

Actual

2
3

@chrisseaton
Copy link
Contributor

chrisseaton commented Oct 30, 2016

I can't reproduce the BEGIN case - can you verify? I get

1
2
3

@bjfish
Copy link
Contributor Author

bjfish commented Oct 30, 2016

@chrisseaton the BEGIN case looks good to me now

@chrisseaton
Copy link
Contributor

Fixed by 1c18c37. Also see #4257.

@chrisseaton chrisseaton self-assigned this Oct 30, 2016
@enebo enebo modified the milestone: truffle-dev Nov 9, 2016
@enebo enebo added this to the Non-Release milestone Dec 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants