Merge pull request #2246 from SunSerega/uses-in-new

Re: Адекватные uses-in
This commit is contained in:
Ivan Bondarev 2021-01-24 10:45:03 +01:00 committed by GitHub
commit 9a026595ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
30 changed files with 616 additions and 714 deletions

View file

@ -372,7 +372,7 @@ namespace CodeCompletion
Dirs.Add(CodeCompletionController.comp.CompilerOptions.SearchDirectory); Dirs.Add(CodeCompletionController.comp.CompilerOptions.SearchDirectory);
if (CodeCompletionController.StandartDirectories.ContainsKey(LibSourceDirectoryIdent)) if (CodeCompletionController.StandartDirectories.ContainsKey(LibSourceDirectoryIdent))
Dirs.Add((string)CodeCompletionController.StandartDirectories[LibSourceDirectoryIdent]); Dirs.Add((string)CodeCompletionController.StandartDirectories[LibSourceDirectoryIdent]);
return CodeCompletionController.comp.FindSourceFileName(unit_name, Dirs.ToArray()); return CodeCompletionController.comp.FindSourceFileNameInDirs(unit_name, Dirs.ToArray());
} }
public static CodeCompletionNameHelper Helper public static CodeCompletionNameHelper Helper

View file

@ -2414,7 +2414,7 @@ namespace CodeCompletion
public string FindPCUFileName(string UnitName) public string FindPCUFileName(string UnitName)
{ {
return CodeCompletionController.comp.FindPCUFileNameWithoutSources(UnitName,System.IO.Path.GetDirectoryName(doc.file_name)); return CodeCompletionController.comp.FindPCUFileName(UnitName,System.IO.Path.GetDirectoryName(doc.file_name), out _);
} }
private void add_system_unit() private void add_system_unit()
@ -2612,20 +2612,9 @@ namespace CodeCompletion
NamespaceScope ns_scope = null; NamespaceScope ns_scope = null;
if (i == 0) if (i == 0)
{ {
string unit_name = null;
string pcu_unit_name = FindPCUFileName(str); string pcu_unit_name = FindPCUFileName(str);
if (s is uses_unit_in) string unit_name = CodeCompletionNameHelper.FindSourceFileName(s is uses_unit_in uui ? uui.in_file.Value : str, Path.GetDirectoryName(_program_module.file_name));
{
string unit_in_file = (s as uses_unit_in).in_file.Value;
string unit_in_dir = null;
if (Path.IsPathRooted(unit_in_file))
unit_in_dir = Path.GetDirectoryName(unit_in_file);
else
unit_in_dir = Path.Combine(Path.GetDirectoryName(_program_module.file_name),Path.GetDirectoryName(unit_in_file));
unit_name = CodeCompletionNameHelper.FindSourceFileName(Path.GetFileNameWithoutExtension(unit_in_file), unit_in_dir);
}
else
unit_name = CodeCompletionNameHelper.FindSourceFileName(str, System.IO.Path.GetDirectoryName(_program_module.file_name));
/*if (pcu_unit_name != null && unit_name != null && string.Compare(System.IO.Path.GetDirectoryName(_program_module.file_name), System.IO.Path.GetDirectoryName(pcu_unit_name), true) == 0 /*if (pcu_unit_name != null && unit_name != null && string.Compare(System.IO.Path.GetDirectoryName(_program_module.file_name), System.IO.Path.GetDirectoryName(pcu_unit_name), true) == 0
&& string.Compare(System.IO.Path.GetDirectoryName(_program_module.file_name), System.IO.Path.GetDirectoryName(unit_name), true) != 0) && string.Compare(System.IO.Path.GetDirectoryName(_program_module.file_name), System.IO.Path.GetDirectoryName(unit_name), true) != 0)
unit_name = null;*/ unit_name = null;*/
@ -4370,20 +4359,9 @@ namespace CodeCompletion
{ {
try try
{ {
string unit_name = null;
string pcu_unit_name = FindPCUFileName(str); string pcu_unit_name = FindPCUFileName(str);
if (s is uses_unit_in) string unit_name = CodeCompletionNameHelper.FindSourceFileName(s is uses_unit_in uui ? uui.in_file.Value : str, Path.GetDirectoryName(this.cur_unit_file_name));
{
string unit_in_file = (s as uses_unit_in).in_file.Value;
string unit_in_dir = null;
if (Path.IsPathRooted(unit_in_file))
unit_in_dir = Path.GetDirectoryName(unit_in_file);
else
unit_in_dir = Path.Combine(Path.GetDirectoryName(this.cur_unit_file_name),Path.GetDirectoryName(unit_in_file));
unit_name = CodeCompletionNameHelper.FindSourceFileName(Path.GetFileNameWithoutExtension(unit_in_file), unit_in_dir);
}
else
unit_name = CodeCompletionNameHelper.FindSourceFileName(str, System.IO.Path.GetDirectoryName(this.cur_unit_file_name));
/*if (pcu_unit_name != null && unit_name != null && string.Compare(System.IO.Path.GetDirectoryName(this.cur_unit_file_name), System.IO.Path.GetDirectoryName(pcu_unit_name), true) == 0 /*if (pcu_unit_name != null && unit_name != null && string.Compare(System.IO.Path.GetDirectoryName(this.cur_unit_file_name), System.IO.Path.GetDirectoryName(pcu_unit_name), true) == 0
&& string.Compare(System.IO.Path.GetDirectoryName(this.cur_unit_file_name), System.IO.Path.GetDirectoryName(unit_name), true) != 0) && string.Compare(System.IO.Path.GetDirectoryName(this.cur_unit_file_name), System.IO.Path.GetDirectoryName(unit_name), true) != 0)
unit_name = null;*/ unit_name = null;*/
@ -4503,12 +4481,9 @@ namespace CodeCompletion
{ {
try try
{ {
string unit_name = null;
string pcu_unit_name = FindPCUFileName(str); string pcu_unit_name = FindPCUFileName(str);
if (s is uses_unit_in) string unit_name = CodeCompletionNameHelper.FindSourceFileName(s is uses_unit_in uui ? uui.in_file.Value : str, Path.GetDirectoryName(this.cur_unit_file_name));
unit_name = (s as uses_unit_in).in_file.Value;
else
unit_name = CodeCompletionNameHelper.FindSourceFileName(str, System.IO.Path.GetDirectoryName(this.cur_unit_file_name));
/*if (pcu_unit_name != null && unit_name != null && string.Compare(System.IO.Path.GetDirectoryName(this.cur_unit_file_name), System.IO.Path.GetDirectoryName(pcu_unit_name), true) == 0 /*if (pcu_unit_name != null && unit_name != null && string.Compare(System.IO.Path.GetDirectoryName(this.cur_unit_file_name), System.IO.Path.GetDirectoryName(pcu_unit_name), true) == 0
&& string.Compare(System.IO.Path.GetDirectoryName(this.cur_unit_file_name), System.IO.Path.GetDirectoryName(unit_name), true) != 0) && string.Compare(System.IO.Path.GetDirectoryName(this.cur_unit_file_name), System.IO.Path.GetDirectoryName(unit_name), true) != 0)
unit_name = null;*/ unit_name = null;*/
@ -5162,7 +5137,7 @@ namespace CodeCompletion
} }
else else
{ {
string unit_name = CodeCompletionController.comp.FindSourceFileName(str); string unit_name = CodeCompletionController.comp.FindSourceFileName(str, System.IO.Path.GetDirectoryName(_c_module.file_name), out _);
if (unit_name == null) if (unit_name == null)
{ {
unit_name = Path.Combine(System.IO.Path.GetDirectoryName(_c_module.file_name), str) + System.IO.Path.GetExtension(_c_module.file_name); unit_name = Path.Combine(System.IO.Path.GetDirectoryName(_c_module.file_name), str) + System.IO.Path.GetExtension(_c_module.file_name);

File diff suppressed because it is too large Load diff

View file

@ -28,15 +28,15 @@ namespace PascalABCCompiler
XmlWriterSettings settings = new XmlWriterSettings(); XmlWriterSettings settings = new XmlWriterSettings();
settings.Encoding = Encoding.UTF8; settings.Encoding = Encoding.UTF8;
settings.Indent = true; settings.Indent = true;
xtw = XmlTextWriter.Create(Path.ChangeExtension(cu.UnitName, ".xml"), settings); xtw = XmlTextWriter.Create(Path.ChangeExtension(cu.UnitFileName, ".xml"), settings);
unit_name = Path.GetFileNameWithoutExtension(cu.UnitName); unit_name = Path.GetFileNameWithoutExtension(cu.UnitFileName);
xtw.WriteStartDocument(); xtw.WriteStartDocument();
xtw.WriteStartElement("doc"); xtw.WriteStartElement("doc");
if (is_assembly) if (is_assembly)
{ {
xtw.WriteStartElement("assembly"); xtw.WriteStartElement("assembly");
xtw.WriteStartElement("name"); xtw.WriteStartElement("name");
xtw.WriteString(Path.GetFileNameWithoutExtension(cu.UnitName)); xtw.WriteString(Path.GetFileNameWithoutExtension(cu.UnitFileName));
xtw.WriteEndElement(); xtw.WriteEndElement();
xtw.WriteEndElement(); xtw.WriteEndElement();
} }
@ -45,7 +45,7 @@ namespace PascalABCCompiler
xtw.WriteStartElement("unit"); xtw.WriteStartElement("unit");
xtw.WriteStartAttribute("name"); xtw.WriteStartAttribute("name");
//xtw.WriteString((cu.SemanticTree as common_unit_node).unit_name); //xtw.WriteString((cu.SemanticTree as common_unit_node).unit_name);
xtw.WriteString(Path.GetFileNameWithoutExtension(cu.UnitName)); xtw.WriteString(Path.GetFileNameWithoutExtension(cu.UnitFileName));
xtw.WriteEndAttribute(); xtw.WriteEndAttribute();
xtw.WriteString(cu.SemanticTree.documentation); xtw.WriteString(cu.SemanticTree.documentation);
xtw.WriteEndElement(); xtw.WriteEndElement();

View file

@ -189,14 +189,6 @@ namespace PascalABCCompiler.PCU
return already_compiled[name] != null; return already_compiled[name] != null;
} }
public static bool ContainsUnit(string FileName, out PCUReader pr)
{
string unit_name = System.IO.Path.GetFileNameWithoutExtension(FileName);
pr = (PCUReader)units[unit_name];
if (pr != null) return true;
return false;
}
public static void CloseUnits() public static void CloseUnits()
{ {
AllReadOrWritedDefinitionNodesOffsets.Clear(); AllReadOrWritedDefinitionNodesOffsets.Clear();
@ -226,40 +218,69 @@ namespace PascalABCCompiler.PCU
ReadPCUHeader(); ReadPCUHeader();
} }
//десериализация модуля public string GetFullUnitName(string UnitName)
//читается только шапка PCU и заполняются имена сущностей модуля в таблицу символов {
public CompilationUnit GetCompilationUnit(string FileName, bool readDebugInfo)
var FullUnitName = comp.FindPCUFileName(UnitName, dir, out _);
if (FullUnitName == null) throw new FileNotFound(UnitName, null);
return FullUnitName;
}
private PCUReader GetPCUReaderForUnitId(int id)
{
if (id == -1) return this;
string s = GetFullUnitName(pcu_file.incl_modules[id]);
var pr = (PCUReader)units[s];
if (pr == null)
{
pr = new PCUReader(this);
pr.GetCompilationUnit(s, this.readDebugInfo);
}
return pr;
}
//десериализация модуля
//читается только шапка PCU и заполняются имена сущностей модуля в таблицу символов
public CompilationUnit GetCompilationUnit(string FileName, bool readDebugInfo)
{ {
try try
{ {
// Compiler.CombinePath всегда должно быть применено к имени файла, перед тем как кидать его сюда
if (!Path.IsPathRooted(FileName)) throw new InvalidOperationException();
FileName = GetFullUnitName(FileName);
dir = Path.GetDirectoryName(FileName);
this.FileName = FileName; this.FileName = FileName;
this.readDebugInfo = readDebugInfo; this.readDebugInfo = readDebugInfo;
unit_name = System.IO.Path.GetFileNameWithoutExtension(FileName); unit_name = System.IO.Path.GetFileNameWithoutExtension(FileName);
PCUReader pr = (PCUReader)units[unit_name]; PCUReader pr = (PCUReader)units[FileName];
if (pr != null) return pr.unit; if (pr != null) return pr.unit;
if (!File.Exists(FileName)) return null; if (!File.Exists(FileName)) return null;
dir = System.IO.Path.GetDirectoryName(FileName);
//fs = new FileStream(FileName, FileMode.Open, FileAccess.Read); //fs = new FileStream(FileName, FileMode.Open, FileAccess.Read);
ms = new MemoryStream(File.ReadAllBytes(FileName)); ms = new MemoryStream(File.ReadAllBytes(FileName));
br = new BinaryReader(ms); br = new BinaryReader(ms);
ReadPCUHeader(); ReadPCUHeader();
units[unit_name] = this; units[FileName] = this;
if (NeedRecompiled())
{
CloseUnit();
need = true;
return null; // return comp.RecompileUnit(unit_name);
}
unit = new CompilationUnit(); unit = new CompilationUnit();
unit.UnitFileName = FileName;
cun = new common_unit_node(); cun = new common_unit_node();
cun.compiler_directives = pcu_file.compiler_directives; cun.compiler_directives = pcu_file.compiler_directives;
unit.SemanticTree = cun; unit.SemanticTree = cun;
if (NeedRecompiled())
{
CloseUnit();
this.unit = null;
need = true;
return null; // return comp.RecompileUnit(FileName);
}
ChangeState(this, PCUReaderWriterState.BeginReadTree, unit); ChangeState(this, PCUReaderWriterState.BeginReadTree, unit);
cun.scope = new WrappedUnitInterfaceScope(this); cun.scope = new WrappedUnitInterfaceScope(this);
//TODO сохранить в PCU //TODO сохранить в PCU
cun.scope.CaseSensitive = false; cun.scope.CaseSensitive = false;
if (string.Compare(unit_name,PascalABCCompiler.TreeConverter.compiler_string_consts.system_unit_file_name, true)==0) if (string.Compare(unit_name, compiler_string_consts.system_unit_file_name, true)==0)
PascalABCCompiler.TreeConverter.syntax_tree_visitor.init_system_module(cun); PascalABCCompiler.TreeConverter.syntax_tree_visitor.init_system_module(cun);
//ssyy //ssyy
//Создаём область видимости для implementation - части //Создаём область видимости для implementation - части
@ -321,10 +342,10 @@ namespace PascalABCCompiler.PCU
need = true; need = true;
return need; return need;
}*/ }*/
if (comp.NeedRecompiled(unit_name, Path.GetDirectoryName(FileName), pcu_file.incl_modules,this)) if (comp.NeedRecompiled(FileName, pcu_file.incl_modules, this))
{ {
//comp.RecompileList.Add(unit_name,unit_name); //comp.RecompileList.Add(unit_name,unit_name);
comp.RecompileList[unit_name] = unit_name; comp.RecompileList[FileName] = FileName;
need = true; need = true;
return need; return need;
} }
@ -332,19 +353,24 @@ namespace PascalABCCompiler.PCU
for (int i = 0; i < pcu_file.incl_modules.Length; i++) for (int i = 0; i < pcu_file.incl_modules.Length; i++)
{ {
//if (pcu_file.incl_modules[i].Contains("$")) //if (pcu_file.incl_modules[i].Contains("$"))
// continue; // continue;
string source_file_name = comp.FindSourceFileName(Path.Combine(dir, pcu_file.incl_modules[i])); var used_unit_fname = comp.GetUnitFileName(Path.GetFileNameWithoutExtension(pcu_file.incl_modules[i]), pcu_file.incl_modules[i], dir, new SyntaxTree.SourceContext(0,0,0,0, FileName));
if (source_file_name != null && comp.UnitTable[source_file_name] != null) if (Path.GetExtension(used_unit_fname) != comp.CompilerOptions.CompiledUnitExtension) return true;
return true;
PCUReader pr = (PCUReader)units[pcu_file.incl_modules[i]]; PCUReader pr = (PCUReader)units[used_unit_fname];
if (pr == null) if (pr == null)
pr = new PCUReader(this); pr = new PCUReader(this);
pr.AddAlreadyCompiledUnit(FileName); pr.AddAlreadyCompiledUnit(FileName);
if (used_units[pcu_file.incl_modules[i]] == null) if (used_units[used_unit_fname] == null)
{ {
used_units[pcu_file.incl_modules[i]] = used_units; used_units[used_unit_fname] = used_units;
if (already_compiled[pcu_file.incl_modules[i]] == null) if (already_compiled[used_unit_fname] == null)
pr.GetCompilationUnit(comp.FindPCUFileName(pcu_file.incl_modules[i], source_file_name), this.readDebugInfo); {
var sub_u = pr.GetCompilationUnit(used_unit_fname, this.readDebugInfo);
if (sub_u == null) return true;
this.unit.DirectInterfaceCompilationUnits.Add(sub_u.SemanticTree, sub_u);
this.unit.InterfaceUsedUnits.AddElement(sub_u.SemanticTree, pcu_file.incl_modules[i]);
}
} }
if (need == false) need = pr.need; if (need == false) need = pr.need;
} }
@ -414,7 +440,7 @@ namespace PascalABCCompiler.PCU
private void AddNamespaces() private void AddNamespaces()
{ {
cun.unit_name=br.ReadString(); cun.unit_name=br.ReadString();
common_namespace_node cnn = new common_namespace_node(null, cun, cun.unit_name, cun.scope, ReadDebugInfo()); common_namespace_node cnn = new common_namespace_node(null, cun, cun.unit_name, cun.scope, ReadDebugInfo());
cun.namespaces.AddElement(cnn); cun.namespaces.AddElement(cnn);
@ -585,7 +611,7 @@ namespace PascalABCCompiler.PCU
pcu_file.compiler_directives = new List<compiler_directive>(); pcu_file.compiler_directives = new List<compiler_directive>();
for (int i = 0; i < num_directives; i++) for (int i = 0; i < num_directives; i++)
{ {
pcu_file.compiler_directives.Add(new compiler_directive(br.ReadString(),br.ReadString(),ReadDebugInfo())); pcu_file.compiler_directives.Add(new compiler_directive(br.ReadString(),br.ReadString(),ReadDebugInfo(), this.FileName));
} }
ReadAllAssemblies(); ReadAllAssemblies();
int num_imp_entity = br.ReadInt32(); int num_imp_entity = br.ReadInt32();
@ -989,45 +1015,17 @@ namespace PascalABCCompiler.PCU
} }
//получение импорт. типа //получение импорт. типа
private type_node ReadCommonExtType() private type_node ReadCommonExtType()
{ {
int pos = br.ReadInt32(); var pr = GetPCUReaderForUnitId(br.ReadInt32());
string s = pcu_file.incl_modules[pos]; return pr.GetTypeReference(br.ReadInt32());
PCUReader pr = (PCUReader)units[s];//вдруг этот модуль уже читается
if (pr == null)//это по моему чёс, так как все модули уже добавлены
{
pr = new PCUReader(this);//если нет, то создаем ридер
CompilationUnit cu = pr.GetCompilationUnit(dir + s + comp.CompilerOptions.CompiledUnitExtension, this.readDebugInfo);
type_node tn = pr.GetTypeReference(br.ReadInt32());
units[s] = pr;//добавляем в таблицу ридеров
return tn;
}
else
{
type_node tn = pr.GetTypeReference(br.ReadInt32());
return tn;
}
} }
//(ssyy) Получение шаблонного класса //(ssyy) Получение шаблонного класса
private template_class ReadTemplateExtClass() private template_class ReadTemplateExtClass()
{ {
int pos = br.ReadInt32(); var pr = GetPCUReaderForUnitId(br.ReadInt32());
string s = pcu_file.incl_modules[pos]; return pr.GetTemplateClass(br.ReadInt32());
PCUReader pr = (PCUReader)units[s];//вдруг этот модуль уже читается
if (pr == null)//это по моему чёс, так как все модули уже добавлены
{
pr = new PCUReader(this);//если нет, то создаем ридер
CompilationUnit cu = pr.GetCompilationUnit(dir + s + comp.CompilerOptions.CompiledUnitExtension, this.readDebugInfo);
template_class tc = pr.GetTemplateClass(br.ReadInt32());
units[s] = pr;//добавляем в таблицу ридеров
return tc;
}
else
{
template_class tc = pr.GetTemplateClass(br.ReadInt32());
return tc;
}
} }
//получение откомпил. типа //получение откомпил. типа
@ -1095,68 +1093,28 @@ namespace PascalABCCompiler.PCU
ext_members[offset] = ctn; ext_members[offset] = ctn;
br.BaseStream.Seek(tmp,SeekOrigin.Begin); br.BaseStream.Seek(tmp,SeekOrigin.Begin);
return ctn; return ctn;
} }
//получение импортируемой функции //получение импортируемой функции
private common_namespace_function_node ReadCommonExtNamespaceFunc() private common_namespace_function_node ReadCommonExtNamespaceFunc()
{ {
br.ReadByte(); br.ReadByte();
int pos = br.ReadInt32(); var pr = GetPCUReaderForUnitId(br.ReadInt32());
string s = pcu_file.incl_modules[pos]; return pr.GetNamespaceFunction(br.ReadInt32());
PCUReader pr = (PCUReader)units[s];
if (pr == null)
{
pr = new PCUReader(this);
CompilationUnit cu = pr.GetCompilationUnit(dir + s + comp.CompilerOptions.CompiledUnitExtension, this.readDebugInfo);
int offset = br.ReadInt32();
common_namespace_function_node cffn = pr.GetNamespaceFunction(offset);
return cffn;
}
else
{
common_namespace_function_node cffn = pr.GetNamespaceFunction(br.ReadInt32());
return cffn;
}
} }
private namespace_variable ReadExtNamespaceVariable() private namespace_variable ReadExtNamespaceVariable()
{ {
br.ReadByte(); br.ReadByte();
int pos = br.ReadInt32(); var pr = GetPCUReaderForUnitId(br.ReadInt32());
string s = pcu_file.incl_modules[pos]; return pr.GetNamespaceVariable(br.ReadInt32());
PCUReader pr = (PCUReader)units[s];
if (pr == null)
{
pr = new PCUReader(this);
CompilationUnit cu = pr.GetCompilationUnit(dir + s + comp.CompilerOptions.CompiledUnitExtension, this.readDebugInfo);
namespace_variable nv = pr.GetNamespaceVariable(br.ReadInt32());
return nv;
}
else
{
namespace_variable nv = pr.GetNamespaceVariable(br.ReadInt32());
return nv;
}
} }
private namespace_constant_definition ReadExtNamespaceConstant() private namespace_constant_definition ReadExtNamespaceConstant()
{ {
br.ReadByte(); br.ReadByte();
int pos = br.ReadInt32(); var pr = GetPCUReaderForUnitId(br.ReadInt32());
string s = pcu_file.incl_modules[pos]; return pr.GetConstantDefinition(br.ReadInt32());
PCUReader pr = (PCUReader)units[s];
if (pr == null)
{
pr = new PCUReader(this);
CompilationUnit cu = pr.GetCompilationUnit(dir + s + comp.CompilerOptions.CompiledUnitExtension, this.readDebugInfo);
namespace_constant_definition nv = pr.GetConstantDefinition(br.ReadInt32());
return nv;
}
else
{
namespace_constant_definition nv = pr.GetConstantDefinition(br.ReadInt32());
return nv;
}
} }
private common_namespace_event ReadCommonNamespaceExtEvent() private common_namespace_event ReadCommonNamespaceExtEvent()
@ -1166,22 +1124,9 @@ namespace PascalABCCompiler.PCU
int tmp = (int)br.BaseStream.Position; int tmp = (int)br.BaseStream.Position;
br.BaseStream.Seek(ext_pos + offset, SeekOrigin.Begin); br.BaseStream.Seek(ext_pos + offset, SeekOrigin.Begin);
br.ReadByte();//DS Changed br.ReadByte();//DS Changed
int pos = br.ReadInt32(); var pr = GetPCUReaderForUnitId(br.ReadInt32());
string s = pcu_file.incl_modules[pos];
PCUReader pr = (PCUReader)units[s];
br.BaseStream.Seek(tmp, SeekOrigin.Begin); br.BaseStream.Seek(tmp, SeekOrigin.Begin);
if (pr == null) return pr.GetNamespaceEventNode(br.ReadInt32());
{
pr = new PCUReader(this);
CompilationUnit cu = pr.GetCompilationUnit(dir + s + comp.CompilerOptions.CompiledUnitExtension, this.readDebugInfo);
common_namespace_event ev = pr.GetNamespaceEventNode(br.ReadInt32());
return ev;
}
else
{
common_namespace_event ev = pr.GetNamespaceEventNode(br.ReadInt32());
return ev;
}
} }
private common_event ReadCommonExtEvent() private common_event ReadCommonExtEvent()
@ -1191,22 +1136,9 @@ namespace PascalABCCompiler.PCU
int tmp = (int)br.BaseStream.Position; int tmp = (int)br.BaseStream.Position;
br.BaseStream.Seek(ext_pos + offset, SeekOrigin.Begin); br.BaseStream.Seek(ext_pos + offset, SeekOrigin.Begin);
br.ReadByte();//DS Changed br.ReadByte();//DS Changed
int pos = br.ReadInt32(); var pr = GetPCUReaderForUnitId(br.ReadInt32());
string s = pcu_file.incl_modules[pos];
PCUReader pr = (PCUReader)units[s];
br.BaseStream.Seek(tmp, SeekOrigin.Begin); br.BaseStream.Seek(tmp, SeekOrigin.Begin);
if (pr == null) return pr.GetEventNode(br.ReadInt32());
{
pr = new PCUReader(this);
CompilationUnit cu = pr.GetCompilationUnit(dir + s + comp.CompilerOptions.CompiledUnitExtension, this.readDebugInfo);
common_event ev = pr.GetEventNode(br.ReadInt32());
return ev;
}
else
{
common_event ev = pr.GetEventNode(br.ReadInt32());
return ev;
}
} }
private class_field ReadCommonExtField() private class_field ReadCommonExtField()
@ -1216,22 +1148,9 @@ namespace PascalABCCompiler.PCU
int tmp = (int)br.BaseStream.Position; int tmp = (int)br.BaseStream.Position;
br.BaseStream.Seek(ext_pos + offset, SeekOrigin.Begin); br.BaseStream.Seek(ext_pos + offset, SeekOrigin.Begin);
br.ReadByte();//DS Changed br.ReadByte();//DS Changed
int pos = br.ReadInt32(); var pr = GetPCUReaderForUnitId(br.ReadInt32());
string s = pcu_file.incl_modules[pos];
PCUReader pr = (PCUReader)units[s];
br.BaseStream.Seek(tmp, SeekOrigin.Begin); br.BaseStream.Seek(tmp, SeekOrigin.Begin);
if (pr == null) return pr.GetClassField(br.ReadInt32());
{
pr = new PCUReader(this);
CompilationUnit cu = pr.GetCompilationUnit(dir + s + comp.CompilerOptions.CompiledUnitExtension, this.readDebugInfo);
class_field field = pr.GetClassField(br.ReadInt32());
return field;
}
else
{
class_field field = pr.GetClassField(br.ReadInt32());
return field;
}
} }
private common_method_node ReadCommonExtMethod() private common_method_node ReadCommonExtMethod()
@ -1241,22 +1160,9 @@ namespace PascalABCCompiler.PCU
int tmp = (int)br.BaseStream.Position; int tmp = (int)br.BaseStream.Position;
br.BaseStream.Seek(ext_pos + offset, SeekOrigin.Begin); br.BaseStream.Seek(ext_pos + offset, SeekOrigin.Begin);
br.ReadByte();//DS Changed br.ReadByte();//DS Changed
int pos = br.ReadInt32(); var pr = GetPCUReaderForUnitId(br.ReadInt32());
string s = pcu_file.incl_modules[pos];
PCUReader pr = (PCUReader)units[s];
br.BaseStream.Seek(tmp, SeekOrigin.Begin); br.BaseStream.Seek(tmp, SeekOrigin.Begin);
if (pr == null) return pr.GetClassMethod(br.ReadInt32());
{
pr = new PCUReader(this);
CompilationUnit cu = pr.GetCompilationUnit(dir + s + comp.CompilerOptions.CompiledUnitExtension, this.readDebugInfo);
common_method_node meth = pr.GetClassMethod(br.ReadInt32());
return meth;
}
else
{
common_method_node meth = pr.GetClassMethod(br.ReadInt32());
return meth;
}
} }
private common_property_node ReadCommonExtProperty() private common_property_node ReadCommonExtProperty()
@ -1266,22 +1172,9 @@ namespace PascalABCCompiler.PCU
int tmp = (int)br.BaseStream.Position; int tmp = (int)br.BaseStream.Position;
br.BaseStream.Seek(ext_pos + offset, SeekOrigin.Begin); br.BaseStream.Seek(ext_pos + offset, SeekOrigin.Begin);
br.ReadByte();//DS Changed br.ReadByte();//DS Changed
int pos = br.ReadInt32(); var pr = GetPCUReaderForUnitId(br.ReadInt32());
string s = pcu_file.incl_modules[pos];
PCUReader pr = (PCUReader)units[s];
br.BaseStream.Seek(tmp, SeekOrigin.Begin); br.BaseStream.Seek(tmp, SeekOrigin.Begin);
if (pr == null) return pr.GetPropertyNode(br.ReadInt32());
{
pr = new PCUReader(this);
CompilationUnit cu = pr.GetCompilationUnit(dir + s + comp.CompilerOptions.CompiledUnitExtension, this.readDebugInfo);
common_property_node prop = pr.GetPropertyNode(br.ReadInt32());
return prop;
}
else
{
common_property_node prop = pr.GetPropertyNode(br.ReadInt32());
return prop;
}
} }
//получение типа, описанного в этом модуле (может вызываться извне) //получение типа, описанного в этом модуле (может вызываться извне)
@ -2524,7 +2417,7 @@ namespace PascalABCCompiler.PCU
//Добавляем подключенные модули //Добавляем подключенные модули
for (int i = 0; i < uses_count; i++) for (int i = 0; i < uses_count; i++)
{ {
PCUReader pcu_r = units[pcu_file.incl_modules[i]] as PCUReader; PCUReader pcu_r = units[GetFullUnitName(pcu_file.incl_modules[i])] as PCUReader;
if (pcu_r != null) if (pcu_r != null)
{ {
top_scopes.Add(pcu_r.cun.scope); top_scopes.Add(pcu_r.cun.scope);

View file

@ -8,7 +8,8 @@ using TreeConverter;
using PascalABCCompiler.TreeConverter; using PascalABCCompiler.TreeConverter;
using PascalABCCompiler.TreeRealization; using PascalABCCompiler.TreeRealization;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
namespace PascalABCCompiler.PCU namespace PascalABCCompiler.PCU
{ {
public class PCUConsts public class PCUConsts
@ -213,7 +214,7 @@ namespace PascalABCCompiler.PCU
private List<string> ref_assemblies = new List<string>();//список подключаемых сборок, заполняется в процессе private List<string> ref_assemblies = new List<string>();//список подключаемых сборок, заполняется в процессе
private Dictionary<Assembly,int> assm_refs = new Dictionary<Assembly,int>();//таблица для привязывания сборки private Dictionary<Assembly,int> assm_refs = new Dictionary<Assembly,int>();//таблица для привязывания сборки
private Dictionary<definition_node, int> func_codes = new Dictionary<definition_node, int>();//таблица, хранящая смещения тел методов в PCU private Dictionary<definition_node, int> func_codes = new Dictionary<definition_node, int>();//таблица, хранящая смещения тел методов в PCU
private Dictionary<definition_node, int> used_units = new Dictionary<definition_node, int>(); private Dictionary<common_unit_node, int> used_units = new Dictionary<common_unit_node, int>();
private Dictionary<definition_node,ImportedEntity> ext_members = new Dictionary<definition_node,ImportedEntity>();//таблица, привязывающая импорт. сущность с записью в списке имп. сущ-тей private Dictionary<definition_node,ImportedEntity> ext_members = new Dictionary<definition_node,ImportedEntity>();//таблица, привязывающая импорт. сущность с записью в списке имп. сущ-тей
private common_namespace_node cur_cnn;//текущее пространство имен private common_namespace_node cur_cnn;//текущее пространство имен
private bool is_interface = true;//переводим ли интерфейсную часть private bool is_interface = true;//переводим ли интерфейсную часть
@ -876,12 +877,15 @@ namespace PascalABCCompiler.PCU
if (tn is common_type_node) if (tn is common_type_node)
{ {
common_namespace_node comp_cnn = (tn as common_type_node).comprehensive_namespace; common_namespace_node comp_cnn = (tn as common_type_node).comprehensive_namespace;
if (comp_cnn != null && !ns_dict.ContainsKey(comp_cnn)) if (comp_cnn != null && !ns_dict.ContainsKey(comp_cnn) && unit.SemanticTree != comp_cnn.cont_unit)
{ {
var path = Compiler.GetUnitPath(unit, compiler.UnitsSortedList.Find(u => u.SemanticTree == comp_cnn.cont_unit));
if (interf) if (interf)
unit.InterfaceUsedUnits.AddElement(comp_cnn.cont_unit); unit.InterfaceUsedUnits.AddElement(comp_cnn.cont_unit, path);
else else
unit.ImplementationUsedUnits.AddElement(comp_cnn.cont_unit); unit.ImplementationUsedUnits.AddElement(comp_cnn.cont_unit, path);
ns_dict[comp_cnn] = true; ns_dict[comp_cnn] = true;
} }
if (tn.base_type is common_type_node) if (tn.base_type is common_type_node)
@ -1034,79 +1038,52 @@ namespace PascalABCCompiler.PCU
//заполнение списка подключаемых модулей //заполнение списка подключаемых модулей
private void GetUsedUnits() private void GetUsedUnits()
{ {
int num = 0;
common_unit_node unt = null;
AddIndirectInteraceUsedUnits(); AddIndirectInteraceUsedUnits();
AddIndirectImplementationUsedUnits(); AddIndirectImplementationUsedUnits();
for (int j = 0; j < unit.InterfaceUsedUnits.Count; j++)
var c1 = unit.InterfaceUsedUnits.unit_uses_paths.Count;
var c2 = unit.ImplementationUsedUnits.unit_uses_paths.Count;
pcu_file.interface_uses_count = c1;
var incl_modules = new List<string>(c1 + c2);
foreach (var used_unit in unit.InterfaceUsedUnits.OfType<common_unit_node>())
{ {
unt = unit.InterfaceUsedUnits[j] as common_unit_node; // Каждый модуль, зачем то, подключён сам к себе
if (unt == null) continue; // Конечно, записи в unit_uses_paths для такого подключения - нет
if (unt.namespaces.Count != 0) if (unit.SemanticTree == used_unit) continue;
num += 1;//unt.namespaces.Count;
// AddIndirectInteraceUsedUnits может добавлять один и тот же модуль несколько раз
if (used_units.ContainsKey(used_unit)) continue;
// раньше вместо пути модуля - брало имя его первого пространства имён
// и сразу стояла эта проверка. Если будет тут вылетать - наверное надо заменить throw на continue
if (used_unit.namespaces.Count == 0) throw new InvalidOperationException();
this.used_units.Add(used_unit, used_units.Count);
incl_modules.Add(unit.InterfaceUsedUnits.unit_uses_paths[used_unit]);
} }
for (int j = 0; j < unit.ImplementationUsedUnits.Count; j++) foreach (var used_unit in unit.ImplementationUsedUnits.OfType<common_unit_node>())
{ {
unt = unit.ImplementationUsedUnits[j] as common_unit_node; if (unit.SemanticTree == used_unit) continue;
if (unt == null) continue; if (used_units.ContainsKey(used_unit)) continue;
if (unt.namespaces.Count != 0) if (used_unit.namespaces.Count == 0) throw new InvalidOperationException();
num += 1;//unt.namespaces.Count;
this.used_units.Add(used_unit, used_units.Count);
incl_modules.Add(unit.ImplementationUsedUnits.unit_uses_paths[used_unit]);
} }
pcu_file.incl_modules = new string[num];
int i = 0; num = 0;
for (i=0; i<unit.InterfaceUsedUnits.Count; i++)
{
unt = unit.InterfaceUsedUnits[i] as common_unit_node;
if (unt == null) continue;
if (unt.namespaces.Count != 0)
{
pcu_file.incl_modules[num] = unt.namespaces[0].namespace_name;
used_units[unt.namespaces[0]] = num;
num++;
/*if (unt.namespaces.Count > 1)
{
pcu_file.incl_modules[num] = unt.namespaces[1].namespace_name;
used_units[unt.namespaces[1]] = num;
num++;
}*/
}
}
//(ssyy) Запомнили, какие модули относятся к секции interface used_units.Add(unit.SemanticTree as common_unit_node, -1);
pcu_file.interface_uses_count = num;
for (int j=0; j<unit.ImplementationUsedUnits.Count; j++) pcu_file.incl_modules = incl_modules.ToArray();
{ pcu_file.used_namespaces = cun.used_namespaces.ToArray();
unt = unit.ImplementationUsedUnits[j] as common_unit_node;
if (unt == null) continue;
if (unt.namespaces.Count != 0)
{
pcu_file.incl_modules[num] = unt.namespaces[0].namespace_name;
used_units[unt.namespaces[0]] = num;
num++;
/*if (unt.namespaces.Count > 1)
{
pcu_file.incl_modules[num] = unt.namespaces[1].namespace_name;
used_units[unt.namespaces[1]] = num;
num++;
}*/
}
}
pcu_file.used_namespaces = cun.used_namespaces.ToArray();
} }
//получения индекса модуля в списке подключ. модулей //получения индекса модуля в списке подключ. модулей
private int GetUnitToken(common_namespace_node ns) private int GetUnitToken(common_namespace_node ns)
{ {
int tok = 0; return used_units[ns.cont_unit as common_unit_node];
if (!used_units.TryGetValue(ns,out tok))
{
return used_units[(ns.cont_unit as common_unit_node).namespaces[0]];
}
return tok;
} }
private int GetTokenForNetEntity(FieldInfo val) private int GetTokenForNetEntity(FieldInfo val)
@ -1728,7 +1705,7 @@ namespace PascalABCCompiler.PCU
is_def = 1; is_def = 1;
return off;//возвращаем его смещение return off;//возвращаем его смещение
} }
if (!used_units.ContainsKey(nv.namespace_node)) if (!used_units.ContainsKey(nv.namespace_node.cont_unit as common_unit_node))
{ {
is_def = 1; is_def = 1;
return -1; return -1;
@ -1758,7 +1735,7 @@ namespace PascalABCCompiler.PCU
is_def = 1; is_def = 1;
return off;//возвращаем его смещение return off;//возвращаем его смещение
} }
if (!used_units.ContainsKey(nv.comprehensive_namespace)) if (!used_units.ContainsKey(nv.comprehensive_namespace.cont_unit as common_unit_node))
{ {
is_def = 1; is_def = 1;
return -1; return -1;

View file

@ -11288,6 +11288,9 @@ namespace PascalABCCompiler.SyntaxTree
} }
} }
// имя модуля в случае обычного uses
// или путь к модулю в случае uses-in
public virtual string UsesPath() => name.idents[0].name;
/// <summary> Создает копию узла </summary> /// <summary> Создает копию узла </summary>
public override syntax_tree_node Clone() public override syntax_tree_node Clone()
@ -11456,9 +11459,10 @@ namespace PascalABCCompiler.SyntaxTree
if (_in_file != null) if (_in_file != null)
_in_file.Parent = this; _in_file.Parent = this;
} }
} }
public override string UsesPath() => in_file.Value;
/// <summary> Создает копию узла </summary> /// <summary> Создает копию узла </summary>
public override syntax_tree_node Clone() public override syntax_tree_node Clone()
{ {

View file

@ -1,3 +1,5 @@
unit u2; unit u2;
{$savepcu false}
end. end.

View file

@ -1,7 +1,10 @@
unit u1; unit u1;
{$savepcu false}
uses u2 in '2\u2.pas'; uses u2 in '2\u2.pas';
uses u3; uses u3;
uses u4;
{$include test.h} {$include test.h}

View file

@ -1,3 +1,5 @@
unit u3; unit u3;
{$savepcu false}
end. end.

View file

@ -1,5 +1,7 @@
unit u4; unit u4;
{$savepcu false}
{$include test.h} {$include test.h}
begin begin

View file

@ -1,5 +1,7 @@
unit u0; unit u0;
{$savepcu false}
uses u1; uses u1;
uses u2 in '..\UsesInUnits2_F2\u2.pas'; uses u2 in '..\UsesInUnits2_F2\u2.pas';

View file

@ -1,3 +1,5 @@
unit u1; unit u1;
{$savepcu false}
end. end.

View file

@ -1,3 +1,5 @@
unit u2; unit u2;
{$savepcu false}
end. end.

View file

@ -0,0 +1 @@
abc

View file

@ -0,0 +1,10 @@
unit u;
{$savepcu false}
{$resource '1.txt'}
{$reference 'uui3_lib.dll'}
begin
Assert('abc' = System.IO.StreamReader.Create(GetResourceStream('1.txt')).ReadToEnd);
end.

Binary file not shown.

View file

@ -0,0 +1,3 @@
library uui3_lib;
end.

View file

@ -0,0 +1,12 @@
unit u2;
{$savepcu false}
interface
implementation
uses uses_in4_cycle_uses in '..\uses_in4_cycle_uses';
end.

View file

@ -0,0 +1,3 @@
uses u1 in 'UsesInUnits\u1.pas';
begin end.

View file

@ -0,0 +1,3 @@
uses u0 in 'UsesInUnits2\u0.pas';
begin end.

View file

@ -0,0 +1,3 @@
uses u in 'UsesInUnits3\u';
begin end.

View file

@ -0,0 +1,12 @@
unit uses_in4_cycle_uses;
{$savepcu false}
interface
uses u2 in 'UsesInUnits4\u2';
implementation
end.

View file

@ -10926,7 +10926,7 @@ namespace PascalABCCompiler.TreeConverter
System.Collections.Generic.List<compiler_directive> list = new System.Collections.Generic.List<compiler_directive>(); System.Collections.Generic.List<compiler_directive> list = new System.Collections.Generic.List<compiler_directive>();
foreach (SyntaxTree.compiler_directive sncd in cu.compiler_directives) foreach (SyntaxTree.compiler_directive sncd in cu.compiler_directives)
{ {
list.Add(new compiler_directive(sncd.Name.text, sncd.Directive!=null?sncd.Directive.text:"", get_location(sncd))); list.Add(new compiler_directive(sncd.Name.text, sncd.Directive!=null?sncd.Directive.text:"", get_location(sncd), cu.file_name));
} }
return list; return list;
} }

View file

@ -1,9 +1,9 @@
// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt) // Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) // This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System; using System;
using System.Collections.Generic;
using PascalABCCompiler.Collections; using PascalABCCompiler.Collections;
namespace PascalABCCompiler.TreeRealization namespace PascalABCCompiler.TreeRealization
{ {
/// <summary> /// <summary>
@ -104,7 +104,28 @@ namespace PascalABCCompiler.TreeRealization
/// </summary> /// </summary>
[Serializable] [Serializable]
public class unit_node_list : extended_collection<unit_node> public class unit_node_list : extended_collection<unit_node>
{ {
public Dictionary<unit_node, string> unit_uses_paths = new Dictionary<unit_node, string>();
public new void AddElement(unit_node unit)
{
throw new InvalidOperationException("Use second overload of \"unit_node_list.AddElement\"");
}
/// <summary>
/// Adds element to the "uses" list
/// </summary>
/// <param name="unit">Element to add. Can be unit, namespace, .dll reference, etc.</param>
/// <param name="unit_uses_path">Path to unit. Can be relative string, null for non-pascal_unit's</param>
/// <returns>Returns true if new pascal unit (not .dll, namespace, etc.) was added</returns>
public bool AddElement(unit_node unit, string unit_uses_path)
{
if (unit_uses_paths.ContainsKey(unit)) return false;
base.AddElement(unit);
if (unit_uses_path != null) unit_uses_paths.Add(unit, unit_uses_path);
return true;
}
} }
/// <summary> /// <summary>

View file

@ -10,12 +10,15 @@ namespace PascalABCCompiler.TreeRealization
{ {
public string name; public string name;
public string directive; public string directive;
public location location; public location location;
public compiler_directive(string name,string directive,location loc) public string source_file; // Файл из которого загрузили директиву. В отличии от location - может указывать на .pcu
public compiler_directive(string name, string directive, location loc, string source_file)
{ {
this.name = name; this.name = name;
this.directive = directive; this.directive = directive;
this.location = loc; this.location = loc;
this.source_file = source_file;
} }
} }
} }

View file

@ -89,7 +89,7 @@ namespace PascalABCCompiler.TreeRealization
} }
[Serializable] [Serializable]
public class common_unit_node : unit_node public sealed class common_unit_node : unit_node
{ {
private readonly common_namespace_node_list _namespaces = new common_namespace_node_list(); private readonly common_namespace_node_list _namespaces = new common_namespace_node_list();
@ -100,7 +100,7 @@ namespace PascalABCCompiler.TreeRealization
private common_namespace_function_node _main_function; private common_namespace_function_node _main_function;
private common_namespace_function_node _finalization_method; private common_namespace_function_node _finalization_method;
private string _unit_name; public string unit_name { get; set; }
internal common_parameter MainArgsParameter = null; internal common_parameter MainArgsParameter = null;
internal expression_node MainArgsAssignExpr = null; internal expression_node MainArgsAssignExpr = null;
@ -154,7 +154,7 @@ namespace PascalABCCompiler.TreeRealization
public common_unit_node(string name) public common_unit_node(string name)
{ {
_unit_name = name; this.unit_name = name;
} }
public void add_unit_name_to_namespace() public void add_unit_name_to_namespace()
@ -162,18 +162,6 @@ namespace PascalABCCompiler.TreeRealization
this.scope.AddSymbol(unit_name, new TreeConverter.SymbolInfo(this)); this.scope.AddSymbol(unit_name, new TreeConverter.SymbolInfo(this));
} }
public string unit_name
{
get
{
return _unit_name;
}
set
{
_unit_name = value;
}
}
public common_namespace_function_node main_function public common_namespace_function_node main_function
{ {
get get

View file

@ -18,6 +18,7 @@ FILE_{0}_NOT_FOUND=File '{0}' not found
NAMESPACE_CAN_BE_COMPILED_ONLY_IN_PROJECTS=Files with namespaces can be compiled only inside projects NAMESPACE_CAN_BE_COMPILED_ONLY_IN_PROJECTS=Files with namespaces can be compiled only inside projects
NAMESPACE_CANNOT_HAVE_IN_SECTION=Namespace cannot have 'in' section NAMESPACE_CANNOT_HAVE_IN_SECTION=Namespace cannot have 'in' section
APPTYPE_DLL_IS_ALLOWED_ONLY_FOR_LIBRARIES= {$apptype dll} directive is allowed only for libraries APPTYPE_DLL_IS_ALLOWED_ONLY_FOR_LIBRARIES= {$apptype dll} directive is allowed only for libraries
USES_IN_WRONG_NAME=Unit name in uses-in ({0}) must be same as file name ({1})
%PREFIX%= %PREFIX%=
COMPILER_INTERNAL_ERROR_IN_UNIT_{0}_:{1}=Internal compiler error in module {0} :'{1}' COMPILER_INTERNAL_ERROR_IN_UNIT_{0}_:{1}=Internal compiler error in module {0} :'{1}'

View file

@ -18,6 +18,7 @@ NAMESPACE_CAN_BE_COMPILED_ONLY_IN_PROJECTS=Компиляция файлов с
FILE_{0}_NOT_FOUND=Файл '{0}' не найден FILE_{0}_NOT_FOUND=Файл '{0}' не найден
NAMESPACE_CANNOT_HAVE_IN_SECTION=Для пространства имен не может указываться секция in NAMESPACE_CANNOT_HAVE_IN_SECTION=Для пространства имен не может указываться секция in
APPTYPE_DLL_IS_ALLOWED_ONLY_FOR_LIBRARIES=Директива {$apptype dll} возможна только для библиотек APPTYPE_DLL_IS_ALLOWED_ONLY_FOR_LIBRARIES=Директива {$apptype dll} возможна только для библиотек
USES_IN_WRONG_NAME=Имя модуля в uses-in ({0}) должно совпадать с именем файла ({1})
%PREFIX%= %PREFIX%=
COMPILER_INTERNAL_ERROR_IN_UNIT_{0}_:{1}=Внутренняя ошибка компилятора в модуле {0} :'{1}' COMPILER_INTERNAL_ERROR_IN_UNIT_{0}_:{1}=Внутренняя ошибка компилятора в модуле {0} :'{1}'

View file

@ -16,6 +16,7 @@ MAINRESOURCE_NOT_ALLOWED=Неприпустимо сумісне викорис
DUPLICATE_DIRECTIVE{0}=Повторное объявление директивы {0} DUPLICATE_DIRECTIVE{0}=Повторное объявление директивы {0}
FILE_{0}_NOT_FOUND=Файл '{0}' не знайдено FILE_{0}_NOT_FOUND=Файл '{0}' не знайдено
NAMESPACE_CAN_BE_COMPILED_ONLY_IN_PROJECTS=Компиляция файлов с пространствами имен допустима только в проектах NAMESPACE_CAN_BE_COMPILED_ONLY_IN_PROJECTS=Компиляция файлов с пространствами имен допустима только в проектах
USES_IN_WRONG_NAME=Ім'я модуля в uses-in ({0}) має збігатися з ім'ям файлу ({1})
%PREFIX%= %PREFIX%=
COMPILER_INTERNAL_ERROR_IN_UNIT_{0}_:{1}=Внутрішня помилка компілятора в модулі {0} :'{1}' COMPILER_INTERNAL_ERROR_IN_UNIT_{0}_:{1}=Внутрішня помилка компілятора в модулі {0} :'{1}'