るりまサーチ

最速Rubyリファレンスマニュアル検索!
203件ヒット [1-100件を表示] (0.061秒)
トップページ > クエリ:String[x] > クエリ:compile[x]

別のキーワード

  1. string []=
  2. string slice
  3. string slice!
  4. string []
  5. string gsub!

検索結果

<< 1 2 3 > >>

Regexp.compile(string, option = nil, code = nil) -> Regexp (18243.0)

文字列 string をコンパイルして正規表現オブジェクトを生成して返します。

...文字列 string をコンパイルして正規表現オブジェクトを生成して返します。

第一引数が正規表現であれば第一引数を複製して返します。第二、第三引数は警告の上無視されます。

@param string 正規表現を文字列として与えま...
...に失敗した場合発生します。

//emlist[例][ruby]{
str = "This is Regexp"
t1 = Regexp.compile("this is regexp", Regexp::IGNORECASE)
t1.match(str)
p $~ # => "This is Regexp"

t2 = Regexp.compile('
this # ここは使用されない
\ is
\ regexp # ここも使用されない
',...
...Regexp::EXTENDED | Regexp::IGNORECASE)
t2.match(str)
p Regexp.last_match # => "This is Regexp"

str = "ふるいけや\nかわずとびこむ\nみずのおと"
t2 = Regexp.compile("ふる.*?と", Regexp::MULTILINE)
p t2.match(str)[0] # => "ふるいけや\nかわずと"
//}...

NODE * rb_compile_string(const char *f, VALUE s, int line) (12200.0)

Ruby の文字列 s を構文木にコンパイルし、ruby_eval_tree と ruby_eval_tree_begin に格納します。ruby_eval_tree を返します。 またコンパイルするときにファイル f の line 行目からをコンパイル していると仮定します。

Ruby の文字列 s を構文木にコンパイルし、ruby_eval_tree と
ruby_eval_tree_begin に格納します。ruby_eval_tree を返します。
またコンパイルするときにファイル f の line 行目からをコンパイル
していると仮定します。

RubyVM::InstructionSequence.compile_option -> Hash (6125.0)

命令シーケンスのコンパイル時のデフォルトの最適化オプションを Hash で返 します。

...equence.compile_option

# => {:inline_const_cache=>true,
# :peephole_optimization=>true,
# :tailcall_optimization=>false,
# :specialized_instruction=>true,
# :operands_unification=>true,
# :instructions_unification=>false,
# :stack_caching=>false,
# :trace_instruction=>true,
# :frozen_string_literal...
...=>false,
# :debug_frozen_string_literal=>false,
# :coverage_enabled=>true,
# :debug_level=>0}
//}

@see RubyVM::InstructionSequence.compile_option=...

Regexp.new(string, option = nil, code = nil) -> Regexp (3143.0)

文字列 string をコンパイルして正規表現オブジェクトを生成して返します。

...文字列 string をコンパイルして正規表現オブジェクトを生成して返します。

第一引数が正規表現であれば第一引数を複製して返します。第二、第三引数は警告の上無視されます。

@param string 正規表現を文字列として与えま...
...に失敗した場合発生します。

//emlist[例][ruby]{
str = "This is Regexp"
t1 = Regexp.compile("this is regexp", Regexp::IGNORECASE)
t1.match(str)
p $~ # => "This is Regexp"

t2 = Regexp.compile('
this # ここは使用されない
\ is
\ regexp # ここも使用されない
',...
...Regexp::EXTENDED | Regexp::IGNORECASE)
t2.match(str)
p Regexp.last_match # => "This is Regexp"

str = "ふるいけや\nかわずとびこむ\nみずのおと"
t2 = Regexp.compile("ふる.*?と", Regexp::MULTILINE)
p t2.match(str)[0] # => "ふるいけや\nかわずと"
//}...

1.6.8から1.8.0への変更点(まとめ) (678.0)

1.6.8から1.8.0への変更点(まとめ) * ((<1.6.8から1.8.0への変更点(まとめ)/インタプリタの変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたクラス/モジュール>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたメソッド>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加された定数>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張されたクラス/メソッド(互換性のある変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/変更されたクラス/メソッド(互換性のない変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/文法の変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/正規表現>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Marshal>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Windows 対応>)) * ((<1.6.8から1.8.0への変更点(まとめ)/廃止された(される予定の)機能>)) * ((<1.6.8から1.8.0への変更点(まとめ)/ライブラリ>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張ライブラリAPI>)) * ((<1.6.8から1.8.0への変更点(まとめ)/バグ修正>)) * ((<1.6.8から1.8.0への変更点(まとめ)/サポートプラットフォームの追加>))

...fix として 0d が追加されました。
8進リテラルの prefix として 0 以外に 0o が追加されました。

Integer(), String#to_i、String#oct もこの prefix を認識します。

: ((<メソッド引数の & 修飾|メソッド呼び出し/イテレータ>)) [compat]
: ((<...
...を抜け、n が yield の戻り値になります。

: to_str [compat]

to_str を定義したオブジェクトはより広範囲にStringとして振舞うように
なりました。

文字列を引数に取るほとんどの組み込みメソッドは、to_str による暗黙の...
...になりました。(よ
り正確には、Regexp.compile(arg) でなく
Regexp.compile(Regexp.quote(arg)) するようになりました)

((<String#~|String/~>)), ((<String#=~|String/=~>)) は、obsolete にな
りました。(String#~ はここにあげた変更が反映された上で o...

絞り込み条件を変える

ruby 1.6 feature (312.0)

ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。

...りました。

p "#{ "" }"

=> ruby 1.6.7 (2002-03-01) [i586-linux]
""

=> -:1: warning: bad substitution in string
ruby 1.6.7 (2002-09-12) [i586-linux]
"#{ }"

=> ruby 1.6.7 (2002-09-25) [i586-linux]
""

これは1.7...
...ません。1.6に入るかも不明です。-))

: 2002-07-11 String#slice!

範囲外の文字列を指定したときに例外を返す場合がありましたが、常に nil
を返すようになりました。(String#[]やString#slice と同じ結果を返すと
いうことです)...
...がありました。
((<ruby-list:34478>))

#! ruby -Ks
p a = "#{"表"}"
=> -:1: compile error in string expansion (SyntaxError)
-:1: unterminated string meets end of file
ruby 1.6.7 (2002-03-15) [i586-linux]
=> ruby 1.6.7 (2002-03-19) [i586-l...

RubyVM::InstructionSequence#absolute_path -> String | nil (119.0)

self が表す命令シーケンスの絶対パスを返します。

...例1:irb で実行した場合

iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.absolute_path
# => nil

例2: RubyVM::InstructionSequence.compile_file を使用した場合

# /tmp/method.rb
def hello
puts "hel...

RubyVM::InstructionSequence#base_label -> String (119.0)

self が表す命令シーケンスの基本ラベルを返します。

...例1:irb で実行した場合

iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.base_label
# => "<compiled>"

例2: RubyVM::InstructionSequence.compile_file を使用した場合

# /tmp/method.rb
def hello
puts...
..."hello, world"
end

# irb
> iseq = RubyVM::InstructionSequence.compile_file('/tmp/method.rb')
> iseq.base_label # => "<main>"

例3:

# /tmp/method2.rb
def hello
puts "hello, world"
end

RubyVM::InstructionSequence.of(method(:hello)).base_label
# => "hello"

@see RubyVM::Instru...

RubyVM::InstructionSequence#label -> String (119.0)

self が表す命令シーケンスのラベルを返します。通常、メソッド名、クラス名、 モジュール名などで構成されます。

...ていた場合
は "<compiled>" を返します。

例1:irb で実行した場合

iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.label
# => "<compiled>"

例2: RubyVM::InstructionSequence.compile_file を使用した...
...場合

# /tmp/method.rb
def hello
puts "hello, world"
end

# irb
> iseq = RubyVM::InstructionSequence.compile_file('/tmp/method.rb')
> iseq.label # => "<main>"

例3:

# /tmp/method2.rb
def hello
puts "hello, world"
end

RubyVM::InstructionSequence.of(method(:hello)).lab...

RubyVM::InstructionSequence#path -> String (119.0)

self が表す命令シーケンスの相対パスを返します。

...ていた
場合は "<compiled>" を返します。

例1:irb で実行した場合

iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.path
# => "<compiled>"

例2: RubyVM::InstructionSequence.compile_file を使用した...
...場合

# /tmp/method.rb
def hello
puts "hello, world"
end

# irb
> iseq = RubyVM::InstructionSequence.compile_file('method.rb')
> iseq.path # => "method.rb"

@see RubyVM::InstructionSequence#absolute_path...

絞り込み条件を変える

<< 1 2 3 > >>