Skip to content

Commit

Permalink
rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
tenderlove committed Oct 1, 2022
1 parent abea47e commit 8f5a88a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 5 additions & 5 deletions actionview/lib/action_view/template/handlers/erb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def tokenize(source)
tokens << [:TEXT, source.string[pos, len]] if len > 0
tokens << [:OPEN, source.matched]
if source.scan(/(.*?)(?=#{finish_re}|$)/m)
tokens << [:CODE, source.matched]
tokens << [:CODE, source.matched]
tokens << [:CLOSE, source.scan(finish_re)] unless source.eos?
else
raise NotImplemented
Expand All @@ -140,9 +140,9 @@ def find_offset(compiled, source_tokens, error_column)

while tok = source_tokens.shift
case tok
in [:TEXT, str]
in [:TEXT, str]
raise unless compiled.scan(str)
in [:CODE, str]
in [:CODE, str]
raise "We went too far" if compiled.pos > error_column

if compiled.pos + str.bytesize >= error_column
Expand All @@ -151,13 +151,13 @@ def find_offset(compiled, source_tokens, error_column)
else
raise unless compiled.scan(str)
end
in [:OPEN, str]
in [:OPEN, str]
next_tok = source_tokens.first.last
loop do
break if compiled.match?(next_tok)
compiled.getch
end
in [:CLOSE, str]
in [:CLOSE, str]
next_tok = source_tokens.first.last
loop do
break if compiled.match?(next_tok)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class Thread::Backtrace::Location
if defined?(ErrorHighlight) && Gem::Version.new(ErrorHighlight::VERSION) >= Gem::Version.new("0.4.0")
def spot(ex)
Expand Down

0 comments on commit 8f5a88a

Please sign in to comment.