This commit is contained in:
Александр Погорелов 2018-12-08 20:36:24 +03:00
parent f5cb7bc816
commit 300c5932a6
5 changed files with 2070 additions and 2040 deletions

View file

@ -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>
//

View file

@ -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

View file

@ -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;

View file

@ -0,0 +1,9 @@
type
TClass = class
static auto property X: byte;
end;
begin
TClass.X := 100;
assert(TClass.X = 100);
end.