Method: CodeTools::AST::BackRef#defined

Defined in:
lib/rubinius/code/ast/variables.rb

#defined(g) ⇒ Object



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/rubinius/code/ast/variables.rb', line 34

def defined(g)
  if @kind == :~
    g.push_literal "global-variable"
    g.string_dup
    return
  end

  f = g.new_label
  done = g.new_label

  g.last_match mode, 0
  g.goto_if_nil f

  g.push_literal "global-variable"
  g.string_dup

  g.goto done

  f.set!
  g.push_nil

  done.set!
end