Class: Minjs::ECMA262::StContinue
- Defined in:
- lib/minjs/ecma262/statement.rb
Overview
Base class of ECMA262 ContinueStatement element.
Instance Attribute Summary collapse
-
#exp ⇒ Object
readonly
Returns the value of attribute exp.
Attributes inherited from Base
Instance Method Summary collapse
-
#==(obj) ⇒ Object
compare object.
-
#deep_dup ⇒ Object
duplicate object.
-
#initialize(exp = nil) ⇒ StContinue
constructor
A new instance of StContinue.
-
#to_js(options = {}) ⇒ Object
Returns a ECMAScript string containg the representation of element.
-
#traverse(parent) {|parent, _self| ... } ⇒ Object
Traverses this children and itself with given block.
Methods inherited from Statement
#empty?, #priority, #to_exp?, #to_return?
Methods inherited from Base
#add_remove_paren, #concat, #replace
Constructor Details
#initialize(exp = nil) ⇒ StContinue
Returns a new instance of StContinue.
1011 1012 1013 |
# File 'lib/minjs/ecma262/statement.rb', line 1011 def initialize(exp = nil) @exp = exp end |
Instance Attribute Details
#exp ⇒ Object (readonly)
Returns the value of attribute exp.
1009 1010 1011 |
# File 'lib/minjs/ecma262/statement.rb', line 1009 def exp @exp end |
Instance Method Details
#==(obj) ⇒ Object
compare object
1028 1029 1030 1031 |
# File 'lib/minjs/ecma262/statement.rb', line 1028 def ==(obj) self.class == obj.class and @exp == obj.exp end |
#deep_dup ⇒ Object
duplicate object
1017 1018 1019 |
# File 'lib/minjs/ecma262/statement.rb', line 1017 def deep_dup self.class.new(@exp ? @exp.deep_dup : nil) end |
#to_js(options = {}) ⇒ Object
Returns a ECMAScript string containg the representation of element.
1035 1036 1037 1038 1039 1040 1041 |
# File 'lib/minjs/ecma262/statement.rb', line 1035 def to_js( = {}) if @exp concat , :continue, @exp, ";" else concat , :continue, ";" end end |
#traverse(parent) {|parent, _self| ... } ⇒ Object
Traverses this children and itself with given block.
1022 1023 1024 1025 |
# File 'lib/minjs/ecma262/statement.rb', line 1022 def traverse(parent, &block) @exp.traverse(self, &block) if @exp yield parent, self end |