Simon Wright <[email protected]> writes:

> On 8 Jan 2016, at 14:13, Georg Bauhaus <[email protected]> wrote:
>
>> On input of 
>> 
>> package P is
>> 
>>    type S is synchronized interface;
>> 
>>    task type T is new S with
>> 
>>    end T;
>> 
>> end P;
>> 
>> the parser fails, the message being
>> wisi-containing-action: containing-token 'with' has no cache.
>> grammar error; missing action
>> 
>> C-c C-f moves point to after "end" before "P;".
>> Mode version 5.1.8 on Emacs 24.5.1.
>> 
>> I couldn't find a definition in the grammar that agrees
>> with this error at the level of tokens, so I don't know
>> what is going on.
>
> This patch (also attached) solves this problem 

but not the colorization.

>(but seems to work oddly if you put additional newlines before 'new',
>'with'):

It's consistent with other indentation of those keywords.

> diff --git a/ada-grammar.wy b/ada-grammar.wy
> --- a/ada-grammar.wy
> +++ b/ada-grammar.wy
> @@ -2342,7 +2342,7 @@
>    : TASK TYPE IDENTIFIER discriminant_part_opt aspect_specification_opt IS 
> NEW interface_list WITH task_definition
>      SEMICOLON
>      (progn
> -      (wisi-statement-action [1 statement-start 3 name 10 statement-other 11 
> statement-end])
> +      (wisi-statement-action [1 block-start 3 name 9 block-middle 11 
> statement-end])
>        (wisi-containing-action 3 5)
>        (wisi-containing-action 9 10)
>        (wisi-face-action [2 font-lock-type-face]))
>
> I _think_ the point is that for (wisi-containing-action m n), m must
> appear in wisi-statement-action.

Yes, and n must be a non-terminal (a grammar production).

> This change made by comparison with single_task_declaration. Not sure
> why task_type_declaration used statement-start and
> single_task_declaration use block-start; 

single_task_declaration should use statement-start; "TASK" does not
start a block; only "IS" does. This matters for the indentation,
although apparently not in this case.

> there's no statement-middle …?

Right. I only needed block-middle for indentation, for setting the
indentation of "private", "else" etc.

I suspect a redesign of the indentation code could reduce the number of
these classes.

-- 
-- Stephe

_______________________________________________
Emacs-ada-mode mailing list
[email protected]
http://host114.hostmonster.com/mailman/listinfo/emacs-ada-mode_stephe-leake.org

Reply via email to