fix #1577
This commit is contained in:
parent
f5cb7bc816
commit
300c5932a6
|
|
@ -1,9 +1,9 @@
|
|||
//
|
||||
// This CSharp output file generated by Gardens Point LEX
|
||||
// Version: 1.1.3.301
|
||||
// Machine: DESKTOP-G8V08V4
|
||||
// DateTime: 08.12.2018 10:42:32
|
||||
// UserName: ?????????
|
||||
// Machine: DESKTOP-LFNDRFO
|
||||
// DateTime: 12/8/2018 7:51:52 PM
|
||||
// UserName: wowit
|
||||
// GPLEX input file <ABCPascal.lex>
|
||||
// GPLEX frame file <embedded resource>
|
||||
//
|
||||
|
|
|
|||
|
|
@ -1999,6 +1999,12 @@ simple_property_definition
|
|||
$$ = NewSimplePropertyDefinition($3 as method_name, $4 as property_interface, null, proc_attribute.attr_none, null, @$);
|
||||
($$ as simple_property).is_auto = true;
|
||||
}
|
||||
| class_or_static tkAuto tkProperty qualified_identifier property_interface tkSemiColon
|
||||
{
|
||||
$$ = NewSimplePropertyDefinition($4 as method_name, $5 as property_interface, null, proc_attribute.attr_none, null, @$);
|
||||
($$ as simple_property).is_auto = true;
|
||||
($$ as simple_property).attr = definition_attribute.Static;
|
||||
}
|
||||
;
|
||||
|
||||
array_defaultproperty
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -98,14 +98,21 @@ namespace SyntaxVisitors.SugarVisitors
|
|||
accessors.read_accessor = new read_accessor_name(id, null, null, simple_property.source_context);
|
||||
simple_property.accessors = accessors;
|
||||
|
||||
var def_attribute = definition_attribute.None;
|
||||
if (simple_property.attr == definition_attribute.Static)
|
||||
{
|
||||
def_attribute = definition_attribute.Static;
|
||||
}
|
||||
|
||||
List<ident> l = new List<ident>() { id };
|
||||
var var_def_statement = new var_def_statement(
|
||||
new ident_list(l, simple_property.source_context),
|
||||
simple_property.property_type,
|
||||
null,
|
||||
definition_attribute.None,
|
||||
def_attribute,
|
||||
false,
|
||||
simple_property.source_context);
|
||||
|
||||
members.Add(var_def_statement);
|
||||
}
|
||||
|
||||
|
|
@ -137,6 +144,7 @@ namespace SyntaxVisitors.SugarVisitors
|
|||
}
|
||||
|
||||
members.Add(read_accessor_procedure);
|
||||
|
||||
if (simple_property.attr == definition_attribute.Static)
|
||||
{
|
||||
read_accessor_procedure.proc_header.class_keyword = true;
|
||||
|
|
@ -180,6 +188,7 @@ namespace SyntaxVisitors.SugarVisitors
|
|||
}
|
||||
|
||||
members.Add(write_accessor_procedure);
|
||||
|
||||
if (simple_property.attr == definition_attribute.Static)
|
||||
{
|
||||
write_accessor_procedure.proc_header.class_keyword = true;
|
||||
|
|
|
|||
9
TestSuite/autoproperty5.pas
Normal file
9
TestSuite/autoproperty5.pas
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
type
|
||||
TClass = class
|
||||
static auto property X: byte;
|
||||
end;
|
||||
|
||||
begin
|
||||
TClass.X := 100;
|
||||
assert(TClass.X = 100);
|
||||
end.
|
||||
Loading…
Reference in a new issue