51件ヒット
[1-51件を表示]
(0.113秒)
種類
- インスタンスメソッド (33)
- 特異メソッド (11)
- 文書 (7)
ライブラリ
- ビルトイン (22)
- rexml (11)
-
ripper
/ lexer (11)
クラス
-
REXML
:: ParseException (11) - Ripper (11)
-
RubyVM
:: InstructionSequence (11) -
Thread
:: Backtrace :: Location (11)
キーワード
-
NEWS for Ruby 2
. 5 . 0 (7) - context (11)
-
first
_ lineno (11) - lex (11)
検索結果
先頭5件
- Thread
:: Backtrace :: Location # lineno -> Integer - REXML
:: ParseException # context -> [Integer , Integer , Integer] - RubyVM
:: InstructionSequence # first _ lineno -> Integer - Ripper
. lex(src , filename = & # 39;-& # 39; , lineno = 1) -> [[Integer , Integer] , Symbol , String , Ripper :: Lexer :: State] - Ripper
. lex(src , filename = & # 39;-& # 39; , lineno = 1) -> [[Integer , Integer] , Symbol , String]
-
Thread
:: Backtrace :: Location # lineno -> Integer (21208.0) -
self が表すフレームの行番号を返します。
...self が表すフレームの行番号を返します。
例: Thread::Backtrace::Location の例1を用いた例
//emlist[][ruby]{
loc = c(0..1).first
loc.lineno # => 2
//}... -
REXML
:: ParseException # context -> [Integer , Integer , Integer] (9421.0) -
パースエラーが起きた(XML上の)場所を返します。
...の)場所を返します。
要素3個の配列で、
[position, lineno, line]
という形で返します。
position, line は
REXML::ParseException#position
REXML::ParseException#line
と同じ値です。
lineno は IO#lineno が返す意味での行数です。
通常は line と同じ値... -
RubyVM
:: InstructionSequence # first _ lineno -> Integer (9214.0) -
self が表す命令シーケンスの 1 行目の行番号を返します。
...の 1 行目の行番号を返します。
例1:irb で実行した場合
RubyVM::InstructionSequence.compile('num = 1 + 2').first_lineno
# => 1
例2:
# /tmp/method.rb
require "foo-library"
def foo
p :foo
end
RubyVM::InstructionSequence.of(method(:foo)).first_lineno
# => 2... -
Ripper
. lex(src , filename = & # 39;-& # 39; , lineno = 1) -> [[Integer , Integer] , Symbol , String , Ripper :: Lexer :: State] (387.0) -
Ruby プログラム str をトークンに分割し、そのリストを返します。 ただし Ripper.tokenize と違い、トークンの種類と位置情報も付属します。
...ます。
@param lineno src の開始行番号を指定します。省略すると 1 になります。
//emlist[][ruby]{
require 'ripper'
pp Ripper.lex("def m(a) nil end")
# => [[[1, 0], :on_kw, "def", EXPR_FNAME],
# [[1, 3], :on_sp, " ", EXPR_FNAME],
# [[1, 4], :on_ident, "m", EXPR_EN......DFN],
# [[1, 5], :on_lparen, "(", EXPR_BEG|EXPR_LABEL],
# [[1, 6], :on_ident, "a", EXPR_ARG],
# [[1, 7], :on_rparen, ")", EXPR_ENDFN],
# [[1, 8], :on_sp, " ", EXPR_BEG],
# [[1, 9], :on_kw, "nil", EXPR_END],
# [[1, 12], :on_sp, " ", EXPR_END],
# on_kw, "end", EXPR_END
//}......す。
その内訳を以下に示します。
: 位置情報 (Integer,Integer)
トークンが置かれている行 (1-origin) と桁 (0-origin) の 2 要素の配列です。
: 種類 (Symbol)
トークンの種類が「:on_XXX」の形式のシンボルで渡されます。
: トーク......aram lineno src の開始行番号を指定します。省略すると 1 になります。
//emlist[][ruby]{
require 'ripper'
pp Ripper.lex("def m(a) nil end")
# => [[[1, 0], :on_kw, "def", FNAME],
# [[1, 3], :on_sp, " ", FNAME],
# [[1, 4], :on_ident, "m", ENDFN],
# [[1, 5], :on_lp......aren, "(", BEG|LABEL],
# [[1, 6], :on_ident, "a", ARG],
# [[1, 7], :on_rparen, ")", ENDFN],
# [[1, 8], :on_sp, " ", BEG],
# [[1, 9], :on_kw, "nil", END],
# [[1, 12], :on_sp, " ", END],
# on_kw, "end", END
//}
Ripper.lex は分割したトークンを詳しい情報ととも... -
Ripper
. lex(src , filename = & # 39;-& # 39; , lineno = 1) -> [[Integer , Integer] , Symbol , String] (387.0) -
Ruby プログラム str をトークンに分割し、そのリストを返します。 ただし Ripper.tokenize と違い、トークンの種類と位置情報も付属します。
...@param lineno src の開始行番号を指定します。省略すると 1 になります。
//emlist[][ruby]{
require 'ripper'
require 'pp'
pp Ripper.lex("def m(a) nil end")
# => [[[1, 0], :on_kw, "def"],
# [[1, 3], :on_sp, " "],
# [[1, 4], :on_ident, "m"],
# [[1, 5], :on_lparen,......"("],
# [[1, 6], :on_ident, "a"],
# [[1, 7], :on_rparen, ")"],
# [[1, 8], :on_sp, " "],
# [[1, 9], :on_kw, "nil"],
# [[1, 12], :on_sp, " "],
# on_kw, "end"
//}
Ripper.lex は分割したトークンを詳しい情報とともに返します。
返り値の配列の要素......す。
その内訳を以下に示します。
: 位置情報 (Integer,Integer)
トークンが置かれている行 (1-origin) と桁 (0-origin) の 2 要素の配列です。
: 種類 (Symbol)
トークンの種類が「:on_XXX」の形式のシンボルで渡されます。
: トーク... -
Ripper
. lex(src , filename = & # 39;-& # 39; , lineno = 1 , raise _ errors: false) -> [[Integer , Integer] , Symbol , String , Ripper :: Lexer :: State] (387.0) -
Ruby プログラム str をトークンに分割し、そのリストを返します。 ただし Ripper.tokenize と違い、トークンの種類と位置情報も付属します。
...クトで指定します。
@param filename src のファイル名を文字列で指定します。省略すると "-" になります。
@param lineno src の開始行番号を指定します。省略すると 1 になります。
@param raise_errors true を指定すると、src にエラーが......=> [[[1, 0], :on_kw, "def", FNAME],
# [[1, 3], :on_sp, " ", FNAME],
# [[1, 4], :on_ident, "m", ENDFN],
# [[1, 5], :on_lparen, "(", BEG|LABEL],
# [[1, 6], :on_ident, "a", ARG],
# [[1, 7], :on_rparen, ")", ENDFN],
# [[1, 8], :on_sp, " ", BEG],
# [[1, 9], :on_kw, "nil", END......す。
その内訳を以下に示します。
: 位置情報 (Integer,Integer)
トークンが置かれている行 (1-origin) と桁 (0-origin) の 2 要素の配列です。
: 種類 (Symbol)
トークンの種類が「:on_XXX」の形式のシンボルで渡されます。
: トーク... -
NEWS for Ruby 2
. 5 . 0 (102.0) -
NEWS for Ruby 2.5.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...推奨になりました。C拡張のベースクラスでしたが、Rubyレベルに公開するのをやめました。3072
* Exception
* Exception#full_message を追加 14141 [実験的]
例外の文字列表現を取得します。その文字列は捕捉されない例外をRuby......う。 13405
* Integer
* Integer#round, Integer#floor, Integer#ceil, Integer#truncate は常に Integer を返すようになりました
13420
* Integer#pow を追加 12508 11003
* Integer#allbits?, Integer#anybits?, Integer#nobits? を追加 12753
* Integer.sqrt を追加......> (counter) } }
//}
* jump base と jump target にはフォーマットがあります:
//emlist{
[type, unique-id, start lineno, start column, end lineno, end column]
//}
* 例えば [:if, 0, 2, 1, 6, 4] は、if式が2行目の1桁目から6行目の4桁目まで、と読みます...