Class: Minjs::ECMA262::LineTerminator

Inherits:
Literal show all
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.

See Also:

Constant Summary collapse

@@instance =
self.new()

Instance Attribute Summary

Attributes inherited from Base

#parent

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Literal

#priority, #side_effect?, #ws?

Methods inherited from Base

#add_remove_paren, #concat, #deep_dup, #replace

Class Method Details

.getObject

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

Returns:



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.

See Also:



125
126
127
# File 'lib/minjs/ecma262/literal.rb', line 125

def to_js(options = {})
  "\n"
end

#traverse(parent, &block) ⇒ Object

Traverses this children and itself with given block.

See Also:



110
111
# File 'lib/minjs/ecma262/literal.rb', line 110

def traverse(parent, &block)
end