Class: Minjs::ECMA262::MultiLineComment
- Defined in:
- lib/minjs/ecma262/lit.rb
Instance Attribute Summary collapse
-
#comment ⇒ Object
readonly
Returns the value of attribute comment.
-
#has_lf ⇒ Object
readonly
Returns the value of attribute has_lf.
Instance Method Summary collapse
- #==(obj) ⇒ Object
-
#initialize(comment, has_lf) ⇒ MultiLineComment
constructor
A new instance of MultiLineComment.
- #lt? ⇒ Boolean
- #to_js(options) ⇒ Object
- #traverse(parent, &block) ⇒ Object
- #ws? ⇒ Boolean
Methods inherited from Literal
Methods inherited from Base
#concat, #deep_dup, #replace, #to_s
Constructor Details
#initialize(comment, has_lf) ⇒ MultiLineComment
Returns a new instance of MultiLineComment.
569 570 571 572 |
# File 'lib/minjs/ecma262/lit.rb', line 569 def initialize(comment, has_lf) @comment = comment @has_lf = has_lf end |
Instance Attribute Details
#comment ⇒ Object (readonly)
Returns the value of attribute comment.
567 568 569 |
# File 'lib/minjs/ecma262/lit.rb', line 567 def comment @comment end |
#has_lf ⇒ Object (readonly)
Returns the value of attribute has_lf.
567 568 569 |
# File 'lib/minjs/ecma262/lit.rb', line 567 def has_lf @has_lf end |
Instance Method Details
#==(obj) ⇒ Object
577 578 579 580 581 |
# File 'lib/minjs/ecma262/lit.rb', line 577 def ==(obj) self.class == obj.class and @comment == obj.comment and @has_lf == obj.has_lf end |
#lt? ⇒ Boolean
595 596 597 |
# File 'lib/minjs/ecma262/lit.rb', line 595 def lt? @has_lf ? true : false end |
#to_js(options) ⇒ Object
583 584 585 586 587 588 589 |
# File 'lib/minjs/ecma262/lit.rb', line 583 def to_js() if lt? "/*#{@comment}*/" else "/*#{@comment}*/" end end |
#traverse(parent, &block) ⇒ Object
574 575 |
# File 'lib/minjs/ecma262/lit.rb', line 574 def traverse(parent, &block) end |