Examples of parseEval()


Examples of org.jruby.Ruby.parseEval()

        Frame lastFrame = context.preEvalWithBinding(binding);
        try {
            // Binding provided for scope, use it
            RubyString source = src.convertToString();
            Node node = runtime.parseEval(source.getByteList(), binding.getFile(), evalScope, binding.getLine());
            Block block = binding.getFrame().getBlock();

            if (runtime.getInstanceConfig().getCompileMode() == CompileMode.OFFIR) {
                // SSS FIXME: AST interpreter passed both a runtime (which comes from the source string)
                // and the thread-context rather than fetch one from the other.  Why is that?
View Full Code Here

Examples of org.jruby.Ruby.parseEval()

       
        DynamicScope evalScope = context.getCurrentScope().getEvalScope(runtime);
        evalScope.getStaticScope().determineModule();
       
        try {
            Node node = runtime.parseEval(source.getByteList(), file, evalScope, lineNumber);

            if (runtime.getInstanceConfig().getCompileMode() == CompileMode.OFFIR) {
                // SSS FIXME: AST interpreter passed both a runtime (which comes from the source string)
                // and the thread-context rather than fetch one from the other.  Why is that?
                return Interpreter.interpretSimpleEval(runtime, file, lineNumber, "(eval)", node, self);
View Full Code Here

Examples of org.jruby.Ruby.parseEval()

        EmbedEvalUnit result = instance.parse(script, lines);
        assertEquals(expResult, result);

        script = "";
        Ruby runtime = JavaEmbedUtils.initialize(new ArrayList());
        Node node = runtime.parseEval(script, "<script>", null, 0);
        IRubyObject expRet = runtime.runInterpreter(node);
        result = instance.parse(script);
        IRubyObject ret = result.run();
        assertEquals(expRet.toJava(String.class), ret.toJava(String.class));
        // Maybe bug. This returns RubyNil, but it should be ""
View Full Code Here

Examples of org.jruby.Ruby.parseEval()

        script = "# -*- coding: utf-8 -*-\n" +
                 "def say_something()" +
                   "\"はろ〜、わぁ〜るど!\"\n" +
                 "end\n" +
                 "say_something";
        expRet = runtime.runInterpreter(runtime.parseEval(script, "<script>", null, 0));
        ret = instance.parse(script).run();
        assertEquals(expRet.toJava(String.class), ret.toJava(String.class));

        //sharing variables
        instance.put("what", "Trick or Treat.");
View Full Code Here

Examples of org.jruby.Ruby.parseEval()

            if (sharing_variables) {
                scope = getManyVarsDynamicScope(container, 0);
            }
            Node node = null;
            if (input instanceof String) {
                node = runtime.parseEval((String)input, filename, scope, line);
            } else {
                node = runtime.parseFile((InputStream)input, filename, scope, line);
            }
            CompileMode compileMode = runtime.getInstanceConfig().getCompileMode();
            if (compileMode == CompileMode.FORCE) {
View Full Code Here

Examples of org.jruby.Ruby.parseEval()

   * @throws JumpException in case of JRuby parsing failure
   */
  public static Object createJRubyObject(String scriptSource, Class<?>[] interfaces, ClassLoader classLoader) {
    Ruby ruby = initializeRuntime();

    Node scriptRootNode = ruby.parseEval(scriptSource, "", null, 0);
        IRubyObject rubyObject = ruby.runNormally(scriptRootNode);

    if (rubyObject instanceof RubyNil) {
      String className = findClassName(scriptRootNode);
      rubyObject = ruby.evalScriptlet("\n" + className + ".new");
View Full Code Here

Examples of org.jruby.Ruby.parseEval()

   * @throws JumpException in case of JRuby parsing failure
   */
  public static Object createJRubyObject(String scriptSource, Class[] interfaces, ClassLoader classLoader) {
    Ruby ruby = initializeRuntime();

    Node scriptRootNode = ruby.parseEval(scriptSource, "", null, 0);
    // keep using the deprecated runNormally variant for JRuby 1.1/1.2 compatibility...
    IRubyObject rubyObject = ruby.runNormally(scriptRootNode, false);

    if (rubyObject instanceof RubyNil) {
      String className = findClassName(scriptRootNode);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.