Subject: bug#35124: 26.1; ada-mode 6.1.0 no longer syntax-highlights package names at end of spec

From: Stephen Leake <[email-masked]>
Date: Fri, 24 May 2019 08:49:55 -0800

Ludovic Brenta <[email-masked]> writes:

> If you load a file consisting of these three lines:
>
> package Foo is
>    procedure P;
> end Foo;
>
> then the second "Foo" is not syntax-highlighted.  

I can't reproduce this with this small file; font-lock requests that the
entire buffer be parsed, so it is done correctly. With a larger file, so
the start of the package is farther away than the default font-lock
chunk size, the final package name is not highlighted.

This is because the 'end Foo;' is extra text at the end of the partial
parse, and the error recovery inserts 'begin', leaving a labeled block,
in which the label is not highlighted.

If the name has a '.', then it can't be a block label, and it might be
possible to convince the error recovery to insert "package <identifier>
is begin" instead; I'll work on that.

-- 
-- Stephe