fix #1761
This commit is contained in:
parent
d2a5dd813b
commit
d3ffb2c93c
|
|
@ -1,9 +1,9 @@
|
|||
//
|
||||
// This CSharp output file generated by Gardens Point LEX
|
||||
// Version: 1.1.3.301
|
||||
// Machine: DESKTOP-IF20NRO
|
||||
// DateTime: 1/25/2019 9:59:06 AM
|
||||
// UserName: FatCow
|
||||
// Machine: DESKTOP-G8V08V4
|
||||
// DateTime: 22.02.2019 19:09:57
|
||||
// UserName: ?????????
|
||||
// GPLEX input file <ABCPascal.lex>
|
||||
// GPLEX frame file <embedded resource>
|
||||
//
|
||||
|
|
|
|||
|
|
@ -3209,6 +3209,8 @@ new_expr
|
|||
field_in_unnamed_object
|
||||
: identifier tkAssign relop_expr
|
||||
{
|
||||
if ($3 is nil_const)
|
||||
parsertools.AddErrorFromResource("NIL_IN_UNNAMED_OBJECT",@$);
|
||||
$$ = new name_assign_expr($1,$3,@$);
|
||||
}
|
||||
| relop_expr
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
// (see accompanying GPPGcopyright.rtf)
|
||||
|
||||
// GPPG version 1.3.6
|
||||
// Machine: DESKTOP-IF20NRO
|
||||
// DateTime: 1/25/2019 9:59:07 AM
|
||||
// UserName: FatCow
|
||||
// Machine: DESKTOP-G8V08V4
|
||||
// DateTime: 22.02.2019 19:09:58
|
||||
// UserName: ?????????
|
||||
// Input file <ABCPascal.y>
|
||||
|
||||
// options: no-lines gplex
|
||||
|
|
@ -5423,6 +5423,8 @@ public partial class GPPGParser: ShiftReduceParser<PascalABCSavParser.Union, Lex
|
|||
break;
|
||||
case 600: // field_in_unnamed_object -> identifier, tkAssign, relop_expr
|
||||
{
|
||||
if (ValueStack[ValueStack.Depth-1].ex is nil_const)
|
||||
parsertools.AddErrorFromResource("NIL_IN_UNNAMED_OBJECT",CurrentLocationSpan);
|
||||
CurrentSemanticValue.ob = new name_assign_expr(ValueStack[ValueStack.Depth-3].id,ValueStack[ValueStack.Depth-1].ex,CurrentLocationSpan);
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -240,5 +240,6 @@ script=
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
3
TestSuite/errors/err0308.pas
Normal file
3
TestSuite/errors/err0308.pas
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
begin
|
||||
var x := new class(p := nil);
|
||||
end.
|
||||
|
|
@ -71,4 +71,5 @@ 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
|
||||
NESTED_RECORD_DEFINITIONS_ARE_ARE_FORBIDDEN=Nested record definitions are forbidden
|
||||
NESTED_RECORD_DEFINITIONS_ARE_ARE_FORBIDDEN=Nested record definitions are forbidden
|
||||
NIL_IN_UNNAMED_OBJECT=Anonymous class field cannot be initialized by nil constant
|
||||
|
|
@ -72,4 +72,5 @@ TWO_STRING_LITERALS_IN_SUCCESSION=Две литеральные строковы
|
|||
ATTRIBUTE_REDECLARED=Повторное применение атрибута
|
||||
STATIC_PROPERTIES_CANNOT_HAVE_ATTRBUTE_{0}=Статические свойства не могут иметь атрибут '{0}'
|
||||
RESULT_IDENT_NOT_EXPECTED_IN_THIS_CONTEXT=Имя Result недопустимо в этом контексте
|
||||
NESTED_RECORD_DEFINITIONS_ARE_FORBIDDEN=Вложенные описания записей запрещены
|
||||
NESTED_RECORD_DEFINITIONS_ARE_FORBIDDEN=Вложенные описания записей запрещены
|
||||
NIL_IN_UNNAMED_OBJECT=Поле анонимного класса не может инициализироваться константой nil
|
||||
Loading…
Reference in a new issue