Georg Bauhaus <[email protected]> writes:

>> ada-mode 5.1.7 is now available in Gnu ELPA.
>
> After installing and restarting Emacs, I just happened to come
> across this parser error:
>
> use_inside_gen_formal.ads:3:6: syntax error in grammar state 2;
> unexpected use, expecting one of (default FUNCTION PROCEDURE PACKAGE
> PRAGMA WITH TYPE IDENTIFIER)
>
> in
>
> with Ada;
> generic
>    use Ada;
> package Use_Inside_Gen_Formal is
>    pragma Pure;
> end Use_Inside_Gen_Formal;

I had simply left out 'use_clause' in the grammar for this case. Patch:

--- ada-grammar.wy      3e5402627b6381c628327fea4ec9f1e72c600ad0
+++ ada-grammar.wy      504f71a7b9e699b48c46f4acc5c27cd6cbd3bfd1
@@ -1186,7 +1186,7 @@ generic_formal_part
   ;
 
 generic_formal_part
-  : GENERIC generic_formal_parameter_declarations ;; leaving out use_clause
+  : GENERIC generic_formal_parameter_declarations
     (progn
       (wisi-statement-action [1 block-start])
       (wisi-containing-action 1 2))
@@ -1205,6 +1205,7 @@ generic_formal_parameter_declaration
   | formal_subprogram_declaration
   | formal_package_declaration
   | pragma
+  | use_clause
   ;
 
 generic_instantiation


> (Also, is it standard practice to restart Emacs after installing
> from ELPA? The new mode worked here only after a restart.)

If you have the old ada-mode loaded when you install the new one, then
you have to restart; Emacs does not have a way to unload a package.

It's actually best to restart _before_ installing the new package (and
don't load anything before installing); that way, the byte compiler has
the cleanest environment. This only matters if I've made a mistake in
the 'require' structure somewhere, but as we have seen, sometimes I need
help finding those :).

-- 
-- Stephe

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

Reply via email to