るりまサーチ

最速Rubyリファレンスマニュアル検索!
17件ヒット [1-17件を表示] (0.180秒)
トップページ > クエリ:l[x] > クエリ:r[x] > クエリ:v[x] > クエリ:first_lineno[x]

別のキーワード

  1. socket ai_v4mapped
  2. socket ipv6_v6only
  3. socket ai_v4mapped_cfg
  4. _builtin grep_v
  5. etc cs_v7_env

検索結果

RubyVM::InstructionSequence#first_lineno -> Integer (36313.0)

self が表す命令シーケンスの 1 行目の行番号を返します。

...self が表す命令シーケンスの 1 行目の行番号を返します。

例1:irb で実行した場合

R
ubyVM::InstructionSequence.compile('num = 1 + 2').first_lineno
# => 1

例2:

# /tmp/method.rb
r
equire "foo-library"
def foo
p :foo
end

R
ubyVM::InstructionSequence.of(m...
...ethod(:foo)).first_lineno
# => 2...

RubyVM::AbstractSyntaxTree::Node#first_lineno -> Integer (33307.0)

ソースコード中で、self を表すテキストが最初に現れる行番号を返します。

...ソースコード中で、self を表すテキストが最初に現れる行番号を返します。

行番号は1-originです。

//emlist[][ruby]{
node = RubyVM::AbstractSyntaxTree.parse('1 + 2')
p node.first_lineno # => 1
//}...