Browse Source

Fixed New Class generator with empty namespace

Brian Fiete 6 months ago
parent
commit
a5b032cc39
1 changed files with 4 additions and 2 deletions
  1. 4 2
      BeefLibs/corlib/src/Compiler.bf

+ 4 - 2
BeefLibs/corlib/src/Compiler.bf

@@ -225,10 +225,12 @@ namespace System
 				if (name.EndsWith(".bf", .OrdinalIgnoreCase))
 					name.RemoveFromEnd(3);
 				outFileName.Append(name);
+
+				var ns = Namespace..Trim();
+				if (!ns.IsEmpty)
+					outText.AppendF($"namespace {Namespace};\n\n");
 				outText.AppendF(
 					$"""
-					namespace {Namespace};
-					
 					class {name}
 					{{
 					}}