From 592b5fe2aac80b5a2dca08c4d0e3966d8f6ebb6e Mon Sep 17 00:00:00 2001 From: Eric Ludlam Date: Wed, 26 Nov 2014 14:24:11 -0500 Subject: [PATCH] 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. --- admin/grammars/c.by | 8 ++++++-- 1 file 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 ;; 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 -- 2.39.5