るりまサーチ

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

別のキーワード

  1. _builtin to_s
  2. openssl to_der
  3. openssl to_s
  4. _builtin to_a
  5. openssl to_pem

ライブラリ

クラス

検索結果

Psych::ScalarScanner#tokenize(string) -> object (24219.0)

YAML の scalar である文字列を Ruby のオブジェクトに変換した ものを返します。

...YAML の scalar である文字列を Ruby のオブジェクトに変換した
ものを返します。

scanner = Psych::ScalarScanner.new
p scanner.tokenize("yes") # => true
p scanner.tokenize("year") # => "year"
p scanner.tokenize("12") # => 12

@param string 変換文字列...

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

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

...uby]{
require 'ripper'

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 は空白やコメントも含...

Ripper.tokenize(src, filename = '-', lineno = 1) -> [String] (24213.0)

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

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


//emlist[][ruby]{
require 'ripper'

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

Ripper.tokenize は空白やコメントも含め、
元の文字列にある文字は 1 バイトも残さず...

Ripper::Lexer#tokenize -> [String] (24207.0)

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

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

ライブラリ内部で使用します。 Ripper.tokenize を使用してください。...