別のキーワード
種類
- インスタンスメソッド (119)
- 特異メソッド (95)
クラス
- Regexp (22)
-
RubyVM
:: InstructionSequence (192)
キーワード
-
absolute
_ path (11) -
base
_ label (11) -
compile
_ file (11) -
compile
_ option (11) - disasm (11)
- disassemble (11)
- eval (11)
-
first
_ lineno (11) - inspect (11)
- label (11)
-
load
_ from _ binary (9) -
load
_ from _ binary _ extra _ data (9) - new (22)
- of (11)
- path (11)
-
to
_ a (11) -
to
_ binary (9)
検索結果
先頭5件
- RubyVM
:: InstructionSequence . compile(source , file = nil , path = nil , line = 1 , options = nil) -> RubyVM :: InstructionSequence - Regexp
. compile(string , option = nil , code = nil) -> Regexp - RubyVM
:: InstructionSequence . compile _ option -> Hash - RubyVM
:: InstructionSequence . compile _ file(file , options = nil) -> RubyVM :: InstructionSequence - RubyVM
:: InstructionSequence . load _ from _ binary(binary) -> RubyVM :: InstructionSequence
-
RubyVM
:: InstructionSequence . compile(source , file = nil , path = nil , line = 1 , options = nil) -> RubyVM :: InstructionSequence (27921.0) -
引数 source で指定した Ruby のソースコードを元にコンパイル済みの RubyVM::InstructionSequence オブジェクトを作成して返します。
...にコンパイル済みの
RubyVM::InstructionSequence オブジェクトを作成して返します。
@param source Ruby のソースコードを文字列で指定します。
@param file ファイル名を文字列で指定します。
@param path 引数 file の絶対パスファイル名を......@param line 引数 source の 1 行目の行番号を指定します。
@param options コンパイル時のオプションを true、false、Hash オブ
ジェクトのいずれかで指定します。詳細は
RubyVM::InstructionSequence.compile_option= を参照......してください。
RubyVM::InstructionSequence.compile("a = 1 + 2")
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
@see RubyVM::InstructionSequence.compile_file... -
Regexp
. compile(string , option = nil , code = nil) -> Regexp (24627.0) -
文字列 string をコンパイルして正規表現オブジェクトを生成して返します。
...文字列 string をコンパイルして正規表現オブジェクトを生成して返します。
第一引数が正規表現であれば第一引数を複製して返します。第二、第三引数は警告の上無視されます。
@param string 正規表現を文字列として与えま......@param option Regexp::IGNORECASE, Regexp::MULTILINE,
Regexp::EXTENDED
の論理和を指定します。
Integer 以外であれば真偽値の指定として見なされ
、真(nil, false 以外)であれば
Regexp::IGNORECASE......ングは ASCII-8BIT になります。
それ以外の指定は警告を出力します。
@raise RegexpError 正規表現のコンパイルに失敗した場合発生します。
//emlist[例][ruby]{
str = "This is Regexp"
t1 = Regexp.compile("this is regexp", Regexp::IGNORECASE)
t1... -
RubyVM
:: InstructionSequence . compile _ option -> Hash (21415.0) -
命令シーケンスのコンパイル時のデフォルトの最適化オプションを Hash で返 します。
...//emlist[例][ruby]{
require "pp"
pp RubyVM::InstructionSequence.compile_option
# => {:inline_const_cache=>true,
# :peephole_optimization=>true,
# :tailcall_optimization=>false,
# :specialized_instruction=>true,
# :operands_unification=>true,
# :instructions_unification=>false,
# :stack_caching=>f......alse,
# :trace_instruction=>true,
# :frozen_string_literal=>false,
# :debug_frozen_string_literal=>false,
# :coverage_enabled=>true,
# :debug_level=>0}
//}
@see RubyVM::InstructionSequence.compile_option=... -
RubyVM
:: InstructionSequence . compile _ file(file , options = nil) -> RubyVM :: InstructionSequence (18827.0) -
引数 file で指定した Ruby のソースコードを元にコンパイル済みの RubyVM::InstructionSequence オブジェクトを作成して返します。
...file で指定した Ruby のソースコードを元にコンパイル済みの
RubyVM::InstructionSequence オブジェクトを作成して返します。
RubyVM::InstructionSequence.compile とは異なり、file、path などの
メタデータは自動的に取得します。
@param file......tions コンパイル時のオプションを true、false、Hash オブ
ジェクトのいずれかで指定します。詳細は
RubyVM::InstructionSequence.compile_option= を参照
してください。
# /tmp/hello.rb
puts "Hello, world!"
# i......rb
RubyVM::InstructionSequence.compile_file("/tmp/hello.rb")
# => <RubyVM::InstructionSequence:<main>@/tmp/hello.rb>
@see RubyVM::InstructionSequence.compile... -
RubyVM
:: InstructionSequence . load _ from _ binary(binary) -> RubyVM :: InstructionSequence (12508.0) -
RubyVM::InstructionSequence#to_binaryにより作られたバイナリフォーマットの文字列からiseqのオブジェクトをロードします。
...RubyVM::InstructionSequence#to_binaryにより作られたバイナリフォーマットの文字列からiseqのオブジェクトをロードします。
このローダーは検証機構をもっておらず、壊れたり改変されたバイナリを読み込むと深刻な問題を引き起......りません。自分が変換したバイナリデータを使うべきです。
//emlist[例][ruby]{
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
binary = iseq.to_binary
RubyVM::InstructionSequence.load_from_binary(binary).eval # => 3
//}
@see RubyVM::InstructionSequence#to_binary... -
RubyVM
:: InstructionSequence . load _ from _ binary _ extra _ data(binary) -> String (12408.0) -
バイナリフォーマットの文字列から埋め込まれたextra_dataを取り出します。
...埋め込まれたextra_dataを取り出します。
//emlist[例][ruby]{
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
binary = iseq.to_binary("extra_data")
RubyVM::InstructionSequence.load_from_binary_extra_data(binary) # => extra_data
//}
@see RubyVM::InstructionSequence#to_binary... -
RubyVM
:: InstructionSequence # to _ binary(extra _ data = nil) -> String (12314.0) -
バイナリフォーマットでシリアライズされたiseqのデータを文字列として返します。 RubyVM::InstructionSequence.load_from_binary メソッドでバイナリデータに対応するiseqオブジェクトを作れます。
...れたiseqのデータを文字列として返します。
RubyVM::InstructionSequence.load_from_binary メソッドでバイナリデータに対応するiseqオブジェクトを作れます。
引数の extra_data はバイナリデータと共に保存されます。
RubyVM::InstructionSequence.......load_from_binary_extra_data メソッドでこの文字列にアクセス出来ます。
注意: 変換後のバイナリデータはポータブルではありません。 to_binary で得たバイナリデータは他のマシンに移動できません。他のバージョンや他のアーキ......テクチャのRubyで作られたバイナリデータは使用できません。
//emlist[例][ruby]{
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
iseq.to_binary("extra_data")
# ※表示の都合上改行しているが実際は改行はない
# => "YARB\x02\x00\x00\x00\x03\x00\x00... -
RubyVM
:: InstructionSequence # inspect -> String (12308.0) -
self の情報をラベルとパスを含んだ人間に読みやすい文字列にして返します。
...んだ人間に読みやすい文字列にして返します。
//emlist[例][ruby]{
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
iseq.inspect # => "<RubyVM::InstructionSequence:<compiled>@<compiled>>"
//}
@see RubyVM::InstructionSequence#label,
RubyVM::InstructionSequence#path... -
RubyVM
:: InstructionSequence # first _ lineno -> Integer (12214.0) -
self が表す命令シーケンスの 1 行目の行番号を返します。
...の 1 行目の行番号を返します。
例1:irb で実行した場合
RubyVM::InstructionSequence.compile('num = 1 + 2').first_lineno
# => 1
例2:
# /tmp/method.rb
require "foo-library"
def foo
p :foo
end
RubyVM::InstructionSequence.of(method(:foo)).first_lineno
# => 2... -
RubyVM
:: InstructionSequence . new(source , file = nil , path = nil , line = 1 , options = nil) -> RubyVM :: InstructionSequence (9721.0) -
引数 source で指定した Ruby のソースコードを元にコンパイル済みの RubyVM::InstructionSequence オブジェクトを作成して返します。
...にコンパイル済みの
RubyVM::InstructionSequence オブジェクトを作成して返します。
@param source Ruby のソースコードを文字列で指定します。
@param file ファイル名を文字列で指定します。
@param path 引数 file の絶対パスファイル名を......@param line 引数 source の 1 行目の行番号を指定します。
@param options コンパイル時のオプションを true、false、Hash オブ
ジェクトのいずれかで指定します。詳細は
RubyVM::InstructionSequence.compile_option= を参照......してください。
RubyVM::InstructionSequence.compile("a = 1 + 2")
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
@see RubyVM::InstructionSequence.compile_file...