Class: Furnace::AVM2::Tokens::CommentToken
- Inherits:
-
Code::TerminalToken
- Object
- Code::TerminalToken
- Furnace::AVM2::Tokens::CommentToken
- Defined in:
- lib/furnace-avm2/source/declaration_tokens/comment_token.rb
Instance Method Summary collapse
-
#initialize(origin, content, options = {}) ⇒ CommentToken
constructor
A new instance of CommentToken.
- #to_structure(options = {}) ⇒ Object
- #to_text ⇒ Object
Constructor Details
#initialize(origin, content, options = {}) ⇒ CommentToken
Returns a new instance of CommentToken.
3 4 5 6 |
# File 'lib/furnace-avm2/source/declaration_tokens/comment_token.rb', line 3 def initialize(origin, content, ={}) super(origin, ) @content = content end |
Instance Method Details
#to_structure(options = {}) ⇒ Object
18 19 20 |
# File 'lib/furnace-avm2/source/declaration_tokens/comment_token.rb', line 18 def to_structure(={}) structurize "/* ... */", end |
#to_text ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/furnace-avm2/source/declaration_tokens/comment_token.rb', line 8 def to_text if @options[:commented] " #{@content}\n" elsif @content.is_a? Furnace::Code::Token "/*\n#{@content.to_text.rstrip}\n */\n\n" else "/* #{@content} */\n" end end |