Grammar bug fixes from CEDET upstream.
authorDavid Engster <dengste@eml.cc>
Thu, 6 Feb 2014 20:57:24 +0000 (21:57 +0100)
committerDavid Engster <dengste@eml.cc>
Thu, 6 Feb 2014 20:57:24 +0000 (21:57 +0100)
* grammars/c.by (function-pointer): Correctly deal with anonymous
function pointers.
(opt-brackets-after-symbol): New.
(multi-stage-dereference): Use it.  Add rules for explicit
matching the last dereference.

admin/ChangeLog
admin/grammars/c.by

index 35af2d5..3695def 100644 (file)
@@ -1,3 +1,11 @@
+2014-02-06  David Engster  <deng@randomsample.de>
+
+       * grammars/c.by (function-pointer): Correctly deal with anonymous
+       function pointers.
+       (opt-brackets-after-symbol): New.
+       (multi-stage-dereference): Use it.  Add rules for explicit
+       matching the last dereference.
+
 2014-01-16  Eric S. Raymond  <esr@thyrsus.com>
 
        * notes/commits: Add a 'graph on VCS-independent ways of
index fa85689..0fd8a33 100644 (file)
@@ -1113,8 +1113,8 @@ functionname
   ;
 
 function-pointer
-  : LPAREN STAR symbol RPAREN
-    ( (concat "*" $3) )
+  : LPAREN STAR opt-symbol RPAREN
+    ( (concat "*" ,(car $3)) )
   | LPAREN symbol RPAREN
     ( $2 )
   ;
@@ -1154,14 +1154,25 @@ type-cast-list
   : open-paren typeformbase close-paren
   ;
 
+opt-brackets-after-symbol
+  : brackets-after-symbol
+  | ;; EMPTY
+  ;
+
 brackets-after-symbol
   : PAREN_BLCK
   | BRACK_BLCK
   ;
 
 multi-stage-dereference
-  : namespace-symbol brackets-after-symbol PERIOD multi-stage-dereference ;; method call
-  | namespace-symbol brackets-after-symbol MINUS GREATER multi-stage-dereference ;;method call
+  : namespace-symbol opt-brackets-after-symbol
+    PERIOD multi-stage-dereference ;; method call
+  | namespace-symbol opt-brackets-after-symbol
+    MINUS GREATER multi-stage-dereference ;;method call
+  | namespace-symbol opt-brackets-after-symbol
+    PERIOD namespace-symbol opt-brackets-after-symbol
+  | namespace-symbol opt-brackets-after-symbol
+    MINUS GREATER namespace-symbol opt-brackets-after-symbol
   | namespace-symbol brackets-after-symbol
   ;