Class: Hephaestus::Actions::StripCommentsAction::StripLeadingScopeNewlines::LeadingNewlineStripRewriter

Inherits:
Parser::TreeRewriter
  • Object
show all
Defined in:
lib/hephaestus/actions/strip_comments_action.rb

Instance Method Summary collapse

Instance Method Details

#on_begin(node) ⇒ Object



171
172
173
174
175
# File 'lib/hephaestus/actions/strip_comments_action.rb', line 171

def on_begin(node)
  handle_begin(node)

  super
end

#on_block(node) ⇒ Object



186
187
188
189
190
191
# File 'lib/hephaestus/actions/strip_comments_action.rb', line 186

def on_block(node)
  strip_newline_before(node.children[2])
  strip_newline_after(node.children.last)

  super
end

#on_class(node) ⇒ Object



164
165
166
167
168
169
# File 'lib/hephaestus/actions/strip_comments_action.rb', line 164

def on_class(node)
  strip_newline_before(node.children[2])
  strip_newline_after(node.children.last)

  super
end

#on_kwbegin(node) ⇒ Object



177
178
179
180
181
182
183
184
# File 'lib/hephaestus/actions/strip_comments_action.rb', line 177

def on_kwbegin(node)
  strip_newline_before(node.children[0])
  strip_newline_after(node.children.last)

  handle_begin(node)

  super
end

#on_module(node) ⇒ Object



157
158
159
160
161
162
# File 'lib/hephaestus/actions/strip_comments_action.rb', line 157

def on_module(node)
  strip_newline_before(node.children[1])
  strip_newline_after(node.children.last)

  super
end