Class: NScript::CommentNode

Inherits:
Node
  • Object
show all
Defined in:
lib/nscript/parser/nodes.rb

Constant Summary

Constants inherited from Node

Node::TAB

Instance Method Summary collapse

Methods inherited from Node

#children, children, #compile, #compile_closure, #contains?, #idt, statement, #statement?, statement_only, #statement_only?, top_sensitive, #top_sensitive?, #unwrap, #write

Constructor Details

#initialize(lines) ⇒ CommentNode

Returns a new instance of CommentNode.



189
190
191
# File 'lib/nscript/parser/nodes.rb', line 189

def initialize(lines)
  @lines = lines.value
end

Instance Method Details

#compile_node(o = {}) ⇒ Object



193
194
195
196
# File 'lib/nscript/parser/nodes.rb', line 193

def compile_node(o={})
  delimiter = "\n#{idt}//"
  write("#{delimiter}#{@lines.join(delimiter)}")
end