Class: Minjs::ECMA262::MultiLineComment
- Includes:
- Ctype
- 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) ⇒ MultiLineComment
constructor
A new instance of MultiLineComment.
- #lt? ⇒ Boolean
- #to_js(options) ⇒ Object
- #traverse(parent, &block) ⇒ Object
- #ws? ⇒ Boolean
Methods included from Ctype
#decimal_digit?, #hex_digit?, #identifier_part?, #identifier_start?, #idname?, #line_terminator?, #octal_digit?, #white_space?
Methods inherited from Literal
Methods inherited from Base
#add_remove_paren, #concat, #deep_dup, #replace, #to_s
Constructor Details
#initialize(comment) ⇒ MultiLineComment
Returns a new instance of MultiLineComment.
826 827 828 |
# File 'lib/minjs/ecma262/lit.rb', line 826 def initialize(comment) @comment = comment end |
Instance Attribute Details
#comment ⇒ Object (readonly)
Returns the value of attribute comment.
823 824 825 |
# File 'lib/minjs/ecma262/lit.rb', line 823 def comment @comment end |
#has_lf ⇒ Object (readonly)
Returns the value of attribute has_lf.
823 824 825 |
# File 'lib/minjs/ecma262/lit.rb', line 823 def has_lf @has_lf end |
Instance Method Details
#==(obj) ⇒ Object
833 834 835 |
# File 'lib/minjs/ecma262/lit.rb', line 833 def ==(obj) self.class == obj.class and @comment == obj.comment end |
#lt? ⇒ Boolean
845 846 847 848 849 850 |
# File 'lib/minjs/ecma262/lit.rb', line 845 def lt? @comment.codepoints.each{|char| return true if line_terminator?(char) } false end |
#to_js(options) ⇒ Object
837 838 839 |
# File 'lib/minjs/ecma262/lit.rb', line 837 def to_js() "/*#{@comment}*/" end |
#traverse(parent, &block) ⇒ Object
830 831 |
# File 'lib/minjs/ecma262/lit.rb', line 830 def traverse(parent, &block) end |