Что-то не то с форматтером. Тесты не проходят
This commit is contained in:
parent
582c487951
commit
808882771d
|
|
@ -671,6 +671,9 @@ namespace CodeFormatters
|
|||
|
||||
#region IVisitor Member
|
||||
|
||||
public override void visit(syntax_tree_node n)
|
||||
{ }
|
||||
|
||||
public override void visit(statement_list _statement_list)
|
||||
{
|
||||
bool tmp_init_part = false;
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ internal static class RevisionClass
|
|||
public const string Major = "2";
|
||||
public const string Minor = "2";
|
||||
public const string Build = "0";
|
||||
public const string Revision = "990";
|
||||
public const string Revision = "993";
|
||||
|
||||
public const string MainVersion = Major + "." + Minor;
|
||||
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
%MINOR%=2
|
||||
%REVISION%=990
|
||||
%REVISION%=993
|
||||
%MAJOR%=2
|
||||
%COREVERSION%=0
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
!define VERSION '2.2.0.990'
|
||||
!define VERSION '2.2.0.993'
|
||||
Binary file not shown.
File diff suppressed because it is too large
Load diff
|
|
@ -82,7 +82,13 @@ namespace PascalABCCompiler.SyntaxTree
|
|||
}
|
||||
|
||||
//-- List members begin
|
||||
public List<statement> list => subnodes;
|
||||
public List<statement> list
|
||||
{
|
||||
get
|
||||
{
|
||||
return subnodes;
|
||||
}
|
||||
}
|
||||
|
||||
public void AddMany(params statement[] els)
|
||||
{
|
||||
|
|
@ -247,7 +253,10 @@ namespace PascalABCCompiler.SyntaxTree
|
|||
return this;
|
||||
}
|
||||
//-- List members begin
|
||||
public List<var_def_statement> list => var_definitions;
|
||||
public List<var_def_statement> list
|
||||
{
|
||||
get { return var_definitions; }
|
||||
}
|
||||
|
||||
public void AddMany(params var_def_statement[] sts)
|
||||
{
|
||||
|
|
@ -309,7 +318,10 @@ namespace PascalABCCompiler.SyntaxTree
|
|||
return sb.ToString();
|
||||
}
|
||||
//-- List members begin
|
||||
public List<ident> list => idents;
|
||||
public List<ident> list
|
||||
{
|
||||
get { return idents; }
|
||||
}
|
||||
|
||||
public void AddMany(params ident[] els)
|
||||
{
|
||||
|
|
@ -1289,4 +1301,12 @@ namespace PascalABCCompiler.SyntaxTree
|
|||
return "yield " + ex.ToString();
|
||||
}
|
||||
}
|
||||
public partial class sequence_type
|
||||
{
|
||||
public override string ToString()
|
||||
{
|
||||
return "sequence of " + this.elements_type.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -194,6 +194,7 @@ namespace NodeGenerator
|
|||
public static readonly string throw_keyword = "throw";
|
||||
public static readonly string index_out_of_range_exception_name = "IndexOutOfRangeException";
|
||||
public static readonly string subnodes_property_name = "subnodes_count";
|
||||
public static readonly string subnodes_without_list_elements_property_name = "subnodes_without_list_elements_count";
|
||||
public static readonly string object_keyword = "object";
|
||||
public static readonly string syntax_tree_node_name = "syntax_tree_node";
|
||||
public static readonly string or_keyword = "||";
|
||||
|
|
@ -998,9 +999,6 @@ namespace NodeGenerator
|
|||
var subnodes = collect_subnodes(true);
|
||||
var fieldsCount = subnodes.Count(ni=>ni.field_type!=null); // â èíäåêñàòîðå ó÷èòûâàòü òîëüêî syntax_tree_node SSM 27/07/15
|
||||
|
||||
sw.WriteLine(@" ///<summary>");
|
||||
sw.WriteLine(@" ///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List");
|
||||
sw.WriteLine(@" ///</summary>");
|
||||
string pol_type = "";
|
||||
if (base_class != null)
|
||||
{
|
||||
|
|
@ -1026,6 +1024,28 @@ namespace NodeGenerator
|
|||
text_consts.colon + text_consts.space + listField.field_name + text_consts.dot + text_consts.count_name + text_consts.close_par);
|
||||
}
|
||||
|
||||
sw.WriteLine(@" ///<summary>");
|
||||
sw.WriteLine(@" ///Ñâîéñòâî äëÿ ïîëó÷åíèÿ êîëè÷åñòâà âñåõ ïîäóçëîâ áåç ýëåìåíòîâ ïîëÿ òèïà List");
|
||||
sw.WriteLine(@" ///</summary>");
|
||||
// subnodes_without_list_elements_count
|
||||
sw.WriteLine(text_consts.tab + text_consts.tab + text_consts.public_keyword + text_consts.space +
|
||||
pol_type + text_consts.space +
|
||||
text_consts.int32_type_name + text_consts.space + text_consts.subnodes_without_list_elements_property_name);
|
||||
|
||||
sw.WriteLine(text_consts.tab + text_consts.tab + text_consts.open_figure);
|
||||
|
||||
sw.WriteLine(text_consts.tab + text_consts.tab + text_consts.tab + text_consts.get_keyword);
|
||||
sw.WriteLine(text_consts.tab + text_consts.tab + text_consts.tab + text_consts.open_figure);
|
||||
sw.WriteLine(text_consts.tab + text_consts.tab + text_consts.tab + text_consts.tab +
|
||||
text_consts.return_keyword + text_consts.space + fieldsCount + text_consts.semicolon);
|
||||
sw.WriteLine(text_consts.tab + text_consts.tab + text_consts.tab + text_consts.close_figure);
|
||||
|
||||
sw.WriteLine(text_consts.tab + text_consts.tab + text_consts.close_figure);
|
||||
|
||||
sw.WriteLine(@" ///<summary>");
|
||||
sw.WriteLine(@" ///Ñâîéñòâî äëÿ ïîëó÷åíèÿ êîëè÷åñòâà âñåõ ïîäóçëîâ. Ïîäóçëîì òàêæå ñ÷èòàåòñÿ êàæäûé ýëåìåíò ïîëÿ òèïà List");
|
||||
sw.WriteLine(@" ///</summary>");
|
||||
// subnodes_count
|
||||
sw.WriteLine(text_consts.tab + text_consts.tab + text_consts.public_keyword + text_consts.space +
|
||||
pol_type + text_consts.space +
|
||||
text_consts.int32_type_name + text_consts.space + text_consts.subnodes_property_name);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0">
|
||||
<PropertyGroup>
|
||||
<ProjectType>Local</ProjectType>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
|
|
@ -27,7 +27,7 @@
|
|||
<UpgradeBackupLocation>
|
||||
</UpgradeBackupLocation>
|
||||
<OldToolsVersion>3.5</OldToolsVersion>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile />
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<PublishUrl>опубликовать\</PublishUrl>
|
||||
|
|
@ -67,6 +67,7 @@
|
|||
<WarningLevel>4</WarningLevel>
|
||||
<DebugType>full</DebugType>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
|
|
@ -90,6 +91,7 @@
|
|||
<WarningLevel>4</WarningLevel>
|
||||
<DebugType>none</DebugType>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Irony, Version=1.0.0.0, Culture=neutral, PublicKeyToken=ca48ace7223ead47, processorArchitecture=MSIL">
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -1,10 +1,10 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.296
|
||||
// Этот код создан программой.
|
||||
// Исполняемая версия:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
|
||||
// повторной генерации кода.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
|
@ -13,12 +13,12 @@ namespace NodesGenerator.Properties {
|
|||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// Класс ресурса со строгой типизацией для поиска локализованных строк и т.д.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
// Этот класс создан автоматически классом StronglyTypedResourceBuilder
|
||||
// с помощью такого средства, как ResGen или Visual Studio.
|
||||
// Чтобы добавить или удалить член, измените файл .ResX и снова запустите ResGen
|
||||
// с параметром /str или перестройте свой проект VS.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
|
|
@ -33,7 +33,7 @@ namespace NodesGenerator.Properties {
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// Возвращает кэшированный экземпляр ResourceManager, использованный этим классом.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
|
|
@ -47,8 +47,8 @@ namespace NodesGenerator.Properties {
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// Перезаписывает свойство CurrentUICulture текущего потока для всех
|
||||
/// обращений к ресурсу с помощью этого класса ресурса со строгой типизацией.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
<?xml version="1.0"?>
|
||||
<configuration>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
|
||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2"/></startup></configuration>
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
|
|
@ -261,35 +261,40 @@ end;
|
|||
|
||||
begin
|
||||
//DeletePABCSystemPCU;
|
||||
TestSuiteDir := GetTestSuiteDir;
|
||||
System.Environment.CurrentDirectory := Path.GetDirectoryName(GetEXEFileName());
|
||||
DeletePCUFiles;
|
||||
ClearExeDir;
|
||||
CompileAllRunTests(false);
|
||||
CopyLibFiles;
|
||||
CompileAllCompilationTests('CompilationSamples',false);
|
||||
CompileAllUnits;
|
||||
CopyPCUFiles;
|
||||
CompileAllUsesUnits;
|
||||
CompileErrorTests(false);
|
||||
writeln('Tests compiled successfully');
|
||||
RunAllTests(false);
|
||||
writeln('Tests run successfully');
|
||||
ClearExeDir;
|
||||
DeletePCUFiles;
|
||||
CompileAllRunTests(true);
|
||||
writeln('Tests with pabcrtl compiled successfully');
|
||||
CompileAllCompilationTests('pabcrtl_tests',true);
|
||||
RunAllTests(false);
|
||||
writeln('Tests with pabcrtl run successfully');
|
||||
ClearExeDir;
|
||||
CompileAllRunTests(false, true);
|
||||
writeln('Tests in 32bit mode compiled successfully');
|
||||
RunAllTests(false);
|
||||
writeln('Tests in 32bit run successfully');
|
||||
System.Environment.CurrentDirectory := Path.GetDirectoryName(GetEXEFileName());
|
||||
RunExpressionsExtractTests;
|
||||
writeln('Intellisense expression tests run successfully');
|
||||
RunFormatterTests;
|
||||
writeln('Formatter tests run successfully');
|
||||
try
|
||||
TestSuiteDir := GetTestSuiteDir;
|
||||
System.Environment.CurrentDirectory := Path.GetDirectoryName(GetEXEFileName());
|
||||
DeletePCUFiles;
|
||||
ClearExeDir;
|
||||
CompileAllRunTests(false);
|
||||
CopyLibFiles;
|
||||
CompileAllCompilationTests('CompilationSamples',false);
|
||||
CompileAllUnits;
|
||||
CopyPCUFiles;
|
||||
CompileAllUsesUnits;
|
||||
CompileErrorTests(false);
|
||||
writeln('Tests compiled successfully');
|
||||
RunAllTests(false);
|
||||
writeln('Tests run successfully');
|
||||
ClearExeDir;
|
||||
DeletePCUFiles;
|
||||
CompileAllRunTests(true);
|
||||
writeln('Tests with pabcrtl compiled successfully');
|
||||
CompileAllCompilationTests('pabcrtl_tests',true);
|
||||
RunAllTests(false);
|
||||
writeln('Tests with pabcrtl run successfully');
|
||||
ClearExeDir;
|
||||
CompileAllRunTests(false, true);
|
||||
writeln('Tests in 32bit mode compiled successfully');
|
||||
RunAllTests(false);
|
||||
writeln('Tests in 32bit run successfully');
|
||||
System.Environment.CurrentDirectory := Path.GetDirectoryName(GetEXEFileName());
|
||||
RunExpressionsExtractTests;
|
||||
writeln('Intellisense expression tests run successfully');
|
||||
RunFormatterTests;
|
||||
writeln('Formatter tests run successfully');
|
||||
except
|
||||
on e: Exception do
|
||||
WriteAllText('d:\err.txt',e.ToString());
|
||||
end;
|
||||
end.
|
||||
Loading…
Reference in a new issue