Class: Furnace::AVM2::Tokens::SpecifiersToken
- Inherits:
-
Code::TerminalToken
- Object
- Code::TerminalToken
- Furnace::AVM2::Tokens::SpecifiersToken
show all
- Defined in:
- lib/furnace-avm2/source/declaration_tokens/specifiers_token.rb
Instance Method Summary
collapse
Instance Method Details
#specifiers ⇒ Object
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# File 'lib/furnace-avm2/source/declaration_tokens/specifiers_token.rb', line 3
def specifiers
list = []
list << "static" if @options[:static]
unless @options[:environment] == :interface
if @origin.name.ns.name == ""
list << "public"
elsif @options[:instance]
if @options[:instance].protected_ns? &&
@origin.name.ns.name == @options[:instance].protected_ns.name
list << "protected"
elsif @origin.name.ns != @options[:instance].name.ns
list << "private"
end
end
end
list
end
|
#to_text ⇒ Object
24
25
26
27
28
29
30
31
32
|
# File 'lib/furnace-avm2/source/declaration_tokens/specifiers_token.rb', line 24
def to_text
list = specifiers
if list.any?
"#{list.join(" ")} "
else
""
end
end
|