Class: Parser::AST::Node
- Inherits:
-
AST::Node
- Object
- AST::Node
- Parser::AST::Node
- Defined in:
- lib/parser/ast/node.rb
Overview
Instance Attribute Summary (collapse)
-
- (Parser::Source::Map) location
(also: #loc)
readonly
Source map for this Node.
Instance Method Summary (collapse)
-
- (Object) assign_properties(properties)
Assigns various properties to this AST node.
Instance Attribute Details
- (Parser::Source::Map) location (readonly) Also known as: loc
Source map for this Node.
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/parser/ast/node.rb', line 15 class Node < ::AST::Node attr_reader :location alias loc location ## # Assigns various properties to this AST node. Currently only the # location can be set. # # @param [Hash] properties # @option properties [Parser::Source::Map] :location Location information # of the node. # def assign_properties(properties) if (location = properties[:location]) location = location.dup if location.frozen? location.node = self @location = location end end end |
Instance Method Details
- (Object) assign_properties(properties)
Assigns various properties to this AST node. Currently only the location can be set.
28 29 30 31 32 33 34 |
# File 'lib/parser/ast/node.rb', line 28 def assign_properties(properties) if (location = properties[:location]) location = location.dup if location.frozen? location.node = self @location = location end end |