bug fix #261
This commit is contained in:
parent
2e9800d98d
commit
95179ff92c
|
|
@ -260,6 +260,16 @@ namespace PascalABCCompiler
|
|||
|
||||
}
|
||||
|
||||
public class MainResourceNotAllowed : CompilerCompilationError
|
||||
{
|
||||
public MainResourceNotAllowed(TreeRealization.location sl)
|
||||
: base(string.Format(StringResources.Get("COMPILATIONERROR_MAINRESOURCE_NOT_ALLOWED")), sl.doc.file_name)
|
||||
{
|
||||
this.sourceLocation = new SourceLocation(sl.doc.file_name, sl.begin_line_num, sl.begin_column_num, sl.end_line_num, sl.end_column_num);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class DuplicateUsesUnit : CompilerCompilationError
|
||||
{
|
||||
public string UnitName;
|
||||
|
|
@ -1852,6 +1862,13 @@ namespace PascalABCCompiler
|
|||
}
|
||||
if (compilerDirectives.TryGetValue(TreeConverter.compiler_string_consts.main_resource_string, out cds))
|
||||
{
|
||||
if (compilerDirectives.ContainsKey(TreeConverter.compiler_string_consts.product_string) ||
|
||||
compilerDirectives.ContainsKey(TreeConverter.compiler_string_consts.version_string) ||
|
||||
compilerDirectives.ContainsKey(TreeConverter.compiler_string_consts.company_string) ||
|
||||
compilerDirectives.ContainsKey(TreeConverter.compiler_string_consts.trademark_string))
|
||||
{
|
||||
ErrorsList.Add(new MainResourceNotAllowed(cds[0].location));
|
||||
}
|
||||
cdo.MainResourceFileName = cds[0].directive;
|
||||
if (!File.Exists(cdo.MainResourceFileName))
|
||||
{
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -12,6 +12,7 @@ CYCLIC_UNIT_REFERENCE_WITH_UNIT_{0}=Cyclic unit reference with unit '{0}'
|
|||
UNDEFINED_SEMANTIC_ERROR{0}=Undefined semantic error : {0}
|
||||
RESOURCEFILE_{0}_NOT_FOUND=Resource file '{0}' not found
|
||||
DUPLICATE_USES_UNIT{0}=Duplicate identifier '{0}' in uses section
|
||||
MAINRESOURCE_NOT_ALLOWED=mainresource can not be used with the directives: product, version, company, trademark
|
||||
|
||||
%PREFIX%=
|
||||
COMPILER_INTERNAL_ERROR_IN_UNIT_{0}_:{1}=Internal compiler error in module {0} :'{1}'
|
||||
|
|
@ -12,6 +12,7 @@ CYCLIC_UNIT_REFERENCE_WITH_UNIT_{0}=Циклическая связь с мод
|
|||
UNDEFINED_SEMANTIC_ERROR{0}=Неопределенная семантическая ошибка : {0}
|
||||
RESOURCEFILE_{0}_NOT_FOUND=Файл '{0}' не найден
|
||||
DUPLICATE_USES_UNIT{0}=Повторное подключение модуля {0} в секции uses
|
||||
MAINRESOURCE_NOT_ALLOWED=Недопустимо совместное использование директивы mainresource и директив product, version, company, trademark
|
||||
|
||||
%PREFIX%=
|
||||
COMPILER_INTERNAL_ERROR_IN_UNIT_{0}_:{1}=Внутренняя ошибка компилятора в модуле {0} :'{1}'
|
||||
Loading…
Reference in a new issue