Class: MarshalParser::Parser::SymbolLinkNode
- Inherits:
-
Node
- Object
- Node
- MarshalParser::Parser::SymbolLinkNode
show all
- Includes:
- Annotatable
- Defined in:
- lib/marshal-parser/parser.rb
Instance Method Summary
collapse
Methods inherited from Node
#always_leaf?, #children, #tokens
Methods included from Assertable
#assert
Constructor Details
#initialize(marker_token, index_token) ⇒ SymbolLinkNode
Returns a new instance of SymbolLinkNode.
568
569
570
571
572
573
574
575
|
# File 'lib/marshal-parser/parser.rb', line 568
def initialize(marker_token, index_token)
super()
assert_token_type marker_token, Lexer::SYMBOL_LINK_PREFIX
assert_token_type index_token, Lexer::INTEGER
@marker_token = marker_token
@index_token = index_token
end
|
Instance Method Details
#annotation ⇒ Object
581
582
583
|
# File 'lib/marshal-parser/parser.rb', line 581
def annotation
"link to symbol ##{@index_token.value}"
end
|
#attributes ⇒ Object
593
594
595
596
597
|
# File 'lib/marshal-parser/parser.rb', line 593
def attributes
{
@index_token => { name: :index, value: @index_token.value }
}
end
|
#child_entities ⇒ Object
577
578
579
|
# File 'lib/marshal-parser/parser.rb', line 577
def child_entities
[@marker_token, @index_token]
end
|
#decoded_value ⇒ Object
585
586
587
|
# File 'lib/marshal-parser/parser.rb', line 585
def decoded_value
@index_token.value
end
|
#literal_token ⇒ Object
589
590
591
|
# File 'lib/marshal-parser/parser.rb', line 589
def literal_token
@index_token
end
|