This commit is contained in:
parent
0e3ab0b17a
commit
c8d9f73bee
|
|
@ -1,9 +1,9 @@
|
|||
//
|
||||
// This CSharp output file generated by Gardens Point LEX
|
||||
// Version: 1.1.3.301
|
||||
// Machine: DESKTOP-7B4K9VB
|
||||
// DateTime: 23.07.2018 1:42:02
|
||||
// UserName: Bogdan
|
||||
// Machine: IVAN-PC
|
||||
// DateTime: 24.07.2018 21:27:49
|
||||
// UserName: Ivan
|
||||
// GPLEX input file <ABCPascal.lex>
|
||||
// GPLEX frame file <embedded resource>
|
||||
//
|
||||
|
|
|
|||
|
|
@ -2077,7 +2077,9 @@ property_specifiers
|
|||
else // ðàñøèðåííûå ñâîéñòâà
|
||||
{
|
||||
var id = NewId("#GetGen");
|
||||
var pr = CreateAndAddToClassReadFunc($2,id,@2);
|
||||
procedure_definition pr = null;
|
||||
if (!parsertools.build_tree_for_formatter)
|
||||
pr = CreateAndAddToClassReadFunc($2, id, @2);
|
||||
$$ = NewPropertySpecifiersRead($1, id, pr, $2, $3 as property_accessors, @$); // $2 ïåðåäà¸òñÿ äëÿ ôîðìàòèðîâàíèÿ
|
||||
}
|
||||
}
|
||||
|
|
@ -2096,7 +2098,9 @@ property_specifiers
|
|||
else // ðàñøèðåííûå ñâîéñòâà
|
||||
{
|
||||
var id = NewId("#SetGen");
|
||||
var pr = CreateAndAddToClassWriteProc($2 as statement,id,@2);
|
||||
procedure_definition pr = null;
|
||||
if (!parsertools.build_tree_for_formatter)
|
||||
pr = CreateAndAddToClassWriteProc($2 as statement,id,@2);
|
||||
$$ = NewPropertySpecifiersWrite($1, id, pr, $2 as statement, $3 as property_accessors, @$); // $2 ïåðåäà¸òñÿ äëÿ ôîðìàòèðîâàíèÿ
|
||||
}
|
||||
}
|
||||
|
|
@ -2117,7 +2121,9 @@ write_property_specifiers
|
|||
else
|
||||
{
|
||||
var id = NewId("#SetGen");
|
||||
var pr = CreateAndAddToClassWriteProc($2 as statement,id,@2);
|
||||
procedure_definition pr = null;
|
||||
if (!parsertools.build_tree_for_formatter)
|
||||
pr = CreateAndAddToClassWriteProc($2 as statement,id,@2);
|
||||
$$ = NewPropertySpecifiersWrite($1, id, pr, $2 as statement, null, @$);
|
||||
}
|
||||
}
|
||||
|
|
@ -2134,7 +2140,9 @@ read_property_specifiers
|
|||
else
|
||||
{
|
||||
var id = NewId("#GetGen");
|
||||
var pr = CreateAndAddToClassReadFunc($2,id,@2);
|
||||
procedure_definition pr = null;
|
||||
if (!parsertools.build_tree_for_formatter)
|
||||
pr = CreateAndAddToClassReadFunc($2,id,@2);
|
||||
$$ = NewPropertySpecifiersRead($1, id, pr, $2, null, @$);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
// (see accompanying GPPGcopyright.rtf)
|
||||
|
||||
// GPPG version 1.3.6
|
||||
// Machine: DESKTOP-7B4K9VB
|
||||
// DateTime: 23.07.2018 1:42:03
|
||||
// UserName: Bogdan
|
||||
// Machine: IVAN-PC
|
||||
// DateTime: 24.07.2018 21:27:52
|
||||
// UserName: Ivan
|
||||
// Input file <ABCPascal.y>
|
||||
|
||||
// options: no-lines gplex
|
||||
|
|
@ -4250,7 +4250,9 @@ public partial class GPPGParser: ShiftReduceParser<PascalABCSavParser.Union, Lex
|
|||
else // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
{
|
||||
var id = NewId("#GetGen");
|
||||
var pr = CreateAndAddToClassReadFunc(ValueStack[ValueStack.Depth-2].ex,id,LocationStack[LocationStack.Depth-2]);
|
||||
procedure_definition pr = null;
|
||||
if (!parsertools.build_tree_for_formatter)
|
||||
pr = CreateAndAddToClassReadFunc(ValueStack[ValueStack.Depth-2].ex, id, LocationStack[LocationStack.Depth-2]);
|
||||
CurrentSemanticValue.stn = NewPropertySpecifiersRead(ValueStack[ValueStack.Depth-3].id, id, pr, ValueStack[ValueStack.Depth-2].ex, ValueStack[ValueStack.Depth-1].stn as property_accessors, CurrentLocationSpan); // $2 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
}
|
||||
}
|
||||
|
|
@ -4270,7 +4272,9 @@ public partial class GPPGParser: ShiftReduceParser<PascalABCSavParser.Union, Lex
|
|||
else // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
{
|
||||
var id = NewId("#SetGen");
|
||||
var pr = CreateAndAddToClassWriteProc(ValueStack[ValueStack.Depth-2].stn as statement,id,LocationStack[LocationStack.Depth-2]);
|
||||
procedure_definition pr = null;
|
||||
if (!parsertools.build_tree_for_formatter)
|
||||
pr = CreateAndAddToClassWriteProc(ValueStack[ValueStack.Depth-2].stn as statement,id,LocationStack[LocationStack.Depth-2]);
|
||||
CurrentSemanticValue.stn = NewPropertySpecifiersWrite(ValueStack[ValueStack.Depth-3].id, id, pr, ValueStack[ValueStack.Depth-2].stn as statement, ValueStack[ValueStack.Depth-1].stn as property_accessors, CurrentLocationSpan); // $2 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
}
|
||||
}
|
||||
|
|
@ -4289,7 +4293,9 @@ public partial class GPPGParser: ShiftReduceParser<PascalABCSavParser.Union, Lex
|
|||
else
|
||||
{
|
||||
var id = NewId("#SetGen");
|
||||
var pr = CreateAndAddToClassWriteProc(ValueStack[ValueStack.Depth-1].stn as statement,id,LocationStack[LocationStack.Depth-1]);
|
||||
procedure_definition pr = null;
|
||||
if (!parsertools.build_tree_for_formatter)
|
||||
pr = CreateAndAddToClassWriteProc(ValueStack[ValueStack.Depth-1].stn as statement,id,LocationStack[LocationStack.Depth-1]);
|
||||
CurrentSemanticValue.stn = NewPropertySpecifiersWrite(ValueStack[ValueStack.Depth-2].id, id, pr, ValueStack[ValueStack.Depth-1].stn as statement, null, CurrentLocationSpan);
|
||||
}
|
||||
}
|
||||
|
|
@ -4303,7 +4309,9 @@ public partial class GPPGParser: ShiftReduceParser<PascalABCSavParser.Union, Lex
|
|||
else
|
||||
{
|
||||
var id = NewId("#GetGen");
|
||||
var pr = CreateAndAddToClassReadFunc(ValueStack[ValueStack.Depth-1].ex,id,LocationStack[LocationStack.Depth-1]);
|
||||
procedure_definition pr = null;
|
||||
if (!parsertools.build_tree_for_formatter)
|
||||
pr = CreateAndAddToClassReadFunc(ValueStack[ValueStack.Depth-1].ex,id,LocationStack[LocationStack.Depth-1]);
|
||||
CurrentSemanticValue.stn = NewPropertySpecifiersRead(ValueStack[ValueStack.Depth-2].id, id, pr, ValueStack[ValueStack.Depth-1].ex, null, CurrentLocationSpan);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -232,7 +232,9 @@ namespace GPPGParserScanner
|
|||
}
|
||||
else
|
||||
{
|
||||
if (opt_identifier != null)
|
||||
if (ex != null)
|
||||
nnps.read_accessor = new read_accessor_name(opt_identifier, pr, ex, tkRead.source_context.Merge(ex.source_context));
|
||||
else if (opt_identifier != null)
|
||||
nnps.read_accessor = new read_accessor_name(opt_identifier, pr, ex, tkRead.source_context.Merge(opt_identifier.source_context));
|
||||
else nnps.read_accessor = new read_accessor_name(opt_identifier, pr, ex, tkRead.source_context);
|
||||
|
||||
|
|
@ -248,9 +250,12 @@ namespace GPPGParserScanner
|
|||
{
|
||||
nnpsw = new property_accessors();
|
||||
}
|
||||
if (opt_identifier != null)
|
||||
if (st != null)
|
||||
nnpsw.write_accessor = new write_accessor_name(opt_identifier, pr, st, tkWrite.source_context.Merge(st.source_context));
|
||||
else if (opt_identifier != null)
|
||||
nnpsw.write_accessor = new write_accessor_name(opt_identifier,pr,st,tkWrite.source_context.Merge(opt_identifier.source_context));
|
||||
else nnpsw.write_accessor = new write_accessor_name(opt_identifier,pr,st,tkWrite.source_context);
|
||||
else
|
||||
nnpsw.write_accessor = new write_accessor_name(opt_identifier,pr,st,tkWrite.source_context);
|
||||
nnpsw.source_context = loc;
|
||||
return nnpsw;
|
||||
}
|
||||
|
|
|
|||
8
TestSuite/formatter_tests/input/property3.pas
Normal file
8
TestSuite/formatter_tests/input/property3.pas
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
type
|
||||
t1 = class
|
||||
x: integer;
|
||||
property p1: real read x+1 write begin x:=1; end;
|
||||
property p2:real read x+3;
|
||||
end;
|
||||
|
||||
begin end.
|
||||
8
TestSuite/formatter_tests/should/property3.pas
Normal file
8
TestSuite/formatter_tests/should/property3.pas
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
type
|
||||
t1 = class
|
||||
x: integer;
|
||||
property p1: real read x + 1 write begin x := 1; end;
|
||||
property p2: real read x + 3;
|
||||
end;
|
||||
|
||||
begin end.
|
||||
Loading…
Reference in a new issue