Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions lib/ruby_ast_gen/erb_to_ruby_transformer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,13 @@ def visit(node)
@output << "#{buffer_to_use} << \"#{@static_buff.join('\n').gsub(/(?<!\\)"/, '')}\""
@static_buff = [] # clear static buffer
end
code = node[1].to_s.strip

stripped_code = node[1].to_s.strip
code = node[1].to_s
# Using this to determine if we should throw a StandardError for "invalid" ERB
if is_control_struct_start(code)
if is_control_struct_start(stripped_code)
@in_control_block = true
@output << code
@output << stripped_code
elsif code.start_with?("end")
if @in_do_block
@in_do_block = false
Expand Down
Loading