lib/tailor/lexer/token.rb in tailor-1.2.1 vs lib/tailor/lexer/token.rb in tailor-1.3.0

- old
+ new

@@ -38,11 +38,11 @@ # Checks if +self+ is "do" and +@options[:loop_with_do] is true. # # @return [Boolean] def do_is_for_a_loop? - self == "do" && @options[:loop_with_do] + self == 'do' && @options[:loop_with_do] end # @return [Boolean] def screaming_snake_case? self =~ /[A-Z].*_/ @@ -66,25 +66,25 @@ return false if not keyword_to_indent? line_of_text = @options[:full_line_of_text] log "Line of text: #{line_of_text}" - result = catch(:result) do + catch(:result) do sexp_line = Ripper.sexp(line_of_text) if sexp_line.nil? - msg = "sexp line was nil. " - msg << "Perhaps that line is part of a multi-line statement?" + msg = 'sexp line was nil. ' + msg << 'Perhaps that line is part of a multi-line statement?' log msg - log "Trying again with the last char removed from the line..." + log 'Trying again with the last char removed from the line...' line_of_text.chop! sexp_line = Ripper.sexp(line_of_text) end if sexp_line.nil? - log "sexp line was nil again." - log "Trying 1 more time with the last char removed from the line..." + log 'sexp line was nil again.' + log 'Trying 1 more time with the last char removed from the line...' line_of_text.chop! sexp_line = Ripper.sexp(line_of_text) end if sexp_line.is_a? Array @@ -97,13 +97,11 @@ end) rescue NoMethodError end end end - - result end - + # @return [Boolean] def fake_backslash_line_end? self =~ /^# TAILOR REMOVED BACKSLASH\n?$/ end end