Class: Furnace::AVM2::Tokens::SlotToken
- Inherits:
-
Code::SurroundedToken
- Object
- Code::SurroundedToken
- Furnace::AVM2::Tokens::SlotToken
- Defined in:
- lib/furnace-avm2/source/declaration_tokens/slot_token.rb
Instance Method Summary collapse
-
#initialize(origin, options = {}) ⇒ SlotToken
constructor
A new instance of SlotToken.
- #text_after ⇒ Object
Constructor Details
#initialize(origin, options = {}) ⇒ SlotToken
Returns a new instance of SlotToken.
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/furnace-avm2/source/declaration_tokens/slot_token.rb', line 3 def initialize(origin, ={}) super(origin, [ MetadataToken.new(origin, ), SpecifiersToken.new(origin, ), SlotNameToken.new(origin, ), (TypeToken.new(origin, [ MultinameToken.new(origin, origin.type, ) ], ) if origin.type) ], ) value = nil if [:property_values] *, value = [:property_values].find { |k,v| k == origin.name.to_astlet } end if value.nil? && origin.printable_value value = ImmediateToken.new(origin, origin.printable_value, ) end if value @children << InitializationToken.new(origin, [ value ], @options) end end |
Instance Method Details
#text_after ⇒ Object
28 29 30 |
# File 'lib/furnace-avm2/source/declaration_tokens/slot_token.rb', line 28 def text_after ";\n" end |