Permalink
Browse files

Кое-какие правки для реализации синтаксического сахара

  • Loading branch information...
1 parent 32cc3ed commit 15577757999267e7dec5906d55f81aa84961f044 @miks1965 miks1965 committed Jan 10, 2017
@@ -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 = "1372";
+ public const string Revision = "1373";
public const string MainVersion = Major + "." + Minor;
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;
@@ -1,4 +1,4 @@
-%MINOR%=2
-%REVISION%=1372
%COREVERSION%=0
+%REVISION%=1373
+%MINOR%=2
%MAJOR%=3
View
@@ -1341,12 +1341,21 @@
</Node>
<Node Name="[::]" NL="0" NG="0">
<Items>
- <Node Name="visit(slice_expr" NL="0,9521484" NG="-1">
- <FileName>\treeconverter\treeconversion\syntax_tree_visitor.cs</FileName>
- <Text>public override void visit(SyntaxTree.slice_expr sl)</Text>
+ <Node ID="visit" Name="visit(slice_expr" NL="0,9521484" NG="-1">
+ <FileName>\TreeConverter\TreeConversion\syntax_tree_visitor.cs</FileName>
<OCtx>
<i Type="Method">public override void visit ( SyntaxTree . slice_expr sl )</i>
- <i Type="ClassOrNamespace">public class syntax_tree_visitor : SyntaxTree . WalkingVisitorNew</i>
+ <i Type="ClassOrNamespace">public partial class syntax_tree_visitor : SyntaxTree . WalkingVisitorNew</i>
+ <i Type="ClassOrNamespace">namespace PascalABCCompiler . TreeConverter</i>
+ <i Type="CS_TreeNode">
+ </i>
+ </OCtx>
+ </Node>
+ <Node ID="visit" Name="visit(slice_expr_question" NL="0,9521484" NG="-1">
+ <FileName>\TreeConverter\TreeConversion\syntax_tree_visitor.cs</FileName>
+ <OCtx>
+ <i Type="Method">public override void visit ( SyntaxTree . slice_expr_question sl )</i>
+ <i Type="ClassOrNamespace">public partial class syntax_tree_visitor : SyntaxTree . WalkingVisitorNew</i>
<i Type="ClassOrNamespace">namespace PascalABCCompiler . TreeConverter</i>
<i Type="CS_TreeNode">
</i>
@@ -1 +1 @@
-!define VERSION '3.2.0.1372'
+!define VERSION '3.2.0.1373'
@@ -3612,10 +3612,6 @@ public override void visit(slice_expr_question _slice_expr_question)
{
DefaultVisit(_slice_expr_question);
pre_do_visit(_slice_expr_question);
- visit(slice_expr_question.v);
- visit(slice_expr_question.from);
- visit(slice_expr_question.to);
- visit(slice_expr_question.step);
post_do_visit(_slice_expr_question);
}
}
@@ -3841,11 +3841,7 @@ public void visit(slice_expr_question _slice_expr_question)
public void read_slice_expr_question(slice_expr_question _slice_expr_question)
{
- read_dereference(_slice_expr_question);
- _slice_expr_question.v = _read_node() as addressed_value;
- _slice_expr_question.from = _read_node() as expression;
- _slice_expr_question.to = _read_node() as expression;
- _slice_expr_question.step = _read_node() as expression;
+ read_slice_expr(_slice_expr_question);
}
}
@@ -6000,43 +6000,7 @@ public void visit(slice_expr_question _slice_expr_question)
public void write_slice_expr_question(slice_expr_question _slice_expr_question)
{
- write_dereference(_slice_expr_question);
- if (_slice_expr_question.v == null)
- {
- bw.Write((byte)0);
- }
- else
- {
- bw.Write((byte)1);
- _slice_expr_question.v.visit(this);
- }
- if (_slice_expr_question.from == null)
- {
- bw.Write((byte)0);
- }
- else
- {
- bw.Write((byte)1);
- _slice_expr_question.from.visit(this);
- }
- if (_slice_expr_question.to == null)
- {
- bw.Write((byte)0);
- }
- else
- {
- bw.Write((byte)1);
- _slice_expr_question.to.visit(this);
- }
- if (_slice_expr_question.step == null)
- {
- bw.Write((byte)0);
- }
- else
- {
- bw.Write((byte)1);
- _slice_expr_question.step.visit(this);
- }
+ write_slice_expr(_slice_expr_question);
}
}
@@ -38362,7 +38362,7 @@ public override void visit(IVisitor visitor)
///
///</summary>
[Serializable]
- public partial class slice_expr_question : dereference
+ public partial class slice_expr_question : slice_expr
{
///<summary>
@@ -38373,28 +38373,6 @@ public slice_expr_question()
}
- ///<summary>
- ///Конструктор с параметрами.
- ///</summary>
- public slice_expr_question(addressed_value _v,expression _from,expression _to,expression _step)
- {
- this._v=_v;
- this._from=_from;
- this._to=_to;
- this._step=_step;
- }
-
- ///<summary>
- ///Конструктор с параметрами.
- ///</summary>
- public slice_expr_question(addressed_value _v,expression _from,expression _to,expression _step,SourceContext sc)
- {
- this._v=_v;
- this._from=_from;
- this._to=_to;
- this._step=_step;
- source_context = sc;
- }
///<summary>
///Конструктор с параметрами.
@@ -38420,72 +38398,6 @@ public slice_expr_question(addressed_value _dereferencing_value,addressed_value
this._step=_step;
source_context = sc;
}
- protected addressed_value _v;
- protected expression _from;
- protected expression _to;
- protected expression _step;
-
- ///<summary>
- ///
- ///</summary>
- public addressed_value v
- {
- get
- {
- return _v;
- }
- set
- {
- _v=value;
- }
- }
-
- ///<summary>
- ///
- ///</summary>
- public expression from
- {
- get
- {
- return _from;
- }
- set
- {
- _from=value;
- }
- }
-
- ///<summary>
- ///
- ///</summary>
- public expression to
- {
- get
- {
- return _to;
- }
- set
- {
- _to=value;
- }
- }
-
- ///<summary>
- ///
- ///</summary>
- public expression step
- {
- get
- {
- return _step;
- }
- set
- {
- _step=value;
- }
- }
-
-
/// <summary> Создает копию узла </summary>
public override syntax_tree_node Clone()
{
@@ -1621,7 +1621,6 @@ public dot_node dot_node(ident id, SourceContext sc = null)
public partial class expression
{
- public object semantic_ex = null; // 3.01.17 convert_strong, вызванная первый раз, заполняет это поле, а потом только обращается к нему
public expression Plus(expression e)
{
return new bin_expr(this, e, Operators.Plus);
@@ -1636,5 +1635,13 @@ public expression Minus(expression e)
}
}
+ public partial class slice_expr_question
+ {
+ public slice_expr_question(addressed_value v, expression from, expression to, expression step) : base(v, from, to, step)
+ { }
+ public slice_expr_question(addressed_value v, expression from, expression to, expression step, SourceContext sc) : base(v, from, to, step, sc)
+ { }
+ }
+
}
Binary file not shown.
Oops, something went wrong.

0 comments on commit 1557775

Please sign in to comment.