This commit is contained in:
Mikhalkovich Stanislav 2018-12-14 16:33:59 +03:00
parent 1dbf625c33
commit 288e9e8751
10 changed files with 17 additions and 6 deletions

View file

@ -15,7 +15,7 @@ internal static class RevisionClass
public const string Major = "3"; public const string Major = "3";
public const string Minor = "4"; public const string Minor = "4";
public const string Build = "2"; public const string Build = "2";
public const string Revision = "1895"; public const string Revision = "1896";
public const string MainVersion = Major + "." + Minor; public const string MainVersion = Major + "." + Minor;
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision; public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;

View file

@ -1,4 +1,4 @@
%COREVERSION%=2
%REVISION%=1895
%MINOR%=4 %MINOR%=4
%REVISION%=1896
%COREVERSION%=2
%MAJOR%=3 %MAJOR%=3

Binary file not shown.

View file

@ -1 +1 @@
!define VERSION '3.4.2.1895' !define VERSION '3.4.2.1896'

View file

@ -12,6 +12,8 @@ using PascalABCCompiler.SyntaxTree;
namespace SyntaxVisitors namespace SyntaxVisitors
{ {
// Визитор, заменяющий цикл while на низкоуровневый код из if и goto
// Это - учебный визитор, служит отправной точкой при изучении визиторов изменения синтаксического дерева
public class ChangeWhileVisitor : BaseChangeVisitor public class ChangeWhileVisitor : BaseChangeVisitor
{ {
int lbnum = 0; int lbnum = 0;

View file

@ -18,6 +18,8 @@ using System.Text;
namespace PascalABCCompiler.SyntaxTree namespace PascalABCCompiler.SyntaxTree
{ {
// Визитор накопления легковесной синтаксической таблицы символов.
// Не дописан. Имеет большой потенциал применения
public partial class CollectLightSymInfoVisitor : BaseEnterExitVisitor public partial class CollectLightSymInfoVisitor : BaseEnterExitVisitor
{ {
public ScopeSyntax Root; public ScopeSyntax Root;

View file

@ -11,7 +11,9 @@ using PascalABCCompiler.SyntaxTree;
namespace SyntaxVisitors namespace SyntaxVisitors
{ {
public class CalcConstExprs : BaseChangeVisitor // вычисление целых и вещественных константных выражений на этапе парсинга // Учебный визитор.
// Вычисление целых и вещественных константных выражений на этапе парсинга
public class CalcConstExprs : BaseChangeVisitor
{ {
public override void Exit(syntax_tree_node st) public override void Exit(syntax_tree_node st)
{ {

View file

@ -11,6 +11,7 @@ using PascalABCCompiler.SyntaxTree;
namespace SyntaxVisitors namespace SyntaxVisitors
{ {
// Учебный визитор подсчёта узлов каждого типа
public class CountNodesVisitor : BaseEnterExitVisitor public class CountNodesVisitor : BaseEnterExitVisitor
{ {
public Dictionary<System.Type, int> d = new Dictionary<System.Type, int>(); public Dictionary<System.Type, int> d = new Dictionary<System.Type, int>();

4
TestSuite/actionArr.pas Normal file
View file

@ -0,0 +1,4 @@
begin
var aa := new Action0[1];
Assert(aa[0] = nil);
end.

View file

@ -18280,7 +18280,7 @@ namespace PascalABCCompiler.TreeConverter
type_node tn = ret.visit(_new_expr.type); type_node tn = ret.visit(_new_expr.type);
//if (tn == SystemLibrary.SystemLibrary.void_type) //if (tn == SystemLibrary.SystemLibrary.void_type)
// AddError(new VoidNotValid(get_location(_new_expr.type))); // AddError(new VoidNotValid(get_location(_new_expr.type)));
if (tn.IsDelegate) if (tn.IsDelegate && !_new_expr.new_array)
AddError(get_location(_new_expr), "CONSTRUCTOR_CALL_FOR_DELEGATE_TYPES_IS_FORBIDDEN"); AddError(get_location(_new_expr), "CONSTRUCTOR_CALL_FOR_DELEGATE_TYPES_IS_FORBIDDEN");
check_for_type_allowed(tn,get_location(_new_expr.type)); check_for_type_allowed(tn,get_location(_new_expr.type));
location loc = get_location(_new_expr); location loc = get_location(_new_expr);