D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
RubyVM
/
AbstractSyntaxTree
/
Node
/
Filename :
tokens-i.ri
back
Copy
U:RDoc::AnyMethod[iI"tokens:ETI",RubyVM::AbstractSyntaxTree::Node#tokens;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"?Returns tokens corresponding to the location of the node. ;TI"PReturns +nil+ if +keep_tokens+ is not enabled when #parse method is called.;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [I"Mroot = RubyVM::AbstractSyntaxTree.parse("x = 1 + 2", keep_tokens: true) ;TI"`root.tokens # => [[0, :tIDENTIFIER, "x", [1, 0, 1, 1]], [1, :tSP, " ", [1, 1, 1, 2]], ...] ;TI"2root.tokens.map{_1[2]}.join # => "x = 1 + 2" ;T:@format0o; ; [I"Token is an array of:;T@o:RDoc::Markup::List: @type:BULLET:@items[ o:RDoc::Markup::ListItem:@label0; [o; ; [I"id;To;;0; [o; ; [I"token type;To;;0; [o; ; [I"source code text;To;;0; [o; ; [I"Flocation [ first_lineno, first_column, last_lineno, last_column ];T: @fileI"ast.rb;T:0@omit_headings_from_table_of_contents_below0I"node.tokens -> array ;T0[ I"();T@.FI" Node;TcRDoc::NormalClass00