Небольшие переименования методов
This commit is contained in:
parent
9ccc781465
commit
10764db792
|
|
@ -15,7 +15,7 @@ internal static class RevisionClass
|
|||
public const string Major = "3";
|
||||
public const string Minor = "2";
|
||||
public const string Build = "0";
|
||||
public const string Revision = "1376";
|
||||
public const string Revision = "1377";
|
||||
|
||||
public const string MainVersion = Major + "." + Minor;
|
||||
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
%MINOR%=2
|
||||
%REVISION%=1376
|
||||
%COREVERSION%=0
|
||||
%REVISION%=1377
|
||||
%MINOR%=2
|
||||
%MAJOR%=3
|
||||
|
|
|
|||
|
|
@ -1449,11 +1449,10 @@
|
|||
<i Type="Method">public syntax_tree_node Convert ( syntax_tree_node root )</i>
|
||||
</ICtx>
|
||||
</Node>
|
||||
<Node Name="StandardSyntaxTreeConverter" NL="0" NG="0">
|
||||
<FileName>\StandardSyntaxTreeConverter\StandardSyntaxConverters.cs</FileName>
|
||||
<Text>class StandardSyntaxTreeConverter: ISyntaxTreeConverter</Text>
|
||||
<Node ID="StandardSyntaxTreeConverter" Name="StandardSyntaxTreeConverter" NL="-1" NG="0,2734375">
|
||||
<FileName>\standardsyntaxtreeconverter\standardsyntaxconverter.cs</FileName>
|
||||
<OCtx>
|
||||
<i Type="ClassOrNamespace">class StandardSyntaxTreeConverter : ISyntaxTreeConverter</i>
|
||||
<i Type="ClassOrNamespace">public class StandardSyntaxTreeConverter : ISyntaxTreeConverter</i>
|
||||
<i Type="ClassOrNamespace">namespace PascalABCCompiler . SyntaxTreeConverters</i>
|
||||
<i Type="CS_TreeNode">
|
||||
</i>
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
!define VERSION '3.2.0.1376'
|
||||
!define VERSION '3.2.0.1377'
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@ namespace PascalABCCompiler.SyntaxTreeConverters
|
|||
// Выносим выражения с лямбдами из заголовка foreach
|
||||
StandOutExprWithLambdaInForeachSequenceVisitor.New.ProcessNode(root);
|
||||
|
||||
AssignTuplesDesugarVisitor.New.ProcessNode(root);
|
||||
|
||||
// Пока не доделали
|
||||
//SliceQuestionDesugarVisitor.New.ProcessNode(root);
|
||||
|
||||
|
|
|
|||
|
|
@ -1097,6 +1097,11 @@ namespace PascalABCCompiler.SyntaxTree
|
|||
{
|
||||
DefaultVisit(_slice_expr_question);
|
||||
}
|
||||
|
||||
public virtual void visit(semantic_check_sugared_statement _semantic_check_sugared_statement)
|
||||
{
|
||||
DefaultVisit(_semantic_check_sugared_statement);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1749,6 +1749,14 @@ namespace PascalABCCompiler.SyntaxTree
|
|||
{
|
||||
}
|
||||
|
||||
public virtual void pre_do_visit(semantic_check_sugared_statement _semantic_check_sugared_statement)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void post_do_visit(semantic_check_sugared_statement _semantic_check_sugared_statement)
|
||||
{
|
||||
}
|
||||
|
||||
public override void visit(syntax_tree_node _syntax_tree_node)
|
||||
{
|
||||
DefaultVisit(_syntax_tree_node);
|
||||
|
|
@ -3614,6 +3622,13 @@ namespace PascalABCCompiler.SyntaxTree
|
|||
pre_do_visit(_slice_expr_question);
|
||||
post_do_visit(_slice_expr_question);
|
||||
}
|
||||
|
||||
public override void visit(semantic_check_sugared_statement _semantic_check_sugared_statement)
|
||||
{
|
||||
DefaultVisit(_semantic_check_sugared_statement);
|
||||
pre_do_visit(_semantic_check_sugared_statement);
|
||||
post_do_visit(_semantic_check_sugared_statement);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -456,6 +456,8 @@ namespace PascalABCCompiler.SyntaxTree
|
|||
return new assign_var_tuple();
|
||||
case 217:
|
||||
return new slice_expr_question();
|
||||
case 218:
|
||||
return new semantic_check_sugared_statement();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
@ -3844,6 +3846,18 @@ namespace PascalABCCompiler.SyntaxTree
|
|||
read_slice_expr(_slice_expr_question);
|
||||
}
|
||||
|
||||
|
||||
public void visit(semantic_check_sugared_statement _semantic_check_sugared_statement)
|
||||
{
|
||||
read_semantic_check_sugared_statement(_semantic_check_sugared_statement);
|
||||
}
|
||||
|
||||
public void read_semantic_check_sugared_statement(semantic_check_sugared_statement _semantic_check_sugared_statement)
|
||||
{
|
||||
read_statement(_semantic_check_sugared_statement);
|
||||
_semantic_check_sugared_statement.stat = (object)br.ReadByte();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -6003,6 +6003,19 @@ namespace PascalABCCompiler.SyntaxTree
|
|||
write_slice_expr(_slice_expr_question);
|
||||
}
|
||||
|
||||
|
||||
public void visit(semantic_check_sugared_statement _semantic_check_sugared_statement)
|
||||
{
|
||||
bw.Write((Int16)218);
|
||||
write_semantic_check_sugared_statement(_semantic_check_sugared_statement);
|
||||
}
|
||||
|
||||
public void write_semantic_check_sugared_statement(semantic_check_sugared_statement _semantic_check_sugared_statement)
|
||||
{
|
||||
write_statement(_semantic_check_sugared_statement);
|
||||
bw.Write((byte)_semantic_check_sugared_statement.stat);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -38525,6 +38525,127 @@ namespace PascalABCCompiler.SyntaxTree
|
|||
}
|
||||
|
||||
|
||||
///<summary>
|
||||
///узел, не генерирующий кода, но осуществляющий семантические проверки сахарных узлов. stat - это на самом деле statement. stat сделано типа object - чтобы оно автоматически не обходилось
|
||||
///</summary>
|
||||
[Serializable]
|
||||
public partial class semantic_check_sugared_statement : statement
|
||||
{
|
||||
|
||||
///<summary>
|
||||
///Конструктор без параметров.
|
||||
///</summary>
|
||||
public semantic_check_sugared_statement()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
///<summary>
|
||||
///Конструктор с параметрами.
|
||||
///</summary>
|
||||
public semantic_check_sugared_statement(object _stat)
|
||||
{
|
||||
this._stat=_stat;
|
||||
}
|
||||
|
||||
///<summary>
|
||||
///Конструктор с параметрами.
|
||||
///</summary>
|
||||
public semantic_check_sugared_statement(object _stat,SourceContext sc)
|
||||
{
|
||||
this._stat=_stat;
|
||||
source_context = sc;
|
||||
}
|
||||
protected object _stat;
|
||||
|
||||
///<summary>
|
||||
///
|
||||
///</summary>
|
||||
public object stat
|
||||
{
|
||||
get
|
||||
{
|
||||
return _stat;
|
||||
}
|
||||
set
|
||||
{
|
||||
_stat=value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary> Создает копию узла </summary>
|
||||
public override syntax_tree_node Clone()
|
||||
{
|
||||
semantic_check_sugared_statement copy = new semantic_check_sugared_statement();
|
||||
copy.Parent = this.Parent;
|
||||
if (source_context != null)
|
||||
copy.source_context = new SourceContext(source_context);
|
||||
if (attributes != null)
|
||||
{
|
||||
copy.attributes = (attribute_list)attributes.Clone();
|
||||
copy.attributes.Parent = copy;
|
||||
}
|
||||
copy.stat = stat;
|
||||
return copy;
|
||||
}
|
||||
|
||||
/// <summary> Получает копию данного узла корректного типа </summary>
|
||||
public new semantic_check_sugared_statement TypedClone()
|
||||
{
|
||||
return Clone() as semantic_check_sugared_statement;
|
||||
}
|
||||
|
||||
///<summary>
|
||||
///Свойство для получения количества всех подузлов без элементов поля типа List
|
||||
///</summary>
|
||||
public override Int32 subnodes_without_list_elements_count
|
||||
{
|
||||
get
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
///<summary>
|
||||
///Свойство для получения количества всех подузлов. Подузлом также считается каждый элемент поля типа List
|
||||
///</summary>
|
||||
public override Int32 subnodes_count
|
||||
{
|
||||
get
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
///<summary>
|
||||
///Индексатор для получения всех подузлов
|
||||
///</summary>
|
||||
public override syntax_tree_node this[Int32 ind]
|
||||
{
|
||||
get
|
||||
{
|
||||
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
|
||||
throw new IndexOutOfRangeException();
|
||||
return null;
|
||||
}
|
||||
set
|
||||
{
|
||||
if(subnodes_count == 0 || ind < 0 || ind > subnodes_count-1)
|
||||
throw new IndexOutOfRangeException();
|
||||
}
|
||||
}
|
||||
///<summary>
|
||||
///Метод для обхода дерева посетителем
|
||||
///</summary>
|
||||
///<param name="visitor">Объект-посетитель.</param>
|
||||
///<returns>Return value is void</returns>
|
||||
public override void visit(IVisitor visitor)
|
||||
{
|
||||
visitor.visit(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -273,6 +273,11 @@ namespace PascalABCCompiler.SyntaxTree
|
|||
|
||||
public partial class statement_list
|
||||
{
|
||||
public statement_list(IEnumerable<statement> sts)
|
||||
{
|
||||
AddMany(sts);
|
||||
}
|
||||
|
||||
public statement_list(params statement[] sts)
|
||||
{
|
||||
AddMany(sts);
|
||||
|
|
|
|||
|
|
@ -1312,6 +1312,12 @@ namespace PascalABCCompiler.SyntaxTree
|
|||
///<param name="_slice_expr_question">Node to visit</param>
|
||||
///<returns> Return value is void </returns>
|
||||
void visit(slice_expr_question _slice_expr_question);
|
||||
///<summary>
|
||||
///Method to visit semantic_check_sugared_statement.
|
||||
///</summary>
|
||||
///<param name="_semantic_check_sugared_statement">Node to visit</param>
|
||||
///<returns> Return value is void </returns>
|
||||
void visit(semantic_check_sugared_statement _semantic_check_sugared_statement);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ namespace PascalABCCompiler.SyntaxTree
|
|||
}
|
||||
|
||||
// Можно перенести сюда поскольку замена 1 на 1 позволяет пользоваться текущим DefaultVisit
|
||||
public void ReplaceByVisitor(syntax_tree_node from, syntax_tree_node to)
|
||||
public void ReplaceUsingParent(syntax_tree_node from, syntax_tree_node to)
|
||||
{
|
||||
if (from.Parent == null)
|
||||
throw new Exception("У корневого элемента нельзя получить Parent");
|
||||
|
|
|
|||
Binary file not shown.
71
SyntaxVisitors/SugarVisitors/AssignTuplesDesugarVisitor.cs
Normal file
71
SyntaxVisitors/SugarVisitors/AssignTuplesDesugarVisitor.cs
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
using PascalABCCompiler.SyntaxTree;
|
||||
|
||||
namespace SyntaxVisitors.SugarVisitors
|
||||
{
|
||||
public class AssignTuplesDesugarVisitor : BaseChangeVisitor
|
||||
{
|
||||
public static AssignTuplesDesugarVisitor New
|
||||
{
|
||||
get { return new AssignTuplesDesugarVisitor(); }
|
||||
}
|
||||
|
||||
private int num = 0;
|
||||
|
||||
public string UniqueNumStr()
|
||||
{
|
||||
num++;
|
||||
return num.ToString();
|
||||
}
|
||||
|
||||
public override void visit(assign_tuple asstup)
|
||||
{
|
||||
var sl = new statement_list();
|
||||
sl.Add(new semantic_check_sugared_statement(asstup)); // Это нужно для проверок на этапе преобразования в семантику
|
||||
|
||||
var tname = "#temp_var" + UniqueNumStr();
|
||||
var tt = new var_statement(new ident(tname), asstup.expr);
|
||||
sl.Add(tt);
|
||||
|
||||
var n = asstup.vars.variables.Count();
|
||||
for (var i = 0; i < n; i++)
|
||||
{
|
||||
var a = new assign(asstup.vars.variables[i], new dot_node(new ident(tname),
|
||||
new ident("Item" + (i + 1).ToString())), Operators.Assignment,
|
||||
asstup.vars.variables[i].source_context);
|
||||
sl.Add(a);
|
||||
}
|
||||
// Замена 1 оператор на 1 оператор - всё OK
|
||||
ReplaceUsingParent(asstup, sl);
|
||||
|
||||
visit(asstup.expr);
|
||||
}
|
||||
|
||||
public override void visit(assign_var_tuple assvartup)
|
||||
{
|
||||
var sl = new List<statement>();
|
||||
sl.Add(new semantic_check_sugared_statement(assvartup)); // Это нужно для проверок на этапе преобразования в семантику
|
||||
|
||||
var tname = "#temp_var" + UniqueNumStr();
|
||||
var tt = new var_statement(new ident(tname), assvartup.expr); // тут для assvartup.expr внутри повторно вызывается convert_strong, это плохо, но если там лямбда, то иначе - с semantic_addr_value - не работает!!!
|
||||
sl.Add(tt); // он же помещается в новое синтаксическое дерево
|
||||
|
||||
var n = assvartup.vars.variables.Count();
|
||||
for (var i = 0; i < n; i++)
|
||||
{
|
||||
var a = new var_statement(assvartup.vars.variables[i] as ident,
|
||||
new dot_node(new ident(tname), new ident("Item" + (i + 1).ToString())),
|
||||
assvartup.vars.variables[i].source_context);
|
||||
sl.Add(a);
|
||||
}
|
||||
ReplaceStatementUsingParent(assvartup, sl);
|
||||
|
||||
visit(assvartup.expr); // В assvartup.expr могут содержаться лямбды, в которых будут другие assign_var_tuple.
|
||||
// И вообще другой синтаксический сахар, размещённый в этом визиторе
|
||||
}
|
||||
}
|
||||
}
|
||||
55
SyntaxVisitors/SugarVisitors/SliceQuestionDesugarVisitor.cs
Normal file
55
SyntaxVisitors/SugarVisitors/SliceQuestionDesugarVisitor.cs
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
using PascalABCCompiler.SyntaxTree;
|
||||
|
||||
namespace SyntaxVisitors.SugarVisitors
|
||||
{
|
||||
public class SliceQuestionDesugarVisitor : BaseChangeVisitor
|
||||
{
|
||||
public static SliceQuestionDesugarVisitor New
|
||||
{
|
||||
get { return new SliceQuestionDesugarVisitor(); }
|
||||
}
|
||||
|
||||
expression_list construct_expression_list_for_slice_expr(slice_expr sl)
|
||||
{
|
||||
// situation = 0 - ничего не пропущено
|
||||
// situation = 1 - пропущен from
|
||||
// situation = 2 - пропущен to
|
||||
// situation = 3 - пропущены from и to
|
||||
// Пропущенность кодируется тем, что в соответствующем поле - int.MaxValue
|
||||
// step может просто отсутствовать - это параметр по умолчанию в SystemSlice
|
||||
|
||||
int situation = 0;
|
||||
|
||||
if ((sl.from is int32_const) && (sl.from as int32_const).val == int.MaxValue)
|
||||
situation += 1;
|
||||
if ((sl.to is int32_const) && (sl.to as int32_const).val == int.MaxValue)
|
||||
situation += 2;
|
||||
|
||||
var el = new expression_list();
|
||||
el.Add(new int32_const(situation));
|
||||
el.Add(sl.from); // Это плохо - считается 2 раза. Надо делать semantic_expr_node !!!? Нет!!!
|
||||
// Если там будет лямбда, то не будет работать - известно, что semantic_expr_node не работает с лямбдами
|
||||
// т.к. они несколько раз обходят код.
|
||||
el.Add(sl.to);
|
||||
if (sl.step != null)
|
||||
el.Add(sl.step);
|
||||
|
||||
return el;
|
||||
}
|
||||
|
||||
public override void visit(slice_expr_question sl)
|
||||
{
|
||||
var el = construct_expression_list_for_slice_expr(sl);
|
||||
var mc = new method_call(new dot_node(sl.v, new ident("SystemSliceQuestion", sl.v.source_context), sl.v.source_context), el, sl.source_context);
|
||||
|
||||
ReplaceUsingParent(sl, mc);
|
||||
visit(mc); // обойти заменённое на предмет наличия такого же синтаксического сахара
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -48,6 +48,7 @@
|
|||
<Compile Include="BaseVisitors\HasStatementVisitor.cs" />
|
||||
<Compile Include="BaseVisitors\SmallHelperVisitors.cs" />
|
||||
<Compile Include="ChangeWhileVisitor.cs" />
|
||||
<Compile Include="SugarVisitors\AssignTuplesDesugarVisitor.cs" />
|
||||
<Compile Include="SugarVisitors\SliceQuestionDesugarVisitor.cs" />
|
||||
<Compile Include="YieldVisitors\ObjectCopier\ObjectCopier.cs" />
|
||||
<Compile Include="Optimization\CalcConstExprs.cs" />
|
||||
|
|
|
|||
12
TestSuite/CompilationSamples/TupleVarInLambda.pas
Normal file
12
TestSuite/CompilationSamples/TupleVarInLambda.pas
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
function f(p: integer->integer) := (3,p(1));
|
||||
|
||||
begin
|
||||
var pair := (3,5);
|
||||
(var a, var b) := f(x->begin
|
||||
var pair := (7,9);
|
||||
(var c, var d) := pair;
|
||||
Result := c;
|
||||
end);
|
||||
|
||||
Print(a,b)
|
||||
end.
|
||||
|
|
@ -16732,8 +16732,8 @@ namespace PascalABCCompiler.TreeConverter
|
|||
var fornode = new SyntaxTree.for_node(i, 0, high, newbody, for_cycle_type.to, null, null, true);
|
||||
|
||||
var stl = new SyntaxTree.statement_list(vdarr, fornode);
|
||||
// Замена 1 оператора на 1 оператор. Всё хороо даже если оператор помечен меткой
|
||||
ReplaceByVisitor(_foreach_stmt, stl);
|
||||
// Замена 1 оператора на 1 оператор. Всё хорошо даже если оператор помечен меткой
|
||||
ReplaceUsingParent(_foreach_stmt, stl);
|
||||
|
||||
visit(stl);
|
||||
//visit(vdarr);
|
||||
|
|
@ -19144,24 +19144,17 @@ namespace PascalABCCompiler.TreeConverter
|
|||
|
||||
public override void visit(SyntaxTree.assign_tuple asstup)
|
||||
{
|
||||
// Проверить, что справа - Tuple
|
||||
var expr = convert_strong(asstup.expr);
|
||||
expr = convert_if_typed_expression_to_function_call(expr);
|
||||
var t = ConvertSemanticTypeNodeToNETType(expr.type);
|
||||
if (t == null)
|
||||
AddError(expr.location, "TUPLE_EXPECTED");
|
||||
if (!t.FullName.StartsWith("System.Tuple"))
|
||||
AddError(expr.location, "TUPLE_EXPECTED");
|
||||
AddError(get_location(asstup), "SUGARED_NODE_{0}_IN_SYNTAX_TREE_VISITOR", typeof(assign_var_tuple).Name);
|
||||
|
||||
var n = asstup.vars.variables.Count();
|
||||
if (n > t.GetGenericArguments().Count())
|
||||
AddError(get_location(asstup.vars), "TOO_MANY_ELEMENTS_ON_LEFT_SIDE_OF_TUPLE_ASSIGNMRNT");
|
||||
/*check_sugared(asstup);
|
||||
|
||||
var tname = "#temp_var" + UniqueNumStr();
|
||||
|
||||
//var tt = new var_statement(new ident(tname), new semantic_addr_value(expr)); // тут semantic_addr_value хранит на самом деле expr - просто неудачное название
|
||||
var tt = new var_statement(new ident(tname), asstup.expr); // тут semantic_addr_value хранит на самом деле expr - просто неудачное название
|
||||
var st = new statement_list(tt);
|
||||
|
||||
var n = asstup.vars.variables.Count();
|
||||
for (var i = 0; i < n; i++)
|
||||
{
|
||||
var a = new assign(asstup.vars.variables[i], new dot_node(new ident(tname),
|
||||
|
|
@ -19171,25 +19164,14 @@ namespace PascalABCCompiler.TreeConverter
|
|||
}
|
||||
visit(st);
|
||||
// Замена 1 оператор на 1 оператор - всё OK
|
||||
ReplaceByVisitor(asstup, st);
|
||||
ReplaceUsingParent(asstup, st);*/
|
||||
}
|
||||
|
||||
public override void visit(SyntaxTree.assign_var_tuple assvartup)
|
||||
{
|
||||
// Проверить, что справа - Tuple
|
||||
var expr = convert_strong(assvartup.expr);
|
||||
expr = convert_if_typed_expression_to_function_call(expr);
|
||||
AddError(get_location(assvartup), "SUGARED_NODE_{0}_IN_SYNTAX_TREE_VISITOR", typeof(assign_var_tuple).Name);
|
||||
|
||||
var t = ConvertSemanticTypeNodeToNETType(expr.type);
|
||||
if (t == null)
|
||||
AddError(expr.location, "TUPLE_EXPECTED");
|
||||
|
||||
if (!t.FullName.StartsWith("System.Tuple"))
|
||||
AddError(expr.location, "TUPLE_EXPECTED");
|
||||
|
||||
var n = assvartup.vars.variables.Count();
|
||||
if (n > t.GetGenericArguments().Count())
|
||||
AddError(get_location(assvartup.vars), "TOO_MANY_ELEMENTS_ON_LEFT_SIDE_OF_TUPLE_ASSIGNMRNT");
|
||||
/*check_sugared(assvartup);
|
||||
|
||||
var tname = "#temp_var" + UniqueNumStr();
|
||||
|
||||
|
|
@ -19199,6 +19181,8 @@ namespace PascalABCCompiler.TreeConverter
|
|||
|
||||
var sl = new List<statement>();
|
||||
sl.Add(tt); // он же помещается в новое синтаксическое дерево
|
||||
|
||||
var n = assvartup.vars.variables.Count();
|
||||
for (var i = 0; i < n; i++)
|
||||
{
|
||||
var rr = assvartup.vars.variables[i] as ident;
|
||||
|
|
@ -19210,7 +19194,7 @@ namespace PascalABCCompiler.TreeConverter
|
|||
//visit(a);
|
||||
sl.Add(a);
|
||||
}
|
||||
ReplaceStatementUsingParent(assvartup, sl);
|
||||
ReplaceStatementUsingParent(assvartup, sl);*/
|
||||
}
|
||||
|
||||
expression_list construct_expression_list_for_slice_expr(SyntaxTree.slice_expr sl)
|
||||
|
|
@ -19431,6 +19415,19 @@ namespace PascalABCCompiler.TreeConverter
|
|||
visit(pc);
|
||||
}
|
||||
|
||||
public override void visit(SyntaxTree.semantic_check_sugared_statement st)
|
||||
{
|
||||
if (st.stat is SyntaxTree.assign_var_tuple)
|
||||
{
|
||||
check_sugared(st.stat as SyntaxTree.assign_var_tuple);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
}
|
||||
ret.reset(); // обязательно очистить - этот узел в семантику ничего не должен приносить!
|
||||
}
|
||||
|
||||
/*public SyntaxTree.question_colon_expression ConvertToQCE(dot_question_node dqn)
|
||||
{
|
||||
// Неверно работает. Пока не используется. Доделать
|
||||
|
|
|
|||
|
|
@ -160,6 +160,7 @@
|
|||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="TreeConversion\SemanticRules.cs" />
|
||||
<Compile Include="TreeConversion\semantic_checks_for_sugar.cs" />
|
||||
<Compile Include="TreeConversion\SubtreeCreator.cs" />
|
||||
<Compile Include="TreeConversion\SyntaxTreeToSemanticTreeConverter.cs">
|
||||
<SubType>Code</SubType>
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -8,3 +8,4 @@ INTEGER_VALUE_EXPECTED=Integer value expected
|
|||
BAD_SLICE_OBJECT=Slices are allowed for strings, dynamic arrays and lists only
|
||||
ONLY_IN_SHORT_FUNC_DEFS_RETURN_TYPE_CANBE_OMITTED=Only in short function definitions you can omit the return type
|
||||
ONE_TKIDENTIFIER=Type here must be identifier
|
||||
SUGARED_NODE_{0}_IN_SYNTAX_TREE_VISITOR=Sugared node {0} must not be visited in syntax_tree_visitor
|
||||
|
|
|
|||
|
|
@ -8,3 +8,4 @@ INTEGER_VALUE_EXPECTED=Ожидалось значение целого типа
|
|||
BAD_SLICE_OBJECT=Срезы допустимы только для строк, динамических массивов и списков
|
||||
ONLY_IN_SHORT_FUNC_DEFS_RETURN_TYPE_CANBE_OMITTED=Только в коротких определениях функций можно не указывать тип возвращаемого значения
|
||||
ONE_TKIDENTIFIER=В качестве типа ожидался идентификатор
|
||||
SUGARED_NODE_{0}_IN_SYNTAX_TREE_VISITOR=Сахарный узел {0} не должен обходиться в syntax_tree_visitor. Обратитесь к разработчикам PascalABC.NET
|
||||
|
|
|
|||
Loading…
Reference in a new issue