Ejemplo n.º 1
0
    @Specialization
    public NilPlaceholder dumpCallStack() {
      notDesignedForCompilation();

      for (String line :
          Backtrace.DEBUG_FORMATTER.format(getContext(), null, RubyCallStack.getBacktrace(this))) {
        System.err.println(line);
      }

      return NilPlaceholder.INSTANCE;
    }
Ejemplo n.º 2
0
    @Specialization
    public Object parseTree() {
      notDesignedForCompilation();

      final org.jruby.ast.Node parseTree =
          RubyCallStack.getCurrentMethod().getSharedMethodInfo().getParseTree();

      if (parseTree == null) {
        return NilPlaceholder.INSTANCE;
      } else {
        return getContext().makeString(parseTree.toString(true, 0));
      }
    }