ライブラリ
- coverage (8)
- e2mmap (6)
- pp (48)
- prettyprint (24)
- prime (48)
-
ripper
/ sexp (24)
モジュール
キーワード
- each (24)
-
each
_ prime (24) -
extend
_ object (6) - format (12)
- sexp (12)
-
sexp
_ raw (12) -
sharing
_ detection (12) -
sharing
_ detection= (12) -
singleline
_ format (12) -
singleline
_ pp (12) - start (8)
検索結果
先頭5件
-
PP
. pp(obj , out = $ > , width = 79) -> object (35221.0) -
指定されたオブジェクト obj を出力先 out に幅 width で出力します。 出力先 out を返します。
...< メソッドが定義されている必要があります。
@param width 出力先の幅を指定します。
//emlist[][ruby]{
require 'pp'
str = PP.pp(b], [:a, [[:a, [:a, [:a, :b], [:a, :b],]]], '', 20)
puts str
# =>
# [[:a, :b],
# [:a,
# [[:a,
# [:a, [:a, :b]]],
# [:a, :b]]]]
//}... -
PP
. singleline _ pp(obj , out= $ >) -> object (23203.0) -
指定されたオブジェクト obj を出力先 out に出力します。 ただし、インデントも改行もしません。 出力先 out を返します。
指定されたオブジェクト obj を出力先 out に出力します。
ただし、インデントも改行もしません。
出力先 out を返します。
@param obj 表示したいオブジェクトを指定します。
@param out 出力先を指定します。<< メソッドが定義されている必要があります。 -
PP
. sharing _ detection -> bool (17073.0) -
共有検出フラグを表すアクセサです。 デフォルトは false です。true である場合、 PP.pp は一度出力したオブジェクトを再び出力する時 Object#pretty_print_cycle を使います。
...true である場合、
PP.pp は一度出力したオブジェクトを再び出力する時
Object#pretty_print_cycle を使います。
@param boolean 共有検出フラグを true か false で指定します。
//emlist[][ruby]{
require 'pp'
b = [1, 2, 3]
a = [b, b]
pp a......#=> [[1, 2, 3], [1, 2, 3]]
PP.sharing_detection = true
pp a #=> [[1, 2, 3], [...]]
//}... -
PP
. sharing _ detection=(boolean) (17073.0) -
共有検出フラグを表すアクセサです。 デフォルトは false です。true である場合、 PP.pp は一度出力したオブジェクトを再び出力する時 Object#pretty_print_cycle を使います。
...true である場合、
PP.pp は一度出力したオブジェクトを再び出力する時
Object#pretty_print_cycle を使います。
@param boolean 共有検出フラグを true か false で指定します。
//emlist[][ruby]{
require 'pp'
b = [1, 2, 3]
a = [b, b]
pp a......#=> [[1, 2, 3], [1, 2, 3]]
PP.sharing_detection = true
pp a #=> [[1, 2, 3], [...]]
//}... -
PP
. sharing _ detection -> bool (17067.0) -
共有検出フラグを表すアクセサです。 デフォルトは false です。true である場合、 PP.pp は一度出力したオブジェクトを再び出力する時 Object#pretty_print_cycle を使います。
...
PP.pp は一度出力したオブジェクトを再び出力する時
Object#pretty_print_cycle を使います。
@param boolean 共有検出フラグを true か false で指定します。
//emlist[][ruby]{
b = [1, 2, 3]
a = [b, b]
pp a #=> [[1, 2, 3], [1, 2, 3]]
PP.sh......aring_detection = true
pp a #=> [[1, 2, 3], [...]]
//}... -
PP
. sharing _ detection=(boolean) (17067.0) -
共有検出フラグを表すアクセサです。 デフォルトは false です。true である場合、 PP.pp は一度出力したオブジェクトを再び出力する時 Object#pretty_print_cycle を使います。
...
PP.pp は一度出力したオブジェクトを再び出力する時
Object#pretty_print_cycle を使います。
@param boolean 共有検出フラグを true か false で指定します。
//emlist[][ruby]{
b = [1, 2, 3]
a = [b, b]
pp a #=> [[1, 2, 3], [1, 2, 3]]
PP.sh......aring_detection = true
pp a #=> [[1, 2, 3], [...]]
//}... -
Exception2MessageMapper
. extend _ object(cl) -> () (9102.0) -
@todo
@todo
@param cl -
Ripper
. sexp(src , filename = & # 39;-& # 39; , lineno = 1) -> object (3114.0) -
Ruby プログラム str を解析して S 式のツリーにして返します。
...結果は、括弧の代わりに配列の要素として S 式のツリーを表現しています。
//emlist[例][ruby]{
require 'ripper'
require 'pp'
pp Ripper.sexp("def m(a) nil end")
# => [:program,
# [[:def,
# [:@ident, "m", [1, 4]],
# [:paren, [:params, [[:@ident, "a", [1,......形式になります。
[:@イベント名, トークン, 位置情報(行、桁の配列)]
例:
[:@ident, "m", [1, 4]]
また、Ripper.sexp は Ripper.sexp_raw とは異なり、読みやすさのため
に stmts_add や stmts_new のような _add、_new で終わるパーサイベント......を
省略します。_add で終わるパーサイベントはハンドラの引数が 0 個のものが
省略されます。詳しくは Ripper::PARSER_EVENTS を確認してください。
@see Ripper.sexp_raw... -
Ripper
. sexp _ raw(src , filename = & # 39;-& # 39; , lineno = 1) -> object (3114.0) -
Ruby プログラム str を解析して S 式のツリーにして返します。
...結果は、括弧の代わりに配列の要素として S 式のツリーを表現しています。
//emlist[例][ruby]{
require 'ripper'
require 'pp'
pp Ripper.sexp_raw("def m(a) nil end")
# => [:program,
# [:stmts_add,
# [:stmts_new],
# [:def,
# [:@ident, "m", [1, 4]],
#......n, [:params, [[:@ident, "a", [1, 6]]], nil, nil, nil]],
# [:bodystmt,
# [:stmts_add, [:stmts_new], [:var_ref, [:@kw, "nil", [1, 9]]]],
# nil,
# nil,
# nil]]]]
//}
Ripper.sexp_raw は Ripper.sexp とは異なり解析結果を加工しません。
@see Ripper.sexp... -
PrettyPrint
. format(output = & # 39;& # 39; , maxwidth = 79 , newline = "\n" , genspace = lambda{|n| & # 39; & # 39; * n}) {|pp| . . . } -> object (215.0) -
PrettyPrint オブジェクトを生成し、それを引数としてブロックを実行します。 与えられた output を返します。
...きをするもので簡便のために用意されています。
//emlist[][ruby]{
require 'prettyprint'
begin
pp = PrettyPrint.new(output, maxwidth, newline, &genspace)
...
pp.flush
output
end
//}
@param output 出力先を指定します。output は << メソッドを持っていな... -
PrettyPrint
. singleline _ format(output = & # 39;& # 39; , maxwidth = 79 , newline = "\n" , genspace = lambda{|n| & # 39; & # 39; * n}) {|pp| . . . } -> object (203.0) -
PrettyPrint オブジェクトを生成し、それを引数としてブロックを実行します。 PrettyPrint.format に似ていますが、改行しません。
PrettyPrint オブジェクトを生成し、それを引数としてブロックを実行します。
PrettyPrint.format に似ていますが、改行しません。
引数 maxwidth, newline と genspace は無視されます。ブロック中の breakable の実行は、
改行せずに text の実行であるかのように扱います。
@param output 出力先を指定します。output は << メソッドを持っていなければなりません。
@param maxwidth 無視されます。
@param newline 無視されます。
@param genspace 無視されます...