Class: MarshalParser::Parser::SymbolNode
Instance Method Summary
collapse
Methods inherited from Node
#always_leaf?, #children, #decoded_value, #tokens
Methods included from Assertable
#assert
Constructor Details
#initialize(marker_token, length_token, content_token, link_to_symbol) ⇒ SymbolNode
Returns a new instance of SymbolNode.
391
392
393
394
395
396
397
398
399
400
401
|
# File 'lib/marshal-parser/parser.rb', line 391
def initialize(marker_token, length_token, content_token, link_to_symbol)
super()
assert_token_type marker_token, Lexer::SYMBOL_PREFIX
assert_token_type length_token, Lexer::INTEGER
assert_token_type content_token, Lexer::SYMBOL
@marker_token = marker_token
@length_token = length_token
@content_token = content_token
@link_to_symbol = link_to_symbol end
|
Instance Method Details
#annotation ⇒ Object
407
408
409
|
# File 'lib/marshal-parser/parser.rb', line 407
def annotation
"symbol ##{@link_to_symbol}"
end
|
#attributes ⇒ Object
415
416
417
418
419
420
|
# File 'lib/marshal-parser/parser.rb', line 415
def attributes
{
@length_token => { name: :length, value: @length_token.value },
@content_token => { name: :content, value: @content_token }
}
end
|
#child_entities ⇒ Object
403
404
405
|
# File 'lib/marshal-parser/parser.rb', line 403
def child_entities
[@marker_token, @length_token, @content_token]
end
|
#literal_token ⇒ Object
411
412
413
|
# File 'lib/marshal-parser/parser.rb', line 411
def literal_token
@content_token
end
|