pass the file name to the exception factory method
make sure Psych::Syntax error is required, and raise that exception in the case of parse errors
Emitter#initialize takes optional formatting options

Manipulating the options after the emitter object is constructed will
have no impact on the emitter. If the emitter is constructed with the
options, we actually see change in the output (and fix tests).
set the exception message on allocated exceptions.

fixes test/psych/visitors/test_to_ruby.rb -n test_exception
use the path from the IO if no path is provided.

fixes test/psych/test_parser.rb -n test_syntax_error_has_path_for_io
Merge pull request #267 from tenderlove/psych

Various fixes for psych
Fix #266.

We weren't using the "real class", which has the ivar list.
Merge remote-tracking branch 'github/master'
Fix JRUBY-6851: IO#set_encoding doesn't work with Encoding object

We were setting internal, not external, for a single enc passed.
Fix JRUBY-6849

pp Object.new shows 0x0000000 instead of a unique number for each object.

MRI logic appears to want to simply reproduce their "hashy"
inspect value, but this doesn't work in JRuby due to the lack of
the "p" format for Array#unpack. Modified to use a JRuby ext to
get the identityHashCode of the object. It is not unique, but
neither is our inspect output.
* JRUBY-6852 Do not set compile mode to off on ScriptingContainer startup
Fix JRUBY-6810

YAML.load(YAML.dump(lambda{})) should raise TypeError

Proc should not define an allocator (#allocate should raise).
Fix JRUBY-6836

Strange interactions between a break statement and ensure blocks

The current compiler does an "inspection" pass over the AST to
see whether certain optimizations are possible. For the most part,
this inspection just sets a few bits on the inspector that are
used to alter compilation, but there are a few cases like non-
local flow control (e.g. a while loop with a break inside a
closure or rescue/ensure) where we actually alter the AST to
indicate there's something special. The presence of certain AST
nodes disables all optimizations, largely because those nodes are
difficult or impossible to support properly without JVM gymnastics
that make our usual set of optimizations impossible. ensure is one
such case, and the inspector disables all optimizations when an
ensure is encountered. However, it should still run the inspection
of all child nodes, since as mentioned above there are state
changes on the AST itself that still need to happen in order for
those nodes to compile properly.

I audited all places in ASTInspector where we do a hard disable()
call and made sure those locations still proceed to inspect the
downstream AST nodes, which fixes this bug and should prevent
other cases from popping up.
Fix JRUBY-6832

self is wrong in set_trace_func when raising NoMethodErrors

The default method_missing implementations still were being
framed, since they used to need that to get the name of the method
being called. However, at some point they just started to use the
name being passed through the call chain, which meant the frame
was unnecessary. The bug was caused by the fact that the binding's
self also comes from the frame, which in method_missing would be
the object against which the missing method was being called. That
caused both "self" and "s" in the bug report to point at the
String in question, since "self" came from m_m's frame and "s"
came from the caller's scopes (m_m did not get its own scope).
Removing the framing from m_m fixed the issue and did not
introduce others (since that frame was not actually being used
anymore).
Add variants of RubyObject#callInit() that take a ThreadContext
Add RubyClass#getBaseCallSite(int idx) that returns a single callsite instead of the entire array
Convert callInit() to use the init callsite, and update some usages of callInit to use the variant which takes a ThreadContext
Fix JRUBY-6845 - syslog(3) should be attached as a variadic function
Add symlink from ruby to jruby for JRUBY-6847.
Fix JRUBY-6106

JRuby 1.9 coverage library reports different results than ruby 1.9

I have a basic understanding now of how MRI handles 'coverage'.

Coverage support is turned on by loading the 'coverage' extension.
This sets a global "rb_coverages" to non-nil, as a Hash.

At parse time, files parsed are added to the coverages hash as
having 'nil' for all lines. Files parsed before the 'coverage' ext
is loaded are not added to this hash. This is the first behavioral
difference in JRuby, since we're just adding lines to coverage for
any file+line encountered, regardless of whether the file was
loaded before or after 'coverage' ext loaded. See parse.y,
"coverage" function, called from yycompile0 to set up the array
for that file.

At compile time (after parse) code lines get reset to zeros
whenever that line would potentially trigger a "line" event in
trace hooks. This is in compile.c in the ADD_TRACE macro.
Essentially, compile.c adds the tracing logic as it goes only to
the lines that should trigger a line event, and at the same time
zeros out that line in the coverages array.

The determination of a "code line" happens in compile.c in the
iseq_compile_each function, right at the top, where it determines
the line is a newline.

    if (node->flags & NODE_FL_NEWLINE) {
	ADD_TRACE(ret, nd_line(node), RUBY_EVENT_LINE);
    }

So for every actual NEWLINE node in the AST, the according line in
the coverages array is reset to zero.

Assuming our set of newline nodes matches MRI's (questionable), it
should basically mean we just need to do the same zeroing of the
according line when we construct a NewlineNode in our parser.

The changes I made:

* In ParserSupport.newline_node, call
ParserConfiguration.coverLine with the appropriate line number

* In ParserConfiguration.coverLine, maintain a growing Integer[]
as lines are encountered. Zero the line being covered.

* In Parser, at the end of parse associate the filename with that
Integer[] only if coverage is enabled.

* In CoverageData's LINE event hook, only update lines for files
that already have an associated Integer[].

This should basically mimic MRI's behavior, modulo any newline
nodes we're missing (which is an open question).

There are a few places outside newline_node where we create
newlines. I did not add coverage calls there, because I'm unsure
if they're intended to be visitable lines or if they're outside of
normal executable code.