]> git.eshelyaron.com Git - emacs.git/commitdiff
semantic: Improve C++ 'friend' parsing
authorEric Ludlam <zappo@gnu.org>
Wed, 26 Nov 2014 19:24:11 +0000 (14:24 -0500)
committerDavid Engster <deng@randomsample.de>
Mon, 23 Jan 2017 21:12:32 +0000 (22:12 +0100)
* admin/grammars/c.by (classsubparts): Add a FRIEND for a class that
 doesn't specify the token CLASS. Add SEMICOLON to end of friend
 statements.

admin/grammars/c.by

index 3db1be74a2215acbf2952f9bda86f9dca9d1e70e..9bfe4018756d8686a41d1493337cc6ec71079783 100644 (file)
@@ -319,10 +319,14 @@ classsubparts
  ;; For QT, they may put a `slot' keyword between the protection
  ;; and the COLON.  @todo - Have the QT stuff use macros.
     (TAG (car $1) 'label)
+  | FRIEND symbol SEMICOLON
+ ;; Like class, but w/out the CLASS symbol.  Add this to avoid
+ ;; it being detected as a variable with undeclared int type.
+    (TAG $2 'friend)
   | var-or-fun
-  | FRIEND func-decl
+  | FRIEND func-decl SEMICOLON
     (TAG (car $2) 'friend)
-  | FRIEND CLASS symbol
+  | FRIEND CLASS symbol SEMICOLON
     (TAG $3 'friend)
   | type
   | define