Georg Bauhaus <[email protected]> writes:

> Hi,
>
> given
>
> procedure Access_To_Array_2 is
>    Size : constant Positive := 100;
>    type M is array (Positive range <>, Positive range <>) of Integer;
>    type S is access M (1.. Size, 1.. Size);
> begin
>    null;
> end Access_To_Array_2;
>
> I get
> access_to_array_2.adb:4:32: syntax error in grammar state 194;
> unexpected ,, expecting one of (default BAR EQUAL_GREATER RIGHT_PAREN)
>
> for C-c C-f (Ada mode 5.1.7). GNAT GPL 2014 is happy.

That's because of an optimization I put in to reduce grammar conflicts;
I missed this case. Here's a patch:

============================================================
--- ada-grammar.wy      8e531a20b5892b0289d7d4309358c6ac0b634762
+++ ada-grammar.wy      1823fb0d108e3a62858058f1f6d066037a40dc81
@@ -224,6 +224,8 @@
 %conflict REDUCE/REDUCE in state primary, subtype_indication on token COMMA
 %conflict REDUCE/REDUCE in state primary, subtype_indication on token 
EQUAL_GREATER
 %conflict REDUCE/REDUCE in state primary, subtype_indication on token 
RIGHT_PAREN
+%conflict REDUCE/REDUCE in state range_list, discrete_subtype_definition on 
token COMMA
+%conflict REDUCE/REDUCE in state range_list, discrete_subtype_definition on 
token RIGHT_PAREN
 %conflict SHIFT/REDUCE in state actual_parameter_part, 
actual_parameter_part_opt on token LEFT_PAREN
 %conflict SHIFT/REDUCE in state actual_parameter_part, attribute_designator on 
token LEFT_PAREN
 %conflict SHIFT/REDUCE in state aspect_clause, name on token USE
@@ -238,7 +240,6 @@
 %conflict SHIFT/REDUCE in state generic_renaming_declaration, 
generic_formal_part on token PACKAGE
 %conflict SHIFT/REDUCE in state generic_renaming_declaration, 
generic_formal_part on token PROCEDURE
 %conflict SHIFT/REDUCE in state label_opt, label_opt on token IDENTIFIER
-%conflict SHIFT/REDUCE in state name, discrete_subtype_definition on token 
RIGHT_PAREN
 %conflict SHIFT/REDUCE in state null_exclusion_opt, mode_opt on token NOT
 %conflict SHIFT/REDUCE in state null_procedure_declaration, 
subprogram_specification on token IS
 %conflict SHIFT/REDUCE in state object_renaming_declaration, identifier_list 
on token COLON
@@ -1520,7 +1521,7 @@ name
  ;; ARM has name ( discrete_subtype_definition ) here, but thats
  ;; partly redundant with name actual_parameter_part; this is the
  ;; part that is not redundant.
-  | name LEFT_PAREN range RIGHT_PAREN ;; slice
+  | name LEFT_PAREN range_list RIGHT_PAREN ;; slice or constraint
     (progn
       (wisi-statement-action [1 name-paren 2 open-paren 4 close-paren])
       (wisi-containing-action 1 2)
@@ -1976,6 +1977,14 @@ range
   | simple_expression DOT_DOT simple_expression
   ;
 
+range_list
+  : range
+  | range_list COMMA range
+    (progn
+      (wisi-statement-action [2 list-break])
+      (wisi-containing-action 2 3))
+  ;
+
 real_range_specification_opt
   : ;; empty
   | RANGE simple_expression DOT_DOT simple_expression


I was _almost_ done with the 5.1.8 release, but this will be in that,
since it's a minor change.

-- 
-- Stephe

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

Reply via email to