class SyntaxTree::YARV::ToRegExp
### Summary
‘toregexp` pops a number of values off the stack, combines them into a new regular expression, and pushes the new regular expression onto the stack.
### Usage
~~~ruby /foo #{bar}/ ~~~
Attributes
Public Class Methods
Source
# File lib/syntax_tree/yarv/instructions.rb, line 5850 def initialize(options, length) @options = options @length = length end
Public Instance Methods
Source
# File lib/syntax_tree/yarv/instructions.rb, line 5867 def ==(other) other.is_a?(ToRegExp) && other.options == options && other.length == length end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 5880 def call(vm) vm.push(Regexp.new(vm.pop(length).join, options)) end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 5863 def deconstruct_keys(_keys) { options: options, length: length } end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 5855 def disasm(fmt) fmt.instruction("toregexp", [fmt.object(options), fmt.object(length)]) end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 5859 def to_a(_iseq) [:toregexp, options, length] end