File tree Expand file tree Collapse file tree 1 file changed +4
-19
lines changed
Expand file tree Collapse file tree 1 file changed +4
-19
lines changed Original file line number Diff line number Diff line change @@ -286,25 +286,10 @@ def add_expression_block_end(code, escaped: false)
286286
287287 @src . chomp! if @src . end_with? ( "\n " ) && code_stripped . start_with? ( " " )
288288
289- has_comment = code . include? ( "#" )
290- closing = escaped ? "))" : ")"
291-
292- if has_comment
293- comment_index = code_stripped . index ( "#" )
294- code_part = code_stripped [ 0 ...comment_index ] . rstrip
295- comment_part = code_stripped [ comment_index ..]
296-
297- @src << " " << code_part << closing << " " << comment_part << "\n "
298- else
299- @src << " " << code_stripped
300- @src << closing
301-
302- @src << if trailing_newline
303- "\n "
304- else
305- ";"
306- end
307- end
289+ @src << " " << code_stripped
290+ @src << "\n " if self . class . comment? ( code_stripped )
291+ @src << ( escaped ? "))" : ")" )
292+ @src << ( trailing_newline ? "\n " : ";" )
308293
309294 @buffer_on_stack = false
310295 end
You can’t perform that action at this time.
0 commit comments