class CodeTools::AST::RegexLiteral

Attributes

options[RW]
source[RW]

Public Class Methods

new(line, str, flags) click to toggle source
# File lib/rubinius/code/ast/literals.rb, line 386
def initialize(line, str, flags)
  @line = line
  @source = str
  @options = flags
end

Public Instance Methods

bytecode(g) click to toggle source
# File lib/rubinius/code/ast/literals.rb, line 392
def bytecode(g)
  pos(g)

  build = g.new_label
  done = g.new_label

  g.push_tagged_nil 0

  build.set!
  g.push_memo nil
  g.dup
  g.goto_if_not_nil done

  g.pop
  g.push_cpath_top
  g.find_const :Regexp
  g.push_literal @source
  g.push_int @options
  g.send :new, 2
  g.goto build

  done.set!
end
defined(g) click to toggle source
# File lib/rubinius/code/ast/literals.rb, line 416
def defined(g)
  g.push_literal "expression"
end
to_sexp() click to toggle source
# File lib/rubinius/code/ast/literals.rb, line 420
def to_sexp
  [:regex, @source, @options]
end