Class: Furnace::AVM2::Tokens::ClassToken
- Inherits:
-
Code::NonterminalToken
- Object
- Code::NonterminalToken
- Furnace::AVM2::Tokens::ClassToken
- Includes:
- TokenWithTraits
- Defined in:
- lib/furnace-avm2/source/declaration_tokens/class_token.rb
Instance Method Summary collapse
-
#initialize(origin, options = {}) ⇒ ClassToken
constructor
A new instance of ClassToken.
Methods included from TokenWithTraits
#transform_trait, #transform_traits
Constructor Details
#initialize(origin, options = {}) ⇒ ClassToken
Returns a new instance of ClassToken.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/furnace-avm2/source/declaration_tokens/class_token.rb', line 5 def initialize(origin, ={}) if origin.interface? = .merge(environment: :interface) else = .merge(environment: :class) end super(origin, [ ClassSpecifiersToken.new(origin, ), ClassNameToken.new(origin, ), (ClassInheritanceToken.new(origin, ) if origin.super_name), (ClassImplementationsToken.new(origin, ) if origin.interfaces.any?), ScopeToken.new(origin, [ *transform_traits(origin.klass, .merge(static: true, instance: origin)), (Furnace::Code::NewlineToken.new(origin, ) if origin.klass.traits.any?), *transform_traits(origin, .merge(static: false, instance: origin)), ], ) ], ) end |