Class: Minjs::ECMA262::SingleLineComment
- Defined in:
- lib/minjs/ecma262/literal.rb
Overview
Class of ECMA262 SingleLineComment Element
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#==(obj) ⇒ Object
compare object.
-
#initialize(comment) ⇒ SingleLineComment
constructor
A new instance of SingleLineComment.
-
#to_js(options) ⇒ Object
Returns a ECMAScript string containg the representation of element.
-
#traverse(parent, &block) ⇒ Object
Traverses this children and itself with given block.
-
#ws? ⇒ Boolean
true if literal is white space.
Methods inherited from Literal
#lt?, #priority, #side_effect?
Methods inherited from Base
#add_remove_paren, #concat, #deep_dup, #replace
Constructor Details
#initialize(comment) ⇒ SingleLineComment
Returns a new instance of SingleLineComment.
1099 1100 1101 |
# File 'lib/minjs/ecma262/literal.rb', line 1099 def initialize(comment) @comment = comment end |
Instance Method Details
#==(obj) ⇒ Object
compare object
1110 1111 1112 1113 |
# File 'lib/minjs/ecma262/literal.rb', line 1110 def ==(obj) self.class == obj.class and @comment == obj.comment end |
#to_js(options) ⇒ Object
Returns a ECMAScript string containg the representation of element.
1117 1118 1119 |
# File 'lib/minjs/ecma262/literal.rb', line 1117 def to_js() "//#{@comment}" end |
#traverse(parent, &block) ⇒ Object
Traverses this children and itself with given block.
1106 1107 |
# File 'lib/minjs/ecma262/literal.rb', line 1106 def traverse(parent, &block) end |
#ws? ⇒ Boolean
true if literal is white space
1122 1123 1124 |
# File 'lib/minjs/ecma262/literal.rb', line 1122 def ws? true end |