lib/rubocop/rbs/processed_rbs_source.rb in rubocop-on-rbs-0.6.0 vs lib/rubocop/rbs/processed_rbs_source.rb in rubocop-on-rbs-0.7.0
- old
+ new
@@ -21,12 +21,14 @@
def valid_syntax?
@error.nil?
end
- def tokens
+ def tokens(with_trivia: false)
@tokens ||= begin
- ::RBS::Parser.lex(buffer).value
+ tokens = ::RBS::Parser.lex(buffer).value
+ tokens.reject! { |token| token.type == :tTRIVIA } unless with_trivia
+ tokens
end
end
end
end
end