Class: Minjs::ECMA262::LineTerminator
- Defined in:
- lib/minjs/ecma262/literal.rb
Overview
Class of ECMA262 LineTerminator element
Every LineTerminator characters in source elements is converted to this class object.
This class is singleton and representation string is u000A.
Constant Summary collapse
- @@instance =
self.new()
Instance Attribute Summary
Attributes inherited from Base
Class Method Summary collapse
-
.get ⇒ Object
get instance.
Instance Method Summary collapse
-
#==(obj) ⇒ Object
compare object.
-
#lt? ⇒ Boolean
true if literal is line terminator.
-
#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.
Methods inherited from Literal
#priority, #side_effect?, #ws?
Methods inherited from Base
#add_remove_paren, #concat, #deep_dup, #replace
Class Method Details
.get ⇒ Object
get instance
132 133 134 |
# File 'lib/minjs/ecma262/literal.rb', line 132 def self.get @@instance end |
Instance Method Details
#==(obj) ⇒ Object
compare object
119 120 121 |
# File 'lib/minjs/ecma262/literal.rb', line 119 def ==(obj) self.class == obj.class end |
#lt? ⇒ Boolean
true if literal is line terminator
114 115 116 |
# File 'lib/minjs/ecma262/literal.rb', line 114 def lt? true end |
#to_js(options = {}) ⇒ Object
Returns a ECMAScript string containg the representation of element.
125 126 127 |
# File 'lib/minjs/ecma262/literal.rb', line 125 def to_js( = {}) "\n" end |
#traverse(parent, &block) ⇒ Object
Traverses this children and itself with given block.
110 111 |
# File 'lib/minjs/ecma262/literal.rb', line 110 def traverse(parent, &block) end |