種類
- インスタンスメソッド (79)
- モジュール関数 (36)
- 特異メソッド (20)
- クラス (19)
クラス
- Object (30)
-
RubyVM
:: AbstractSyntaxTree :: Node (49)
モジュール
- Kernel (36)
-
RubyVM
:: AbstractSyntaxTree (20)
キーワード
- Node (7)
- Time (12)
- caller (36)
- children (7)
-
first
_ column (7) -
first
_ lineno (7) - inspect (7)
-
last
_ column (7) -
last
_ lineno (7) -
parse
_ file (10) - then (14)
- type (7)
-
yield
_ self (16)
検索結果
先頭5件
- RubyVM
:: AbstractSyntaxTree . parse(string) -> RubyVM :: AbstractSyntaxTree :: Node - RubyVM
:: AbstractSyntaxTree . parse(string , keep _ script _ lines: false , error _ tolerant: false , keep _ tokens: false) -> RubyVM :: AbstractSyntaxTree :: Node - RubyVM
:: AbstractSyntaxTree . parse(string) -> RubyVM :: AbstractSyntaxTree :: Node - RubyVM
:: AbstractSyntaxTree . parse _ file(pathname) -> RubyVM :: AbstractSyntaxTree :: Node - RubyVM
:: AbstractSyntaxTree . parse _ file(pathname , keep _ script _ lines: false , error _ tolerant: false , keep _ tokens: false) -> RubyVM :: AbstractSyntaxTree :: Node
-
RubyVM
:: AbstractSyntaxTree . parse(string) -> RubyVM :: AbstractSyntaxTree :: Node (18116.0) -
文字列を抽象構文木にパースし、その木の根ノードを返します。
...uby]{
pp RubyVM::AbstractSyntaxTree.parse("x = 1 + 2")
# => (SCOPE@1:0-1:9
# tbl: [:x]
# args: nil
# body:
# (LASGN@1:0-1:9 :x
# (OPCALL@1:4-1:9 (LIT@1:4-1:5 1) :+ (LIST@1:8-1:9 (LIT@1:8-1:9 2) nil))))
pp RubyVM::AbstractSyntaxTree.parse("x = 1; p(x; y=2", error_tolerant:... -
RubyVM
:: AbstractSyntaxTree . parse(string , keep _ script _ lines: false , error _ tolerant: false , keep _ tokens: false) -> RubyVM :: AbstractSyntaxTree :: Node (18116.0) -
文字列を抽象構文木にパースし、その木の根ノードを返します。
...uby]{
pp RubyVM::AbstractSyntaxTree.parse("x = 1 + 2")
# => (SCOPE@1:0-1:9
# tbl: [:x]
# args: nil
# body:
# (LASGN@1:0-1:9 :x
# (OPCALL@1:4-1:9 (LIT@1:4-1:5 1) :+ (LIST@1:8-1:9 (LIT@1:8-1:9 2) nil))))
pp RubyVM::AbstractSyntaxTree.parse("x = 1; p(x; y=2", error_tolerant:... -
RubyVM
:: AbstractSyntaxTree . parse(string) -> RubyVM :: AbstractSyntaxTree :: Node (18109.0) -
文字列を抽象構文木にパースし、その木の根ノードを返します。
...@raise SyntaxError string が Ruby のコードとして正しくない場合に発生します。
//emlist[][ruby]{
pp RubyVM::AbstractSyntaxTree.parse("x = 1 + 2")
# => (SCOPE@1:0-1:9
# tbl: [:x]
# args: nil
# body:
# (LASGN@1:0-1:9 :x
# (OPCALL@1:4-1:9 (LIT@1:4-1:5 1)... -
RubyVM
:: AbstractSyntaxTree . parse _ file(pathname) -> RubyVM :: AbstractSyntaxTree :: Node (6116.0) -
pathname のファイルを読み込み、その内容を抽象構文木にパースし、その木の根ノードを返します。
...tractSyntaxTree.parse_file(__FILE__)
# => (SCOPE@1:0-1:50
# tbl: []
# args: nil
# body:
# (FCALL@1:0-1:50 :pp
# (LIST@1:3-1:50
# (CALL@1:3-1:50
# (COLON2@1:3-1:29 (CONST@1:3-1:9 :RubyVM) :AbstractSyntaxTree)
# :parse_file (LIST@1:4... -
RubyVM
:: AbstractSyntaxTree . parse _ file(pathname , keep _ script _ lines: false , error _ tolerant: false , keep _ tokens: false) -> RubyVM :: AbstractSyntaxTree :: Node (6116.0) -
pathname のファイルを読み込み、その内容を抽象構文木にパースし、その木の根ノードを返します。
...tractSyntaxTree.parse_file(__FILE__)
# => (SCOPE@1:0-1:50
# tbl: []
# args: nil
# body:
# (FCALL@1:0-1:50 :pp
# (LIST@1:3-1:50
# (CALL@1:3-1:50
# (COLON2@1:3-1:29 (CONST@1:3-1:9 :RubyVM) :AbstractSyntaxTree)
# :parse_file (LIST@1:4... -
RubyVM
:: AbstractSyntaxTree . parse _ file(pathname) -> RubyVM :: AbstractSyntaxTree :: Node (6115.0) -
pathname のファイルを読み込み、その内容を抽象構文木にパースし、その木の根ノードを返します。
...tractSyntaxTree.parse_file(__FILE__)
# => (SCOPE@1:0-1:50
# tbl: []
# args: nil
# body:
# (FCALL@1:0-1:50 :pp
# (LIST@1:3-1:50
# (CALL@1:3-1:50
# (COLON2@1:3-1:29 (CONST@1:3-1:9 :RubyVM) :AbstractSyntaxTree)
# :parse_file (LIST@1:4... -
Kernel
. # caller(range) -> [String] | nil (26.0) -
start 段上の呼び出し元の情報を $@ の形式のバックトレース(文字列の配列)として返します。
...//emlist[例][ruby]{
def parse_caller(at)
if /^(.+?):(\d+)(?::in `(.*)')?/ =~ at
file = $1
line = $2.to_i
method = $3
[file, line, method]
end
end
def foo
p parse_caller(caller.first)
end
def bar
foo
p parse_caller(caller.first)
end
bar
p parse_caller(caller.first)
#=... -
Kernel
. # caller(start = 1) -> [String] | nil (26.0) -
start 段上の呼び出し元の情報を $@ の形式のバックトレース(文字列の配列)として返します。
...//emlist[例][ruby]{
def parse_caller(at)
if /^(.+?):(\d+)(?::in `(.*)')?/ =~ at
file = $1
line = $2.to_i
method = $3
[file, line, method]
end
end
def foo
p parse_caller(caller.first)
end
def bar
foo
p parse_caller(caller.first)
end
bar
p parse_caller(caller.first)
#=... -
Kernel
. # caller(start , length) -> [String] | nil (26.0) -
start 段上の呼び出し元の情報を $@ の形式のバックトレース(文字列の配列)として返します。
...//emlist[例][ruby]{
def parse_caller(at)
if /^(.+?):(\d+)(?::in `(.*)')?/ =~ at
file = $1
line = $2.to_i
method = $3
[file, line, method]
end
end
def foo
p parse_caller(caller.first)
end
def bar
foo
p parse_caller(caller.first)
end
bar
p parse_caller(caller.first)
#=... -
RubyVM
:: AbstractSyntaxTree :: Node (18.0) -
RubyVM::AbstractSyntaxTree.parse によって作られる抽象構文木を表すクラスです。
...RubyVM::AbstractSyntaxTree.parse によって作られる抽象構文木を表すクラスです。
このクラスは MRI の実装の詳細を表します。... -
Object
# then -> Enumerator (8.0) -
self を引数としてブロックを評価し、ブロックの結果を返します。
...ライン][ruby]{
require 'open-uri'
require 'json'
construct_url(arguments).
yield_self {|url| URI(url).read }.
yield_self {|response| JSON.parse(response) }
//}
ブロックなしで呼び出されたときは Enumerator を返します。
例えば条件によって値を捨てるのに使... -
Object
# then {|x| . . . } -> object (8.0) -
self を引数としてブロックを評価し、ブロックの結果を返します。
...ライン][ruby]{
require 'open-uri'
require 'json'
construct_url(arguments).
yield_self {|url| URI(url).read }.
yield_self {|response| JSON.parse(response) }
//}
ブロックなしで呼び出されたときは Enumerator を返します。
例えば条件によって値を捨てるのに使... -
Object
# yield _ self -> Enumerator (8.0) -
self を引数としてブロックを評価し、ブロックの結果を返します。
...ライン][ruby]{
require 'open-uri'
require 'json'
construct_url(arguments).
yield_self {|url| URI(url).read }.
yield_self {|response| JSON.parse(response) }
//}
ブロックなしで呼び出されたときは Enumerator を返します。
例えば条件によって値を捨てるのに使... -
Object
# yield _ self {|x| . . . } -> object (8.0) -
self を引数としてブロックを評価し、ブロックの結果を返します。
...ライン][ruby]{
require 'open-uri'
require 'json'
construct_url(arguments).
yield_self {|url| URI(url).read }.
yield_self {|response| JSON.parse(response) }
//}
ブロックなしで呼び出されたときは Enumerator を返します。
例えば条件によって値を捨てるのに使... -
RubyVM
:: AbstractSyntaxTree :: Node # children -> Array (8.0) -
self の子ノードを配列で返します。
...type によって異なります。
戻り値は、ほかの RubyVM::AbstractSyntaxTree::Node のインスタンスや nil を含みます。
//emlist[][ruby]{
node = RubyVM::AbstractSyntaxTree.parse('1 + 2')
p node.children
# => [[], nil, #<RubyVM::AbstractSyntaxTree::Node:OPCALL@1:0-1:5>]
//}...