mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-02 02:06:14 +02:00
compiler:
- add mode switch extendedrecords to allow/disallow extended records syntax, add this mode switch to delphi mode by default - disable/enable extended records parsing based on extendedreocrds mode switch git-svn-id: branches/paul/extended_records@16561 -
This commit is contained in:
parent
11d4eddf67
commit
726ea27bc0
@ -52,7 +52,7 @@ interface
|
||||
[m_delphi,m_all,m_class,m_objpas,m_result,m_string_pchar,
|
||||
m_pointer_2_procedure,m_autoderef,m_tp_procvar,m_initfinal,m_default_ansistring,
|
||||
m_out,m_default_para,m_duplicate_names,m_hintdirective,m_add_pointer,
|
||||
m_property,m_default_inline,m_except];
|
||||
m_property,m_default_inline,m_except,m_extended_records];
|
||||
fpcmodeswitches =
|
||||
[m_fpc,m_all,m_string_pchar,m_nested_comment,m_repeat_forward,
|
||||
m_cvar_support,m_initfinal,m_add_pointer,m_hintdirective,
|
||||
|
@ -273,7 +273,8 @@ interface
|
||||
m_objectivec1, { support interfacing with Objective-C (1.0) }
|
||||
m_objectivec2, { support interfacing with Objective-C (2.0) }
|
||||
m_nested_procvars, { support nested procedural variables }
|
||||
m_non_local_goto { support non local gotos (like iso pascal) }
|
||||
m_non_local_goto, { support non local gotos (like iso pascal) }
|
||||
m_extended_records { extended record syntax with visibility sections, methods and properties }
|
||||
);
|
||||
tmodeswitches = set of tmodeswitch;
|
||||
|
||||
@ -393,7 +394,8 @@ interface
|
||||
'OBJECTIVEC1',
|
||||
'OBJECTIVEC2',
|
||||
'NESTEDPROCVARS',
|
||||
'NONLOCALGOTO');
|
||||
'NONLOCALGOTO',
|
||||
'EXTENDEDRECORDS');
|
||||
|
||||
|
||||
type
|
||||
|
@ -1411,7 +1411,8 @@ implementation
|
||||
sc:=TFPObjectList.create(false);
|
||||
recstlist:=TFPObjectList.create(false);;
|
||||
while (token=_ID) and
|
||||
not(([vd_object,vd_record]*options<>[]) and
|
||||
not(((vd_object in options) or
|
||||
((vd_record in options) and (m_extended_records in current_settings.modeswitches))) and
|
||||
(idtoken in [_PUBLIC,_PRIVATE,_PUBLISHED,_PROTECTED,_STRICT])) do
|
||||
begin
|
||||
visibility:=symtablestack.top.currentvisibility;
|
||||
|
@ -832,7 +832,13 @@ implementation
|
||||
symtablestack.push(recst);
|
||||
{ parse record }
|
||||
consume(_RECORD);
|
||||
parse_record_members;
|
||||
if m_extended_records in current_settings.modeswitches then
|
||||
parse_record_members
|
||||
else
|
||||
begin
|
||||
read_record_fields([vd_record]);
|
||||
consume(_END);
|
||||
end;
|
||||
{ make the record size aligned }
|
||||
recst.addalignmentpadding;
|
||||
{ restore symtable stack }
|
||||
|
Loading…
Reference in New Issue
Block a user