mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 20:09:18 +02:00
* try to specialize a specialize node if it's followed by a < in a non-code section so that we might get better error messages
This commit is contained in:
parent
33ef88858d
commit
6407b5f4db
@ -4816,6 +4816,27 @@ implementation
|
|||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
until false;
|
until false;
|
||||||
|
if (p1.nodetype=specializen) and
|
||||||
|
(token=_LSHARPBRACKET) and
|
||||||
|
(m_delphi in current_settings.modeswitches) then
|
||||||
|
begin
|
||||||
|
filepos:=current_tokenpos;
|
||||||
|
consume(token);
|
||||||
|
p2:=factor(false,[]);
|
||||||
|
if maybe_handle_specialization(p1,p2,filepos) then
|
||||||
|
begin
|
||||||
|
{ with p1 now set we are in reality directly behind the
|
||||||
|
call to "factor" thus we need to call down to that
|
||||||
|
again }
|
||||||
|
{ This is disabled until specializations on the right
|
||||||
|
hand side work as well, because
|
||||||
|
"not working expressions" is better than "half working
|
||||||
|
expressions" }
|
||||||
|
{factornode:=p1;
|
||||||
|
goto SubExprStart;}
|
||||||
|
end else
|
||||||
|
message(parser_e_illegal_expression);
|
||||||
|
end;
|
||||||
sub_expr:=p1;
|
sub_expr:=p1;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user