bug fix #1053
This commit is contained in:
parent
543d0b678a
commit
f5cb7bc816
|
|
@ -15,7 +15,7 @@ internal static class RevisionClass
|
|||
public const string Major = "3";
|
||||
public const string Minor = "4";
|
||||
public const string Build = "2";
|
||||
public const string Revision = "1889";
|
||||
public const string Revision = "1890";
|
||||
|
||||
public const string MainVersion = Major + "." + Minor;
|
||||
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
%COREVERSION%=2
|
||||
%REVISION%=1889
|
||||
%MINOR%=4
|
||||
%REVISION%=1890
|
||||
%COREVERSION%=2
|
||||
%MAJOR%=3
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -2,7 +2,7 @@
|
|||
// This CSharp output file generated by Gardens Point LEX
|
||||
// Version: 1.1.3.301
|
||||
// Machine: DESKTOP-G8V08V4
|
||||
// DateTime: 06.12.2018 14:23:43
|
||||
// DateTime: 08.12.2018 10:42:32
|
||||
// UserName: ?????????
|
||||
// GPLEX input file <ABCPascal.lex>
|
||||
// GPLEX frame file <embedded resource>
|
||||
|
|
|
|||
|
|
@ -1571,7 +1571,14 @@ object_type
|
|||
record_type
|
||||
: tkRecord optional_base_classes optional_where_section member_list_section tkEnd
|
||||
{
|
||||
$$ = NewRecordType($2 as named_type_reference_list, $3 as where_definition_list, $4 as class_body_list, @$);
|
||||
var nnrt = new class_definition($2 as named_type_reference_list, $4 as class_body_list, class_keyword.Record, null, $3 as where_definition_list, class_attribute.None, false, @$);
|
||||
if (/*nnrt.body!=null && nnrt.body.class_def_blocks!=null &&
|
||||
nnrt.body.class_def_blocks.Count>0 &&*/
|
||||
nnrt.body.class_def_blocks[0].access_mod==null)
|
||||
{
|
||||
nnrt.body.class_def_blocks[0].access_mod = new access_modifer_node(access_modifer.public_modifer);
|
||||
}
|
||||
$$ = nnrt;
|
||||
}
|
||||
;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
// GPPG version 1.3.6
|
||||
// Machine: DESKTOP-G8V08V4
|
||||
// DateTime: 06.12.2018 14:23:43
|
||||
// DateTime: 08.12.2018 10:42:33
|
||||
// UserName: ?????????
|
||||
// Input file <ABCPascal.y>
|
||||
|
||||
|
|
@ -3819,12 +3819,28 @@ public partial class GPPGParser: ShiftReduceParser<PascalABCSavParser.Union, Lex
|
|||
// optional_component_list_seq_end
|
||||
{
|
||||
CurrentSemanticValue.td = NewObjectType((class_attribute)ValueStack[ValueStack.Depth-5].ob, ValueStack[ValueStack.Depth-4].ti, ValueStack[ValueStack.Depth-3].stn as named_type_reference_list, ValueStack[ValueStack.Depth-2].stn as where_definition_list, ValueStack[ValueStack.Depth-1].stn as class_body_list, CurrentLocationSpan);
|
||||
}
|
||||
var tt = CurrentSemanticValue.td.DescendantNodes().OfType<class_definition>();
|
||||
if (tt.Count()>0)
|
||||
{
|
||||
var sc = tt.First().source_context;
|
||||
parsertools.AddErrorFromResource("NESTED_RECORD_DEFINITIONS_ARE_FORBIDDEN", new LexLocation(sc.begin_position.line_num, sc.begin_position.column_num-1, sc.end_position.line_num, sc.end_position.column_num, sc.FileName));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
case 286: // record_type -> tkRecord, optional_base_classes, optional_where_section,
|
||||
// member_list_section, tkEnd
|
||||
{
|
||||
CurrentSemanticValue.td = NewRecordType(ValueStack[ValueStack.Depth-4].stn as named_type_reference_list, ValueStack[ValueStack.Depth-3].stn as where_definition_list, ValueStack[ValueStack.Depth-2].stn as class_body_list, CurrentLocationSpan);
|
||||
var nnrt = new class_definition(ValueStack[ValueStack.Depth-4].stn as named_type_reference_list, ValueStack[ValueStack.Depth-2].stn as class_body_list, class_keyword.Record, null, ValueStack[ValueStack.Depth-3].stn as where_definition_list, class_attribute.None, false, CurrentLocationSpan);
|
||||
if (/*nnrt.body!=null && nnrt.body.class_def_blocks!=null &&
|
||||
nnrt.body.class_def_blocks.Count>0 &&*/
|
||||
nnrt.body.class_def_blocks[0].access_mod==null)
|
||||
{
|
||||
nnrt.body.class_def_blocks[0].access_mod = new access_modifer_node(access_modifer.public_modifer);
|
||||
}
|
||||
CurrentSemanticValue.td = nnrt;
|
||||
}
|
||||
break;
|
||||
case 287: // class_attribute -> tkSealed
|
||||
|
|
|
|||
|
|
@ -237,5 +237,6 @@ script=
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ namespace GPPGParserScanner
|
|||
return nnof;
|
||||
}
|
||||
|
||||
public class_definition NewRecordType(named_type_reference_list opt_base_classes, where_definition_list opt_where_section, class_body_list component_list_seq, LexLocation loc)
|
||||
/*public class_definition NewRecordType(named_type_reference_list opt_base_classes, where_definition_list opt_where_section, class_body_list component_list_seq, LexLocation loc)
|
||||
{
|
||||
var nnrt = new class_definition(opt_base_classes, component_list_seq, class_keyword.Record, null, opt_where_section, class_attribute.None, false, loc);
|
||||
if (nnrt.body!=null && nnrt.body.class_def_blocks!=null &&
|
||||
|
|
@ -147,7 +147,7 @@ namespace GPPGParserScanner
|
|||
nnrt.body.class_def_blocks[0].access_mod = new access_modifer_node(access_modifer.public_modifer);
|
||||
}
|
||||
return nnrt;
|
||||
}
|
||||
} */
|
||||
|
||||
public token_info NewClassOrInterfaceKeyword(token_info tktemp)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
!define VERSION '3.4.2.1889'
|
||||
!define VERSION '3.4.2.1890'
|
||||
|
|
|
|||
12
TestSuite/errors/err0302.pas
Normal file
12
TestSuite/errors/err0302.pas
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
var y: real;
|
||||
|
||||
type
|
||||
A = class
|
||||
fX: record
|
||||
x: integer;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
begin
|
||||
end.
|
||||
|
|
@ -70,4 +70,5 @@ INVALID_INTERFACE_MEMBER=Interface members cannot have definitions
|
|||
EXTENDED_INDEXED_PROPERTIES=Extended indexed properties are not realized
|
||||
ATTRIBUTE_REDECLARED=This attribute has been already applied to type
|
||||
STATIC_PROPERTIES_CANNOT_HAVE_ATTRBUTE_{0}=Static properties cannot have attribute '{0}'
|
||||
RESULT_IDENT_NOT_EXPECTED_IN_THIS_CONTEXT=Result identifier is not allowed in this context
|
||||
RESULT_IDENT_NOT_EXPECTED_IN_THIS_CONTEXT=Result identifier is not allowed in this context
|
||||
NESTED_RECORD_DEFINITIONS_ARE_FORBIDDEN=Nested record definitions are forbidden
|
||||
|
|
@ -71,4 +71,5 @@ EXTENDED_INDEXED_PROPERTIES=Индексные свойства не могут
|
|||
TWO_STRING_LITERALS_IN_SUCCESSION=Две литеральные строковые константы не могут стоять подряд
|
||||
ATTRIBUTE_REDECLARED=Повторное применение атрибута
|
||||
STATIC_PROPERTIES_CANNOT_HAVE_ATTRBUTE_{0}=Статические свойства не могут иметь атрибут '{0}'
|
||||
RESULT_IDENT_NOT_EXPECTED_IN_THIS_CONTEXT=Имя Result недопустимо в этом контексте
|
||||
RESULT_IDENT_NOT_EXPECTED_IN_THIS_CONTEXT=Имя Result недопустимо в этом контексте
|
||||
NESTED_RECORD_DEFINITIONS_ARE_FORBIDDEN=Вложенные описания записей запрещены
|
||||
Loading…
Reference in a new issue