From 25531e18205cc59294b40c3cddb30ed2e9e04a5e Mon Sep 17 00:00:00 2001 From: Troy Sornson Date: Sun, 24 Nov 2024 22:28:52 -0700 Subject: [PATCH] Fix and support windows drive letters for root folders --- src/compiler/crystal/tools/typer.cr | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/compiler/crystal/tools/typer.cr b/src/compiler/crystal/tools/typer.cr index c5ac7fc66004..ebaa9d70d034 100644 --- a/src/compiler/crystal/tools/typer.cr +++ b/src/compiler/crystal/tools/typer.cr @@ -508,19 +508,12 @@ module Crystal @line_locators << loc[0] unless loc["col_number"]? @line_and_column_locators << loc[0] if loc["line_number"]? && loc["col_number"]? end - - pp! @dir_locators - pp! @file_locators - pp! @line_locators - pp! @line_and_column_locators end def visit(node : Crystal::Def) return false unless loc = node.location return false unless loc.filename && loc.line_number && loc.column_number - pp! loc if node_in_def_locators(loc) - puts "Accepted" all_defs << node files << loc.filename.to_s end @@ -533,7 +526,7 @@ module Crystal end private def node_in_def_locators(location : Crystal::Location) : Bool - return false unless location.to_s.starts_with?("/") + return false unless location.to_s.starts_with?("/") || location.to_s.starts_with?(/\w:/) return true if @dir_locators.any? { |d| location.filename.to_s.starts_with?(d) } return true if @file_locators.includes?(location.filename) return true if @line_locators.includes?("#{location.filename}:#{location.line_number}")