るりまサーチ

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

別のキーワード

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

ライブラリ

クラス

モジュール

キーワード

検索結果

OpenSSL.#errors -> [String] (18303.0)

OpenSSL のエラーキューに残っているエラー文字列を返します。

OpenSSL のエラーキューに残っているエラー文字列を返します。

通常、エラーキューはこの拡張ライブラリが空にするため、
これは空の配列を返します。もしそうでないならば
このライブラリのバグです。

Ripper.lex(src, filename = '-', lineno = 1, raise_errors: false) -> [[Integer, Integer], Symbol, String, Ripper::Lexer::State] (333.0)

Ruby プログラム str をトークンに分割し、そのリストを返します。 ただし Ripper.tokenize と違い、トークンの種類と位置情報も付属します。

...す。省略すると 1 になります。

@param raise_errors true を指定すると、src にエラーがある場合に例外(SyntaxError)を発生させます。省略すると false になります。

@raise SyntaxError raise_errors が true で、src に文法エラーがある場合に発...
...要素の配列です。
: 種類 (Symbol)
トークンの種類が「:on_XXX」の形式のシンボルで渡されます。
: トークン (String)
トークン文字列です。
: ステート (Ripper::Lexer::State)
トークンの状態を表す Ripper::Lexer::State のインスタ...

Ripper.tokenize(src, filename = '-', lineno = 1, raise_errors: false) -> [String] (321.0)

Ruby プログラム str をトークンに分割し、そのリストを返します。

...す。省略すると 1 になります。

@param raise_errors true を指定すると、src にエラーがある場合に例外(SyntaxError)を発生させます。省略すると false になります。

@raise SyntaxError raise_errors が true で、src に文法エラーがある場合に発...
...'

p Ripper.tokenize("def m(a) nil end")
# => ["def", " ", "m", "(", "a", ")", " ", "nil", " ", "end"]

Ripper.tokenize("def req(true) end", raise_errors: true)
# => SyntaxError (syntax error, unexpected `true', expecting ')')
//}

Ripper.tokenize は空白やコメントも含め、
元の文字列...