From 1f26936a3cb6f2d1ebfd4e6dc24b0130f13e8d94 Mon Sep 17 00:00:00 2001 From: Suchakra Sharma Date: Wed, 4 Feb 2026 13:47:13 -0500 Subject: [PATCH] [fix] do not parse CS files as bytecode --- DotNetAstGen/Program.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DotNetAstGen/Program.cs b/DotNetAstGen/Program.cs index 41d1de7..663ded8 100644 --- a/DotNetAstGen/Program.cs +++ b/DotNetAstGen/Program.cs @@ -202,13 +202,13 @@ private static void _ParseByteCode(string inputPath, DirectoryInfo rootOutputPat .AsParallel() .ForAll(inputFile => _SummaryForDLLFile(inputFile, exclusionRegex)); } - else if (File.Exists(inputPath)) + else if (File.Exists(inputPath) && Path.GetExtension(inputPath).ToLower() == ".dll") { var file = new FileInfo(inputPath); Debug.Assert(file.Directory != null, "Given file has a null parent directory!"); _SummaryForDLLFile(file, exclusionRegex); } - else + else if (!File.Exists(inputPath)) { _logger?.LogError("The path {inputPath} does not exist!", inputPath); Environment.Exit(1);