aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Ludlam2014-11-26 14:24:11 -0500
committerDavid Engster2017-01-23 22:12:32 +0100
commit592b5fe2aac80b5a2dca08c4d0e3966d8f6ebb6e (patch)
tree305f9d3ae4a00ece1408d3dedd46f89cc2ca9e14
parent3cbb968c78a740e2140ec834b7c979154bcf7224 (diff)
downloademacs-592b5fe2aac80b5a2dca08c4d0e3966d8f6ebb6e.tar.gz
emacs-592b5fe2aac80b5a2dca08c4d0e3966d8f6ebb6e.zip
semantic: Improve C++ 'friend' parsing
* 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.
-rw-r--r--admin/grammars/c.by8
1 files changed, 6 insertions, 2 deletions
diff --git a/admin/grammars/c.by b/admin/grammars/c.by
index 3db1be74a22..9bfe4018756 100644
--- a/admin/grammars/c.by
+++ b/admin/grammars/c.by
@@ -319,10 +319,14 @@ classsubparts
319 ;; For QT, they may put a `slot' keyword between the protection 319 ;; For QT, they may put a `slot' keyword between the protection
320 ;; and the COLON. @todo - Have the QT stuff use macros. 320 ;; and the COLON. @todo - Have the QT stuff use macros.
321 (TAG (car $1) 'label) 321 (TAG (car $1) 'label)
322 | FRIEND symbol SEMICOLON
323 ;; Like class, but w/out the CLASS symbol. Add this to avoid
324 ;; it being detected as a variable with undeclared int type.
325 (TAG $2 'friend)
322 | var-or-fun 326 | var-or-fun
323 | FRIEND func-decl 327 | FRIEND func-decl SEMICOLON
324 (TAG (car $2) 'friend) 328 (TAG (car $2) 'friend)
325 | FRIEND CLASS symbol 329 | FRIEND CLASS symbol SEMICOLON
326 (TAG $3 'friend) 330 (TAG $3 'friend)
327 | type 331 | type
328 | define 332 | define