Skip to content

Commit 43dbac4

Browse files
committed
Cleanup lexing of heredoc content
1 parent 94e75d7 commit 43dbac4

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

lib/opal/parser/lexer.rb

+1-9
Original file line numberDiff line numberDiff line change
@@ -340,8 +340,6 @@ def parse_string
340340
end
341341

342342
def add_heredoc_content(str_buffer, str_parse)
343-
scanner = @scanner
344-
345343
eos_regx = /[ \t]*#{Regexp.escape(str_parse[:end])}(\r*\n|$)/
346344
expand = true
347345

@@ -356,13 +354,7 @@ def add_heredoc_content(str_buffer, str_parse)
356354
elsif expand && check(/#(?=[\$\@\{])/)
357355
break
358356
elsif scan(/\\/)
359-
if str_parse[:type] == :regexp
360-
if scan(/(.)/)
361-
c = "\\" + scanner.matched
362-
end
363-
else
364-
c = self.read_escape
365-
end
357+
c = self.read_escape
366358
else
367359
handled = false
368360
end

0 commit comments

Comments
 (0)