public static Arity required(int minimum) { assert minimum >= 0; return createArity(-(1 + minimum)); }
public void addInvokerDescriptor(String rubyName, String newMethodName, int methodArity, StaticScope scope, CallConfiguration callConfig, String filename, int line) { Arity arity = Arity.createArity(methodArity); InvokerDescriptor descriptor = new InvokerDescriptor(rubyName, newMethodName, classname, arity, scope, callConfig, filename, line); invokerDescriptors.add(descriptor); }
public void addInvokerDescriptor(String rubyName, String newMethodName, int methodArity, StaticScope scope, CallConfiguration callConfig, String filename, int line) { Arity arity = Arity.createArity(methodArity); InvokerDescriptor descriptor = new InvokerDescriptor(rubyName, newMethodName, classname, arity, scope, callConfig, filename, line); invokerDescriptors.add(descriptor); }
public NativeMethod(RubyModule clazz, int arity, long function) { super(clazz, Visibility.PUBLIC, CallConfiguration.FrameBacktraceScopeFull); this.arity = Arity.createArity(arity); this.function = function; this.nativeInstance = Native.getInstance(clazz.getRuntime()); }
public NativeMethod(RubyModule clazz, int arity, long function) { super(clazz, Visibility.PUBLIC, CallConfiguration.FrameBacktraceScopeFull); this.arity = Arity.createArity(arity); this.function = function; this.nativeInstance = Native.getInstance(clazz.getRuntime()); }
public static Block createSharedScopeBlock(ThreadContext context, IRubyObject self, int arity, CompiledBlockCallback callback, boolean hasMultipleArgsHead, int argsNodeType) { return CompiledSharedScopeBlock.newCompiledSharedScopeClosure(context, self, Arity.createArity(arity), context.getCurrentScope(), callback, hasMultipleArgsHead, argsNodeType); }
public static Block createSharedScopeBlock(ThreadContext context, IRubyObject self, int arity, CompiledBlockCallback callback, boolean hasMultipleArgsHead, int argsNodeType) { return CompiledSharedScopeBlock.newCompiledSharedScopeClosure(context, self, Arity.createArity(arity), context.getCurrentScope(), callback, hasMultipleArgsHead, argsNodeType); }
public MethodBlock(RubyMethod method, StaticScope staticScope) { super(staticScope, Arity.createArity((int) method.arity().getLongValue()), BlockBody.SINGLE_RESTARG); this.method = method; String filename = method.getFilename(); if (filename == null) filename = "(method)"; this.filename = filename; this.line = method.getLine(); }
public static void populateMethod(JavaMethod javaMethod, int arity, String simpleName, boolean isStatic, boolean notImplemented) { javaMethod.setIsBuiltin(true); javaMethod.setArity(Arity.createArity(arity)); javaMethod.setJavaName(simpleName); javaMethod.setSingleton(isStatic); javaMethod.setNotImplemented(notImplemented); }
public static void populateMethod(JavaMethod javaMethod, int arity, String simpleName, boolean isStatic, boolean notImplemented) { javaMethod.setIsBuiltin(true); javaMethod.setArity(Arity.createArity(arity)); javaMethod.setJavaName(simpleName); javaMethod.setSingleton(isStatic); javaMethod.setNotImplemented(notImplemented); }
private Arity calculateArity() { StaticScope s = scope; if (s.getOptionalArgs() > 0 || s.getRestArg() >= 0) return Arity.required(s.getRequiredArgs()); return Arity.createArity(s.getRequiredArgs()); }
private Arity calculateArity() { StaticScope s = scope; if (s.getOptionalArgs() > 0 || s.getRestArg() >= 0) return Arity.required(s.getRequiredArgs()); return Arity.createArity(s.getRequiredArgs()); }
public static void populateMethod(JavaMethod javaMethod, int arity, String simpleName, boolean isStatic, boolean notImplemented, Class nativeTarget, String nativeName, Class nativeReturn, Class[] nativeArguments) { javaMethod.setIsBuiltin(true); javaMethod.setArity(Arity.createArity(arity)); javaMethod.setJavaName(simpleName); javaMethod.setSingleton(isStatic); javaMethod.setNotImplemented(notImplemented); javaMethod.setNativeCall(nativeTarget, nativeName, nativeReturn, nativeArguments, isStatic, false); }
public static void populateMethod(JavaMethod javaMethod, int arity, String simpleName, boolean isStatic, CallConfiguration callConfig, boolean notImplemented) { javaMethod.setIsBuiltin(true); javaMethod.setArity(Arity.createArity(arity)); javaMethod.setJavaName(simpleName); javaMethod.setSingleton(isStatic); javaMethod.setCallConfig(callConfig); javaMethod.setNotImplemented(notImplemented); }
public static void populateMethod(JavaMethod javaMethod, int arity, String simpleName, boolean isStatic, CallConfiguration callConfig, boolean notImplemented) { javaMethod.setIsBuiltin(true); javaMethod.setArity(Arity.createArity(arity)); javaMethod.setJavaName(simpleName); javaMethod.setSingleton(isStatic); javaMethod.setCallConfig(callConfig); javaMethod.setNotImplemented(notImplemented); }
public static void populateMethod(JavaMethod javaMethod, int arity, String simpleName, boolean isStatic, boolean notImplemented, Class nativeTarget, String nativeName, Class nativeReturn, Class[] nativeArguments) { javaMethod.setIsBuiltin(true); javaMethod.setArity(Arity.createArity(arity)); javaMethod.setJavaName(simpleName); javaMethod.setSingleton(isStatic); javaMethod.setNotImplemented(notImplemented); javaMethod.setNativeCall(nativeTarget, nativeName, nativeReturn, nativeArguments, isStatic, false); }
public static void populateMethod(JavaMethod javaMethod, int arity, String simpleName, boolean isStatic, CallConfiguration callConfig, boolean notImplemented, Class nativeTarget, String nativeName, Class nativeReturn, Class[] nativeArguments) { javaMethod.setIsBuiltin(true); javaMethod.setArity(Arity.createArity(arity)); javaMethod.setJavaName(simpleName); javaMethod.setSingleton(isStatic); javaMethod.setCallConfig(callConfig); javaMethod.setNotImplemented(notImplemented); javaMethod.setNativeCall(nativeTarget, nativeName, nativeReturn, nativeArguments, isStatic, false); }
public static void populateMethod(JavaMethod javaMethod, int arity, String simpleName, boolean isStatic, CallConfiguration callConfig, boolean notImplemented, Class nativeTarget, String nativeName, Class nativeReturn, Class[] nativeArguments) { javaMethod.setIsBuiltin(true); javaMethod.setArity(Arity.createArity(arity)); javaMethod.setJavaName(simpleName); javaMethod.setSingleton(isStatic); javaMethod.setCallConfig(callConfig); javaMethod.setNotImplemented(notImplemented); javaMethod.setNativeCall(nativeTarget, nativeName, nativeReturn, nativeArguments, isStatic, false); }
public static IRubyObject runBeginBlock(ThreadContext context, IRubyObject self, String scopeString, CompiledBlockCallback callback) { StaticScope staticScope = decodeScope(context, context.getCurrentStaticScope(), scopeString); context.preScopedBody(DynamicScope.newDynamicScope(staticScope, context.getCurrentScope())); Block block = CompiledBlock.newCompiledClosure(context, self, Arity.createArity(0), staticScope, callback, false, BlockBody.ZERO_ARGS); try { block.yield(context, null); } finally { context.postScopedBody(); } return context.runtime.getNil(); }
public static IRubyObject runBeginBlock(ThreadContext context, IRubyObject self, String scopeString, CompiledBlockCallback callback) { StaticScope staticScope = decodeScope(context, context.getCurrentStaticScope(), scopeString); context.preScopedBody(DynamicScope.newDynamicScope(staticScope, context.getCurrentScope())); Block block = CompiledBlock.newCompiledClosure(context, self, Arity.createArity(0), staticScope, callback, false, BlockBody.ZERO_ARGS); try { block.yield(context, null); } finally { context.postScopedBody(); } return context.runtime.getNil(); }