lib/reek/source/source_code.rb in reek-3.2.1 vs lib/reek/source/source_code.rb in reek-3.3.0
- old
+ new
@@ -80,18 +80,22 @@
# for the given source
def syntax_tree
@syntax_tree ||=
begin
begin
- ast, comments = @parser.parse_with_comments(@source, @description)
+ ast, comments = parser.parse_with_comments(source, description)
rescue Racc::ParseError, Parser::SyntaxError => error
$stderr.puts "#{description}: #{error.class.name}: #{error}"
end
# See https://whitequark.github.io/parser/Parser/Source/Comment/Associator.html
comment_map = Parser::Source::Comment.associate(ast, comments) if ast
TreeDresser.new.dress(ast, comment_map)
end
end
+
+ private
+
+ private_attr_reader :parser, :source
end
end
end