Skip to content

Commit 337de6c

Browse files
committed
Remove un-needed eos string check for heredocs
1 parent 00e283f commit 337de6c

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

lib/opal/parser/lexer.rb

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,6 @@ def here_document(str_parse)
235235
end
236236

237237
until check(eos_regx) && scanner.bol?
238-
handled = true
239-
240238
if scanner.eos?
241239
raise "reached EOF while in heredoc"
242240
end
@@ -248,11 +246,7 @@ def here_document(str_parse)
248246
elsif scan(/\\/)
249247
str_buffer << self.read_escape
250248
else
251-
handled = false
252-
end
253-
254-
unless handled
255-
reg = Regexp.new("[^#{Regexp.escape str_parse[:end]}\#\0\\\\\n]+|.")
249+
reg = Regexp.new("[^\#\0\\\\\n]+|.")
256250

257251
scan reg
258252
str_buffer << scanner.matched

0 commit comments

Comments
 (0)