Sha256: 91bde13313fee4c99a8e23775f9a88cfe521a8e1b02c99ef05efc7a24c2bb971

Contents?: true

Size: 831 Bytes

Versions: 8

Compression:

Stored size: 831 Bytes

Contents

require: "compiler"

def Fancy eval: code binding: bnd (nil) file: file ("(fancy-eval)") line: line (1) {
  bnd if_nil: {
    bnd = Binding setup(Rubinius VariableScope of_sender(),
                        Rubinius CompiledMethod of_sender(),
                        Rubinius StaticScope of_sender())
  }

  # The compiled method
  cm = Fancy Compiler compile_code: code vars: (bnd variables()) file: file line: line
  cm scope=(bnd static_scope() dup())
  cm name=('__fancy_eval__)

  script = Rubinius CompiledMethod Script new(cm, file, true)
  script eval_binding=(bnd)
  script eval_source=(code)

  cm scope() script=(script)

  be = Rubinius BlockEnvironment new()
  be under_context(bnd variables(), cm)

  if: (bnd from_proc?()) then: {
    be proc_environment=(bnd proc_environment)
  }

  be from_eval!()

  be call()
}

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
fancy-0.7.0 lib/eval.fy
fancy-0.6.0 lib/eval.fy
fancy-0.5.0 lib/eval.fy
fancy-0.4.0 lib/eval.fy
fancy-0.3.3 lib/eval.fy
fancy-0.3.2 lib/eval.fy
fancy-0.3.1 lib/eval.fy
fancy-0.3.0 lib/eval.fy