This commit is contained in:
Бондарев Иван 2019-08-18 18:08:27 +02:00
parent cefb2564ab
commit a7047fe990
3 changed files with 16 additions and 2 deletions

View file

@ -2773,6 +2773,7 @@ namespace PascalABCCompiler
}
return false;
}
private Dictionary<string, SyntaxTree.syntax_namespace_node> IncludeNamespaces(CompilationUnit Unit)
{
@ -2811,7 +2812,7 @@ namespace PascalABCCompiler
}
}
Dictionary<string, SyntaxTree.syntax_namespace_node> namespaces = new Dictionary<string, SyntaxTree.syntax_namespace_node>();
Dictionary<string, SyntaxTree.syntax_namespace_node> namespaces = new Dictionary<string, SyntaxTree.syntax_namespace_node>(StringComparer.OrdinalIgnoreCase);
List<SyntaxTree.unit_or_namespace> namespace_modules = new List<SyntaxTree.unit_or_namespace>();
foreach (string file in files)
{
@ -3304,7 +3305,7 @@ namespace PascalABCCompiler
for (int i = SyntaxUsesList.Count - 1 - CurrentUnit.InterfaceUsedUnits.Count; i >= 0; i--)
{
if (IsPossibleNamespace(SyntaxUsesList[i], true))
if (IsPossibleNamespace(SyntaxUsesList[i], true) || namespaces.ContainsKey(SyntaxUsesList[i].name.idents[0].name))
{
CurrentUnit.InterfaceUsedUnits.AddElement(new TreeRealization.namespace_unit_node(GetNamespace(SyntaxUsesList[i])));
CurrentUnit.PossibleNamespaces.Add(SyntaxUsesList[i]);

View file

@ -0,0 +1,6 @@
namespace Spacename;
type TClass = class
end;
end.

View file

@ -0,0 +1,7 @@
//nopabcrtl
{$includenamespace 'namespaces/Spacename.pas'}
uses Spacename;
begin
var t: TClass;
end.